-
Notifications
You must be signed in to change notification settings - Fork 248
Turn on SPIR-V builtin generation for OpenCL CPP sources #2466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8a9d600
82285ac
9900e9c
5c74ba9
3962949
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ;; This test checks if builtins in LLVM IR generated from CPP_for_OpenCL sources | ||
| ;; are correctly translated to SPIR-V builtin variables. | ||
|
|
||
| ; RUN: llvm-as %s -o %t.bc | ||
| ; RUN: llvm-spirv %t.bc -o %t.spv | ||
| ; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt | ||
| ; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV | ||
| ; RUN: spirv-val %t.spv | ||
|
|
||
| target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
| target triple = "spir-unknown-unknown" | ||
|
|
||
| %opencl.event_t = type opaque | ||
|
|
||
| ; CHECK-SPIRV: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInWorkgroupId" | ||
| ; Function Attrs: nounwind | ||
| define spir_kernel void @test_fn(i32 %a) { | ||
| entry: | ||
| %call15 = call spir_func i32 @_Z12get_group_idj(i32 0) | ||
| ret void | ||
| } | ||
|
|
||
| declare spir_func i32 @_Z12get_group_idj(i32) | ||
|
|
||
| !spirv.Source = !{!0} | ||
|
|
||
| !0 = !{i32 6, i32 100000} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ;; This test checks if builtins in LLVM IR generated from OpenCL_CPP sources | ||
| ;; are correctly translated to SPIR-V builtin variables. | ||
|
|
||
| ; RUN: llvm-as %s -o %t.bc | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a comment describing purpose of this test. I think that looking at the filename or file history is not as clear or convenient.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Thanks |
||
| ; RUN: llvm-spirv %t.bc -o %t.spv | ||
| ; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt | ||
| ; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV | ||
| ; RUN: spirv-val %t.spv | ||
|
|
||
| target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
| target triple = "spir-unknown-unknown" | ||
|
|
||
| %opencl.event_t = type opaque | ||
|
|
||
| ; CHECK-SPIRV: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInWorkgroupId" | ||
| ; Function Attrs: nounwind | ||
| define spir_kernel void @test_fn(i32 %a) { | ||
| entry: | ||
| %call15 = call spir_func i32 @_Z12get_group_idj(i32 0) | ||
| ret void | ||
| } | ||
|
|
||
| declare spir_func i32 @_Z12get_group_idj(i32) | ||
|
|
||
| !spirv.Source = !{!0} | ||
|
|
||
| !0 = !{i32 4, i32 100000} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case was actually derived from SYCL source.