-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge from 'sycl' to 'sycl-web' (#3)
- Loading branch information
Showing
11 changed files
with
524 additions
and
92 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,36 @@ | ||
; RUN: sycl-post-link --ir-output-only -split=auto -S %s -o %t.ll | ||
; RUN: FileCheck %s -input-file=%t.ll | ||
|
||
; This test checks that the --ir-output-only option writes a LLVM IR | ||
; file instead of a table. In comparison with other tests, this one | ||
; checks that the option works OK with -split=auto. | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir64-unknown-linux-sycldevice" | ||
|
||
declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
define dso_local spir_kernel void @kernel1() #0 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @kernel2() #0 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!spirv.Source = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 1, i32 2} | ||
!2 = !{i32 0, i32 100000} | ||
|
||
; CHECK: define dso_local spir_kernel void @kernel1() | ||
; CHECK: define dso_local spir_kernel void @kernel2() |
45 changes: 45 additions & 0 deletions
45
llvm/test/tools/sycl-post-link/sycl-esimd/basic-sycl-esimd-split.ll
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,45 @@ | ||
; RUN: sycl-post-link -split-esimd -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t.table | ||
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-SYCL-IR | ||
; RUN: FileCheck %s -input-file=%t_esimd_0.ll --check-prefixes CHECK-ESIMD-IR | ||
|
||
; This is basic test of splitting SYCL and ESIMD kernels into separate | ||
; modules. | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir64-unknown-linux-sycldevice" | ||
|
||
declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
define dso_local spir_kernel void @ESIMD_kernel() #0 !sycl_explicit_simd !3{ | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @SYCL_kernel() #0 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!spirv.Source = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 1, i32 2} | ||
!2 = !{i32 0, i32 100000} | ||
!3 = !{} | ||
|
||
; CHECK: [Code|Properties] | ||
; CHECK: {{.*}}_0.ll|{{.*}}_0.prop | ||
; CHECK: {{.*}}_esimd_0.ll|{{.*}}_esimd_0.prop | ||
|
||
; CHECK-SYCL-IR-DAG: define dso_local spir_kernel void @SYCL_kernel() | ||
; CHECK-SYCL-IR-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
; CHECK-ESIMD-IR-DAG: define dso_local spir_kernel void @ESIMD_kernel() | ||
; CHECK-ESIMD-IR-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() |
55 changes: 55 additions & 0 deletions
55
llvm/test/tools/sycl-post-link/sycl-esimd/no-sycl-esimd-split.ll
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,55 @@ | ||
; RUN: sycl-post-link -split=source -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t.table | ||
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-IR-0 | ||
; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-IR-1 | ||
|
||
; This test checks that if no '-split-esimd' provided, ther is no | ||
; splitting of SYCL and ESIMD kernels into separate modules. | ||
; However, the rest of the splitting still happens according to | ||
; the '-split=' option. | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir64-unknown-linux-sycldevice" | ||
|
||
declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
define dso_local spir_kernel void @ESIMD_kernel() #0 !sycl_explicit_simd !3{ | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @SYCL_kernel1() #0 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @SYCL_kernel2() #1 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } | ||
attributes #1 = { "sycl-module-id"="b.cpp" } | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!spirv.Source = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 1, i32 2} | ||
!2 = !{i32 0, i32 100000} | ||
!3 = !{} | ||
|
||
; CHECK: [Code|Properties] | ||
; CHECK: {{.*}}_0.ll|{{.*}}_0.prop | ||
; CHECK: {{.*}}_1.ll|{{.*}}_1.prop | ||
|
||
; CHECK-IR-0-DAG: define dso_local spir_kernel void @SYCL_kernel1() | ||
; CHECK-IR-0-DAG: define dso_local spir_kernel void @ESIMD_kernel() | ||
; CHECK-IR-0-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
; CHECK-IR-1-DAG: define dso_local spir_kernel void @SYCL_kernel2() | ||
; CHECK-IR-1-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() |
70 changes: 70 additions & 0 deletions
70
llvm/test/tools/sycl-post-link/sycl-esimd/sycl-esimd-split-per-kernel.ll
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,70 @@ | ||
; RUN: sycl-post-link -split-esimd -split=kernel -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t.table | ||
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-SYCL-IR-0 | ||
; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-SYCL-IR-1 | ||
; RUN: FileCheck %s -input-file=%t_esimd_0.ll --check-prefixes CHECK-ESIMD-IR-0 | ||
; RUN: FileCheck %s -input-file=%t_esimd_1.ll --check-prefixes CHECK-ESIMD-IR-1 | ||
|
||
; This test checks that after we split SYCL and ESIMD kernels into | ||
; separate modules, we split those two modules further according to | ||
; -split option. In this case we have 2 SYCL and 2 ESIMD kernels, which | ||
; are split into a total of 4 separate modules. | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir64-unknown-linux-sycldevice" | ||
|
||
declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
define dso_local spir_kernel void @ESIMD_kernel1() #0 !sycl_explicit_simd !3{ | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @ESIMD_kernel2() #0 !sycl_explicit_simd !3{ | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @SYCL_kernel1() #1 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
define dso_local spir_kernel void @SYCL_kernel2() #1 { | ||
entry: | ||
%call = tail call spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
ret void | ||
} | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } | ||
attributes #1 = { "sycl-module-id"="a.cpp" } | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!spirv.Source = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 1, i32 2} | ||
!2 = !{i32 0, i32 100000} | ||
!3 = !{} | ||
|
||
; CHECK: [Code|Properties] | ||
; CHECK: {{.*}}_0.ll|{{.*}}_0.prop | ||
; CHECK: {{.*}}_1.ll|{{.*}}_1.prop | ||
; CHECK: {{.*}}_esimd_0.ll|{{.*}}_esimd_0.prop | ||
; CHECK: {{.*}}_esimd_1.ll|{{.*}}_esimd_1.prop | ||
|
||
; CHECK-SYCL-IR-0-DAG: define dso_local spir_kernel void @SYCL_kernel1() | ||
; CHECK-SYCL-IR-0-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
; CHECK-SYCL-IR-1-DAG: define dso_local spir_kernel void @SYCL_kernel2() | ||
; CHECK-SYCL-IR-1-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
; CHECK-ESIMD-IR-0-DAG: define dso_local spir_kernel void @ESIMD_kernel1() | ||
; CHECK-ESIMD-IR-0-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() | ||
|
||
; CHECK-ESIMD-IR-1-DAG: define dso_local spir_kernel void @ESIMD_kernel2() | ||
; CHECK-ESIMD-IR-1-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv() |
Oops, something went wrong.