diff options
Diffstat (limited to 'Tests/ISPC/Defines/simple.ispc')
-rw-r--r-- | Tests/ISPC/Defines/simple.ispc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/ISPC/Defines/simple.ispc b/Tests/ISPC/Defines/simple.ispc new file mode 100644 index 0000000..d8d6465 --- /dev/null +++ b/Tests/ISPC/Defines/simple.ispc @@ -0,0 +1,15 @@ + +//textual error if STRUCT_DEFINE not set +STRUCT_DEFINE;}; + +export void simple(uniform float vin[], uniform float vout[], + uniform int count) { + foreach (index = 0 ... count) { + float v = vin[index]; + if (v < M_PI) + v = v * v; + else + v = sqrt(v); + vout[index] = v; + } +} |