-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Mark functions that the kernels call with SYCL device attribute.
Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com>
- Loading branch information
1 parent
9e3fcc9
commit 124a88a
Showing
3 changed files
with
62 additions
and
5 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
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 -emit-llvm -x c++ %s -o - | FileCheck %s | ||
|
||
template <typename T> | ||
T bar(T arg); | ||
|
||
void foo() { | ||
int a = 1 + 1 + bar(1); | ||
} | ||
|
||
template <typename T> | ||
T bar(T arg) { | ||
return arg; | ||
} | ||
|
||
template <typename name, typename Func> | ||
__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) { | ||
kernelFunc(); | ||
} | ||
|
||
int main() { | ||
kernel_single_task<class fake_kernel>([]() { foo(); }); | ||
return 0; | ||
} | ||
// CHECK: define spir_kernel void @fake_kernel() | ||
// CHECK: define internal spir_func void @"_ZZ4mainENK3$_0clEv"(%class.anon* %this) | ||
// CHECK: define spir_func void @_Z3foov() | ||
// CHECK: define linkonce_odr spir_func i32 @_Z3barIiET_S0_(i32 %arg) |