File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 %s -x cl -fdeclare-spirv-builtins -fsyntax-only -emit-llvm -o - -O0 | FileCheck %s
2
+ //
3
+ // Check that SPIR-V builtins are declared with OpenCL address spaces rather
4
+ // than SYCL address spaces when using them with OpenCL. OpenCL address spaces
5
+ // are mangled with the CL prefix and SYCL address spaces are mangled with the
6
+ // SY prefix.
7
+
8
+ // CHECK: __spirv_ocl_modffPU8CLglobal
9
+ void modf_global (float a , global float * ptr ) { __spirv_ocl_modf (a , ptr ); }
10
+
11
+ // CHECK: __spirv_ocl_modffPU7CLlocal
12
+ void modf_local (float a , local float * ptr ) { __spirv_ocl_modf (a , ptr ); }
13
+
14
+ // CHECK: __spirv_ocl_modffPU9CLprivate
15
+ void modf_private (float a ) {
16
+ float * ptr ;
17
+ __spirv_ocl_modf (a , ptr );
18
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 %s -fsycl-is-device -fdeclare-spirv-builtins -fsyntax-only -emit-llvm -o - -O0 | FileCheck %s
2
+ //
3
+ // Check that SPIR-V builtins are declared with SYCL address spaces rather
4
+ // than OpenCL address spaces when using them with SYCL. OpenCL address spaces
5
+ // are mangled with the CL prefix and SYCL address spaces are mangled with the
6
+ // SY prefix.
7
+ //
8
+ // The opencl_global, opencl_local, and opencl_private attributes get turned
9
+ // into sycl_global, sycl_local and sycl_private address spaces by clang.
10
+
11
+ #include " Inputs/sycl.hpp"
12
+
13
+ // CHECK: __spirv_ocl_modffPU8SYglobal
14
+ void modf_global (float a) {
15
+ __attribute__ ((opencl_global)) float *ptr = nullptr ;
16
+ sycl::kernel_single_task<class fake_kernel >([=]() { __spirv_ocl_modf (a, ptr); });
17
+ }
18
+
19
+ // CHECK: __spirv_ocl_modffPU7SYlocal
20
+ void modf_local (float a) {
21
+ __attribute__ ((opencl_local)) float *ptr = nullptr ;
22
+ sycl::kernel_single_task<class fake_kernel >([=]() { __spirv_ocl_modf (a, ptr); });
23
+ }
24
+
25
+ // CHECK: __spirv_ocl_modffPU9SYprivate
26
+ void modf_private (float a) {
27
+ __attribute__ ((opencl_private)) float *ptr = nullptr ;
28
+ sycl::kernel_single_task<class fake_kernel >([=]() { __spirv_ocl_modf (a, ptr); });
29
+ }
You can’t perform that action at this time.
0 commit comments