Files
CMake/Tests/ISPC/DynamicLibrary/simple.cxx
Robert Maynard 8de145cae1 ISPC: DynamicLibrary test now passes on windows.
The MSVC linker needs to know what MSVC runtime a shared library
needs. ISPC objects don't have a '/DIRECTIVE' entry for the
MSVC runtime as they have no dependency on it. Therefore
we need to add a C or C++ source to each shared library so
the MSVC linker knows what runtime to embed
2020-09-10 16:15:55 -04:00

24 lines
361 B
C++

#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;
}