-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Captured enum variables are incorrect inside SYCL kernels for …
…CPU device Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com> Signed-off-by: Melanie Blower <melanie.blower@intel.com>
- Loading branch information
1 parent
7edf29c
commit ed0ea45
Showing
2 changed files
with
34 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: %clang_cc1 -triple spir64-unknown-linux-sycldevice -std=c++11 -fsycl-is-device -disable-llvm-optzns -disable-llvm-passes -S -emit-llvm -x c++ %s -o - | FileCheck %s | ||
|
||
template <typename name, typename Func> | ||
__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) { | ||
kernelFunc(); | ||
} | ||
|
||
enum enum_type: int { | ||
A = 0, | ||
B = 1, | ||
}; | ||
|
||
void test(enum_type val) | ||
{ | ||
kernel_single_task<class kernel_function>([=]() { | ||
//expected-warning@+1{{expression result unused}} | ||
val; | ||
}); | ||
} | ||
|
||
int main() { | ||
|
||
// CHECK: define spir_kernel void @_ZTSZ4test9enum_typeE15kernel_function(i32 %_arg_) | ||
|
||
// CHECK: getelementptr inbounds %class.anon, %class.anon* | ||
// CHECK: call spir_func void @"_ZZ4test9enum_typeENK3$_0clEv"(%class.anon* %0) | ||
|
||
|
||
test( enum_type::B ); | ||
return 0; | ||
} |