diff options
Diffstat (limited to 'Tests/ISPC/DynamicLibrary/simple.cxx')
-rw-r--r-- | Tests/ISPC/DynamicLibrary/simple.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/ISPC/DynamicLibrary/simple.cxx b/Tests/ISPC/DynamicLibrary/simple.cxx new file mode 100644 index 0000000000..cb5a779e33 --- /dev/null +++ b/Tests/ISPC/DynamicLibrary/simple.cxx @@ -0,0 +1,23 @@ +#include <stdio.h> + +#include "simple.ispc.h" + +#ifdef _WIN32 +# define EXPORT __declspec(dllexport) +#else +# define EXPORT +#endif + +EXPORT int simple() +{ + float vin[16], vout[16]; + for (int i = 0; i < 16; ++i) + vin[i] = i; + + ispc::simple(vin, vout, 16); + + for (int i = 0; i < 16; ++i) + printf("%d: extra(%f) = %f\n", i, vin[i], vout[i]); + + return 0; +} |