Add new example with implementation of Perlin Noise

~4.2x speedup versus serial on OSX / gcc.
~2.9x speedup versus serial on Windows / MSVC.
This commit is contained in:
Matt Pharr
2011-08-01 10:33:18 +01:00
parent a552927a6a
commit a4bb6b5520
10 changed files with 707 additions and 12 deletions

View File

@@ -48,19 +48,19 @@ static void __cpuid(int info[4], int infoType) {
inline bool CPUSupportsSSE2() {
int info[4];
__cpuid(info, 1);
return (info[3] & (1 << 26));
return (info[3] & (1 << 26)) != 0;
}
inline bool CPUSupportsSSE4() {
int info[4];
__cpuid(info, 1);
return (info[2] & (1 << 19));
return (info[2] & (1 << 19)) != 0;
}
inline bool CPUSupportsAVX() {
int info[4];
__cpuid(info, 1);
return (info[2] & (1 << 28));
return (info[2] & (1 << 28)) != 0;
}
#endif // ISPC_CPUID_H