-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Emit OpenCL/SPIR metadata and calling convention for SYCL
device code. Signed-off-by: Vladimir Lazarev <[email protected]>
- Loading branch information
1 parent
1e60aa6
commit f1a7138
Showing
7 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// RUN: %clang -cc1 -triple spir64-unknown-linux-sycldevice -std=c++11 -fsycl-is-device -S -I /sycl_include_path -I /opencl_include_path -I /usr/include/c++/4.8.5 -I /usr/include/c++/4.8.5/x86_64-redhat-linux -I /usr/include/c++/4.8.5/backward -I /include -I /usr/include -fcxx-exceptions -fexceptions -emit-llvm -x c++ %s -o - | FileCheck %s | ||
|
||
// CHECK: define {{.*}}spir_kernel void @kernel_function() {{[^{]+}} !kernel_arg_addr_space ![[MD:[0-9]+]] !kernel_arg_access_qual ![[MD]] !kernel_arg_type ![[MD]] !kernel_arg_base_type ![[MD]] !kernel_arg_type_qual ![[MD]] { | ||
// CHECK: ![[MD]] = !{} | ||
// XFAIL: * | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
|
||
using namespace cl::sycl; | ||
|
||
int main() { | ||
|
||
queue myQueue; | ||
|
||
myQueue.submit([&](handler &cgh) { | ||
|
||
cgh.single_task<class kernel_function>([=]() { | ||
}); | ||
}); | ||
|
||
myQueue.wait(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// RUN: %clang -cc1 -triple spir64-unknown-linux-sycldevice -std=c++11 -fsycl-is-device -S -I /sycl_include_path -I /opencl_include_path -I /usr/include/c++/4.8.5 -I /usr/include/c++/4.8.5/x86_64-redhat-linux -I /usr/include/c++/4.8.5/backward -I /include -I /usr/include -fcxx-exceptions -fexceptions -emit-llvm -x c++ %s -o - | FileCheck %s | ||
|
||
// XFAIL: * | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
|
||
using namespace cl::sycl; | ||
|
||
int main() { | ||
|
||
queue myQueue; | ||
|
||
myQueue.submit([&](handler &cgh) { | ||
|
||
// CHECK: define spir_kernel void @kernel_function() | ||
|
||
// CHECK: call spir_func void @"_ZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEv"(%class.anon* %0) | ||
|
||
// CHECK: define internal spir_func void @"_ZZZ4mainENK3$_0clERN2cl4sycl7handlerEENKUlvE_clEv"(%class.anon* %this) | ||
|
||
cgh.single_task<class kernel_function>([=]() { | ||
}); | ||
}); | ||
|
||
myQueue.wait(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: %clang -cc1 -triple spir64-unknown-linux-sycldevice -std=c++11 -fsycl-is-device -S -I /sycl_include_path -I /opencl_include_path -I /usr/include/c++/4.8.5 -I /usr/include/c++/4.8.5/x86_64-redhat-linux -I /usr/include/c++/4.8.5/backward -I /include -I /usr/include -fcxx-exceptions -fexceptions -emit-llvm -x c++ %s -o - | FileCheck %s | ||
|
||
// XFAIL: * | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
using namespace cl::sycl; | ||
|
||
int main() { | ||
|
||
queue myQueue; | ||
|
||
myQueue.submit([&](handler &cgh) { | ||
|
||
cgh.single_task<class kernel_function>([=]() { | ||
}); | ||
}); | ||
|
||
myQueue.wait(); | ||
} | ||
|
||
|
||
// CHECK: !opencl.ocl.version = !{[[VER:![0-9]+]]} | ||
// CHECK: !opencl.spir.version = !{[[VER]]} | ||
// CHECK: [[VER]] = !{i32 1, i32 2} |