Skip to content

Commit

Permalink
Merge branch 'sycl' into iault/unsampled_image_arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacault committed Feb 26, 2024
2 parents 217545a + c90de3c commit 410f7f7
Show file tree
Hide file tree
Showing 31 changed files with 551 additions and 116 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ on:
- '["Linux", "gen12"]'
- '["amdgpu"]'
- '["Linux", "arc"]'
- '["cts-cpu"]'
image:
description: |
Use option ending with ":build" for AMDGPU, ":latest" for the rest.
Expand Down Expand Up @@ -286,10 +287,27 @@ jobs:
-DDPCPP_INSTALL_DIR="$$(dirname (which clang++))/.." \
$CMAKE_EXTRA_ARGS
ninja -C build-cts
- name: SYCL CTS List devices
if: inputs.tests_selector == 'cts'
run: |
./build-cts/bin/test_all --list-devices
- name: Run SYCL CTS tests
if: inputs.tests_selector == 'cts'
env:
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
# FIXME: For some reason the "sub_group api" test-case is failing with
# SIGSEGV while running test_all, so running each binary separately.
# BTW test_all requires a lot of resources to build it, so probably it'll
# be better to build each binary also separately.
# run: |
# ./build-cts/bin/test_all $CTS_TEST_ARGS
run: |
./build-cts/bin/test_all --list-devices
./build-cts/bin/test_all $CTS_TEST_ARGS
for i in `ls -1 ./build-cts/bin`; do
if [ "$i" != "test_all" ]; then
echo "::group::Running $i"
build-cts/bin/$i
echo "::endgroup::"
fi
done
8 changes: 8 additions & 0 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ jobs:
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
target_devices: ext_oneapi_cuda:gpu

- name: SYCL-CTS
runner: '["cts-cpu"]'
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: opencl:cpu
tests_selector: cts
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
image: ${{ matrix.image }}
image_options: ${{ matrix.image_options }}
target_devices: ${{ matrix.target_devices }}
tests_selector: ${{ matrix.tests_selector }}
reset_gpu: ${{ matrix.reset_gpu }}
ref: ${{ github.sha }}
merge_ref: ''
Expand Down
2 changes: 1 addition & 1 deletion devops/cts_exclude_filter
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vector_operators
vector_swizzle_assignment
vector_swizzles
kernel_bundle
specialization_constants
spec_constants
device_selector
math_builtin_api
stream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; RUN: sycl-post-link --spec-const=native -S < %s -o %t.files.table
; RUN: FileCheck %s -input-file=%t.files_0.ll --check-prefix CHECK-IR
; RUN: FileCheck %s -input-file=%t.files_0.prop --check-prefix CHECK-PROP
; RUN: sycl-post-link -debug-only=SpecConst --spec-const=native -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK-LOG
;
; This test is intended to check that SpecConstantsPass is able to handle the
; situation where specialization constants with complex types such as arrays
Expand Down Expand Up @@ -108,9 +109,43 @@ attributes #2 = { convergent "frame-pointer"="all" "no-trapping-math"="true" "st
!9 = !{!"_ZTSN2cl4sycl14kernel_handlerE", !5, i64 0}

; CHECK-PROP: [SYCL/specialization constants]
; CHECK-PROP-NEXT: 9f47062a80eecfa7____ZL8coeff_id=2|gNAAAAAAAAAAAAAAAAAAAQAAAAQAAAAAEAAAAQAAAAgAAAAAIAAAAQAAAAwAAAAAMAAAAQAAAAABAAAAQAAAAQAAAAQBAAAAUAAAAQAAAAgBAAAAYAAAAQAAAAwBAAAAcAAAAQAAAAACAAAAgAAAAQAAAAA
; CHECK-PROP-NEXT: 405761736d5a1797____ZL9coeff_id2=2|gNAAAAAAAAQCAAAAAAAAAQAAAAgCAAAAEAAAAQAAAAwCAAAAIAAAAQAAAAADAAAAMAAAAQAAAAQDAAAAQAAAAQAAAAgDAAAAUAAAAQAAAAwDAAAAYAAAAQAAAAAEAAAAcAAAAQAAAAQEAAAAgAAAAQAAAAA
; CHECK-PROP-NEXT: 6da74a122db9f35d____ZL9coeff_id3=2|AGAAAAAAAAgEAAAAAAAAAQAAAAwEAAAAEAAAAQAAAAAFAAAAIAAAAQAAAAQFAAAAQAAAAgAAAAA
; CHECK-PROP-NEXT: 9f47062a80eecfa7____ZL8coeff_id=2
; CHECK-PROP-NEXT: 405761736d5a1797____ZL9coeff_id2=2
; CHECK-PROP-NEXT: 6da74a122db9f35d____ZL9coeff_id3=2
; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={1, 4, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={2, 8, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={3, 12, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={4, 16, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={5, 20, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={6, 24, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={7, 28, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={8, 32, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={9, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={10, 4, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={11, 8, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={12, 12, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={13, 16, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={14, 20, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={15, 24, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={16, 28, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={17, 32, 4}
; CHECK-LOG:[[UNIQUE_PREFIX3:[0-9a-zA-Z]+]]={18, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={19, 4, 4}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={20, 8, 4}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={21, 16, 8}


; CHECK-PROP: [SYCL/specialization constants default values]
; CHECK-PROP-NEXT: all=2|AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg/AAAAA0MzMIQzMzoAZmZGDEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
; CHECK-PROP-NEXT: all=2
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG: {0, 36, 0}
; CHECK-LOG: {36, 12, 0}
; CHECK-LOG: {48, 4, 0.000000e+00}
; CHECK-LOG: {52, 4, 1.000000e+00}
; CHECK-LOG: {56, 4, 2.000000e+00}
; CHECK-LOG: {60, 4, 4.100000e+00}
; CHECK-LOG: {64, 4, 5.100000e+00}
; CHECK-LOG: {68, 4, 6.200000e+00}
; CHECK-LOG: {72, 24, 0}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; RUN: sycl-post-link --ir-output-only --spec-const=native %s -S -o - | FileCheck %s
; RUN: sycl-post-link -debug-only=SpecConst --spec-const=native %s -S 2>&1 | FileCheck %s --check-prefix=CHECK-LOG
;
; This test is intended to check that SpecConstantsPass is able to handle the
; situation where specialization constants have zeroinitializer in LLVM IR
Expand Down Expand Up @@ -41,6 +42,18 @@ entry:
; CHECK: call i8 @_Z20__spirv_SpecConstantia(i32 [[#SCID4:]], i8 0)
; CHECK: call i64 @_Z20__spirv_SpecConstantix(i32 [[#SCID5:]], i64 0)

; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={1, 0, 8}
; CHECK-LOG:[[UNIQUE_PREFIX3:[0-9a-zA-Z]+]]={2, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={3, 4, 1}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={4, 5, 1}
; CHECK-LOG:[[UNIQUE_PREFIX3]]={5, 8, 8}
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG: {0, 4, 0}
; CHECK-LOG: {4, 8, 0.000000e+00}
; CHECK-LOG: {12, 16, 0}

ret void
}

Expand Down
116 changes: 116 additions & 0 deletions llvm/test/tools/sycl-post-link/spec-constants/SYCL-2020.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
; RUN: sycl-post-link -spec-const=native < %s -S -o %t.table
; RUN: FileCheck %s -check-prefixes=CHECK,CHECK-RT < %t_0.ll
; RUN: FileCheck %s --check-prefixes=CHECK-PROPS < %t_0.prop
; RUN: sycl-post-link -debug-only=SpecConst -spec-const=emulation < %s -S 2>&1 | FileCheck %s --check-prefixes=CHECK-LOG,CHECK-LOG-EMULATION
; RUN: sycl-post-link -debug-only=SpecConst -spec-const=native < %s -S 2>&1 | FileCheck %s --check-prefixes=CHECK-LOG,CHECK-LOG-NATIVE

; This test checks that the post link tool is able to correctly transform
; SYCL 2020 specialization constant intrinsics for different types in a device
Expand Down Expand Up @@ -277,3 +279,117 @@ attributes #3 = { nounwind }
; CHECK-PROPS: _ZTS14name_generatorIL_Z10id_marray4EE=2|
; CHECK-PROPS-DEF: [SYCL/specialization constants default values]
; CHECK-PROPS-DEF: all=2|
; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 2}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX]]={4294967295, 2, 2}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={1, 0, 4}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX3:[0-9a-zA-Z]+]]={2, 0, 24}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX4:[0-9a-zA-Z]+]]={3, 0, 24}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX5:[0-9a-zA-Z]+]]={4, 0, 16}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX6:[0-9a-zA-Z]+]]={5, 0, 8}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX7:[0-9a-zA-Z]+]]={6, 0, 8}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX8:[0-9a-zA-Z]+]]={7, 0, 12}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX9:[0-9a-zA-Z]+]]={8, 0, 24}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX10:[0-9a-zA-Z]+]]={9, 0, 48}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={1, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX1:[0-9a-zA-Z]+]]={2, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX1]]={3, 8, 8}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX1]]={4, 16, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX1]]={5, 20, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={6, 0, 1}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={7, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={8, 8, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={9, 16, 8}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX3:[0-9a-zA-Z]+]]={10, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX3]]={11, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX3]]={12, 8, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX3]]={13, 12, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX4:[0-9a-zA-Z]+]]={14, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX4]]={15, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX5:[0-9a-zA-Z]+]]={16, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX5]]={17, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX6:[0-9a-zA-Z]+]]={18, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX6]]={19, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX6]]={20, 8, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX7:[0-9a-zA-Z]+]]={21, 0, 8}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX7]]={22, 8, 8}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX7]]={23, 16, 8}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8:[0-9a-zA-Z]+]]={24, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={25, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={26, 8, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={27, 12, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={28, 16, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={29, 20, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={30, 24, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={31, 28, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={32, 32, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={33, 36, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={34, 40, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX8]]={35, 44, 4}
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG:{0, 2, 16384}
; CHECK-LOG-EMULATION:{2, 2, 0}
; CHECK-LOG-EMULATION:{4, 4, 42}
; CHECK-LOG-EMULATION:{8, 4, 1}
; CHECK-LOG-EMULATION:{16, 8, 2.000000e+00}
; CHECK-LOG-EMULATION:{24, 4, 13}
; CHECK-LOG-EMULATION:{28, 4, 8.200000e+00}
; CHECK-LOG-EMULATION:{32, 1, 1}
; CHECK-LOG-EMULATION:{36, 4, 52}
; CHECK-LOG-EMULATION:{40, 4, 4.720000e+01}
; CHECK-LOG-EMULATION:{48, 8, 2.000000e+00}
; CHECK-LOG-EMULATION:{56, 16, 0}
; CHECK-LOG-EMULATION:{72, 4, 1}
; CHECK-LOG-EMULATION:{76, 4, 2}
; CHECK-LOG-EMULATION:{80, 4, 1}
; CHECK-LOG-EMULATION:{84, 4, 2}
; CHECK-LOG-EMULATION:{88, 4, 1}
; CHECK-LOG-EMULATION:{92, 4, 2}
; CHECK-LOG-EMULATION:{96, 4, 3}
; CHECK-LOG-EMULATION:{100, 8, 1}
; CHECK-LOG-EMULATION:{108, 8, 2}
; CHECK-LOG-EMULATION:{116, 8, 3}
; CHECK-LOG-EMULATION:{124, 4, 1}
; CHECK-LOG-EMULATION:{128, 4, 2}
; CHECK-LOG-EMULATION:{132, 4, 3}
; CHECK-LOG-EMULATION:{136, 4, 1}
; CHECK-LOG-EMULATION:{140, 4, 2}
; CHECK-LOG-EMULATION:{144, 4, 3}
; CHECK-LOG-EMULATION:{148, 4, 1}
; CHECK-LOG-EMULATION:{152, 4, 2}
; CHECK-LOG-EMULATION:{156, 4, 3}
; CHECK-LOG-EMULATION:{160, 4, 1}
; CHECK-LOG-EMULATION:{164, 4, 2}
; CHECK-LOG-EMULATION:{168, 4, 3}
; CHECK-LOG-NATIVE:{2, 4, 42}
; CHECK-LOG-NATIVE:{6, 4, 1}
; CHECK-LOG-NATIVE:{14, 8, 2.000000e+00}
; CHECK-LOG-NATIVE:{22, 4, 13}
; CHECK-LOG-NATIVE:{26, 4, 8.200000e+00}
; CHECK-LOG-NATIVE:{30, 1, 1}
; CHECK-LOG-NATIVE:{34, 4, 52}
; CHECK-LOG-NATIVE:{38, 4, 4.720000e+01}
; CHECK-LOG-NATIVE:{46, 8, 2.000000e+00}
; CHECK-LOG-NATIVE:{54, 16, 0}
; CHECK-LOG-NATIVE:{70, 4, 1}
; CHECK-LOG-NATIVE:{74, 4, 2}
; CHECK-LOG-NATIVE:{78, 4, 1}
; CHECK-LOG-NATIVE:{82, 4, 2}
; CHECK-LOG-NATIVE:{86, 4, 1}
; CHECK-LOG-NATIVE:{90, 4, 2}
; CHECK-LOG-NATIVE:{94, 4, 3}
; CHECK-LOG-NATIVE:{98, 8, 1}
; CHECK-LOG-NATIVE:{106, 8, 2}
; CHECK-LOG-NATIVE:{114, 8, 3}
; CHECK-LOG-NATIVE:{122, 4, 1}
; CHECK-LOG-NATIVE:{126, 4, 2}
; CHECK-LOG-NATIVE:{130, 4, 3}
; CHECK-LOG-NATIVE:{134, 4, 1}
; CHECK-LOG-NATIVE:{138, 4, 2}
; CHECK-LOG-NATIVE:{142, 4, 3}
; CHECK-LOG-NATIVE:{146, 4, 1}
; CHECK-LOG-NATIVE:{150, 4, 2}
; CHECK-LOG-NATIVE:{154, 4, 3}
; CHECK-LOG-NATIVE:{158, 4, 1}
; CHECK-LOG-NATIVE:{162, 4, 2}
; CHECK-LOG-NATIVE:{166, 4, 3}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; RUN: sycl-post-link --spec-const=native -S < %s -o %t.files.table
; RUN: FileCheck %s -input-file=%t.files_0.ll --check-prefix CHECK-IR
; RUN: FileCheck %s -input-file=%t.files_0.prop --check-prefix CHECK-PROP
; RUN: sycl-post-link -debug-only=SpecConst --spec-const=native -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK-LOG
;
; This test is intended to check that SpecConstantsPass is able to handle the
; situation where specialization constants with complex types such as structs
Expand Down Expand Up @@ -84,6 +85,25 @@ attributes #4 = { convergent }

; CHECK-PROP: [SYCL/specialization constants]
; CHECK-PROP-NEXT: ef880fa09cf7a9d7____ZL8coeff_id=2|
; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={1, 4, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={2, 8, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={3, 16, 8}
; CHECK-LOG:[[UNIQUE_PREFIX]]={4294967295, 24, 8}
; CHECK-LOG:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={5, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={6, 4, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={7, 8, 4}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={8, 16, 8}
; CHECK-LOG:[[UNIQUE_PREFIX2]]={4294967295, 31, 1}

; CHECK-PROP: [SYCL/specialization constants default values]
; CHECK-PROP-NEXT: all=2|
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG: {0, 12, 0}
; CHECK-LOG: {16, 8, 0}
; CHECK-LOG: {24, 8, 0}
; CHECK-LOG: {32, 12, 0}
; CHECK-LOG: {48, 8, 0}
; CHECK-LOG: {56, 7, 0}
; CHECK-LOG: {63, 1, 0}
20 changes: 20 additions & 0 deletions llvm/test/tools/sycl-post-link/spec-constants/bool.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
; RUN: FileCheck %s --input-file=%t.ll --implicit-check-not "call i8 bitcast" --check-prefixes=CHECK,CHECK-RT
; RUN: sycl-post-link -spec-const=emulation -S < %s --ir-output-only -o %t.ll
; RUN: FileCheck %s --input-file=%t.ll --check-prefixes=CHECK,CHECK-DEF
; RUN: sycl-post-link -debug-only=SpecConst -spec-const=native -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-LOG,CHECK-LOG-NATIVE
; RUN: sycl-post-link -debug-only=SpecConst -spec-const=emulation -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-LOG,CHECK-LOG-EMULATION

; CHECK-LABEL: void @kernel_A
; CHECK-RT: %[[CALL:.*]] = call i8 @_Z20__spirv_SpecConstantia(i32 [[#]], i8 1)
Expand All @@ -18,6 +20,24 @@
; CHECK-DEF: %[[BC:bc.*]] = bitcast ptr addrspace(4) %[[GEP]] to ptr addrspace(4)
; CHECK-DEF: %[[LOAD:load.*]] = load %struct.user_type, ptr addrspace(4) %[[BC]], align 4

; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 1}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={1, 0, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={2, 4, 4}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={3, 8, 1}
; CHECK-LOG-NATIVE:[[UNIQUE_PREFIX2]]={4294967295, 9, 3}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX]]={4294967295, 1, 3}
; CHECK-LOG-EMULATION:[[UNIQUE_PREFIX2:[0-9a-zA-Z]+]]={1, 0, 12}
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG:{0, 1, 1}
; CHECK-LOG-NATIVE:{1, 4, 2.000000e+01}
; CHECK-LOG-NATIVE:{5, 4, 20}
; CHECK-LOG-NATIVE:{9, 1, 20}
; CHECK-LOG-EMULATION:{1, 3, 0}
; CHECK-LOG-EMULATION:{4, 4, 2.000000e+01}
; CHECK-LOG-EMULATION:{8, 4, 20}
; CHECK-LOG-EMULATION:{12, 1, 20}

target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
target triple = "spir64-unknown-unknown"

Expand Down
7 changes: 7 additions & 0 deletions llvm/test/tools/sycl-post-link/spec-constants/composite-O2.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; RUN: sycl-post-link -spec-const=native --ir-output-only < %s -S -o - \
; RUN: | FileCheck %s --implicit-check-not "call {{.*}} __sycl_getComposite2020SpecConstantValue"
; RUN: sycl-post-link -spec-const=native -debug-only=SpecConst < %s -S 2>&1 | FileCheck %s --check-prefix=CHECK-LOG
;
; This test is intended to check that sycl-post-link tool is capable of handling
; composite specialization constants by lowering them into a set of SPIR-V
Expand All @@ -15,6 +16,12 @@
;
; CHECK: ![[#MD0]] = !{!"_ZTS13MyComposConst", i32 [[#ID]], i32 0, i32 4,
; CHECK-SAME: i32 [[#ID + 1]], i32 4, i32 4}
; CHECK-LOG: sycl.specialization-constants
; CHECK-LOG:[[UNIQUE_PREFIX:[0-9a-zA-Z]+]]={0, 0, 4}
; CHECK-LOG:[[UNIQUE_PREFIX]]={1, 4, 4}
; CHECK-LOG: sycl.specialization-constants-default-values
; CHECK-LOG:{0, 4, 42}
; CHECK-LOG:{4, 4, 2.000000e+00}

target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
target triple = "spir64-unknown-unknown"
Expand Down
Loading

0 comments on commit 410f7f7

Please sign in to comment.