[PATCH] D20389: NVPTX: Add supported CL features
Jan Vesely via llvm-commits
llvm-commits at lists.llvm.org
Wed May 18 15:43:30 PDT 2016
jvesely updated the summary for this revision.
jvesely updated this revision to Diff 57693.
jvesely added a comment.
add test
Repository:
rL LLVM
http://reviews.llvm.org/D20389
Files:
lib/Basic/Targets.cpp
test/Misc/nvptx.languageOptsOpenCL.cl
Index: test/Misc/nvptx.languageOptsOpenCL.cl
===================================================================
--- /dev/null
+++ test/Misc/nvptx.languageOptsOpenCL.cl
@@ -0,0 +1,16 @@
+// REQUIRES: nvptx-registered-target
+// RUN: %clang_cc1 -x cl %s -verify -triple nvptx-unknown-unknown -Werror
+// RUN: %clang_cc1 -x cl %s -verify -triple nvptx64-unknown-unknown -Werror
+// expected-no-diagnostics
+
+#pragma EXTENSION cl_clang_storage_class_specifiers: enabled
+#pragma EXTENSION cl_khr_gl_event: enabled
+#pragma EXTENSION cl_khr_gl_sharing: enabled
+#pragma EXTENSION cl_khr_subgroups: enabled
+
+#pragma EXTENSION cl_khr_fp64: enabled
+#pragma EXTENSION cl_khr_byte_addressable_storage: enabled
+#pragma EXTENSION cl_khr_global_int32_base_atomics: enabled
+#pragma EXTENSION cl_khr_global_int32_extended_atomics: enabled
+#pragma EXTENSION cl_khr_local_int32_base_atomics: enabled
+#pragma EXTENSION cl_khr_local_int32_extended_atomics: enabled
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -1840,6 +1840,21 @@
return GPU != GK_NONE;
}
+ void setSupportedOpenCLOpts() override {
+ auto &Opts = getSupportedOpenCLOpts();
+ Opts.cl_clang_storage_class_specifiers = 1;
+ Opts.cl_khr_gl_sharing = 1;
+ Opts.cl_khr_gl_event = 1;
+ Opts.cl_khr_d3d10_sharing = 1;
+ Opts.cl_khr_subgroups = 1;
+
+ Opts.cl_khr_fp64 = 1;
+ Opts.cl_khr_byte_addressable_store = 1;
+ Opts.cl_khr_global_int32_base_atomics = 1;
+ Opts.cl_khr_global_int32_extended_atomics = 1;
+ Opts.cl_khr_local_int32_base_atomics = 1;
+ Opts.cl_khr_local_int32_extended_atomics = 1;
+ }
};
const Builtin::Info NVPTXTargetInfo::BuiltinInfo[] = {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20389.57693.patch
Type: text/x-patch
Size: 1770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160518/2a9b62bf/attachment.bin>
More information about the llvm-commits
mailing list