summaryrefslogtreecommitdiffstats
path: root/Tests/ISPC/CustomHeaderSuffix/extra.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-12-10 21:08:24 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-14 18:13:09 (GMT)
commitc9a50f35565dcc1df8bd82126ecced95e60c29e4 (patch)
treeede35e80def43d76af7378632f05115c0b43bea7 /Tests/ISPC/CustomHeaderSuffix/extra.cxx
parent6aff058ab4a2d54a316dbaa536572ad71efb8b51 (diff)
downloadCMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.zip
CMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.tar.gz
CMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.tar.bz2
ISPC: Generated Headers suffix configurable with a better default
The target property `ISPC_HEADER_SUFFIX` and associated global variable now can control the suffix used when generating the C/C++ interoperability ISPC headers. In addition the default suffix is now "_ispc.h" which matches the common convention that the ISPC compiler team uses and recommends.
Diffstat (limited to 'Tests/ISPC/CustomHeaderSuffix/extra.cxx')
-rw-r--r--Tests/ISPC/CustomHeaderSuffix/extra.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/ISPC/CustomHeaderSuffix/extra.cxx b/Tests/ISPC/CustomHeaderSuffix/extra.cxx
new file mode 100644
index 0000000..0354e2d
--- /dev/null
+++ b/Tests/ISPC/CustomHeaderSuffix/extra.cxx
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+#include "extra___ispc.h"
+
+int extra()
+{
+ float vin[16], vout[16];
+ for (int i = 0; i < 16; ++i)
+ vin[i] = i;
+
+ ispc::extra(vin, vout, 16);
+
+ for (int i = 0; i < 16; ++i)
+ printf("%d: extra(%f) = %f\n", i, vin[i], vout[i]);
+
+ return 0;
+}