Skip to content

Commit 22a74ac

Browse files
jmmartinezsearlmc1
authored andcommitted
[Comgr][Test] Disable Spirv test if COMGR_DISABLE_SPIRV
Change-Id: I8f25c7aaf711b57e2507a19b79970fc449bad0a6
1 parent e095005 commit 22a74ac

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

amd/comgr/test-lit/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
function(cannonicalize_cmake_boolean var)
2+
if(${var})
3+
set(${var} 1 PARENT_SCOPE)
4+
else()
5+
set(${var} 0 PARENT_SCOPE)
6+
endif()
7+
endfunction()
8+
9+
cannonicalize_cmake_boolean(COMGR_DISABLE_SPIRV)
10+
111
configure_file(lit.site.cfg.py.in lit.site.cfg.py @ONLY)
212

313
# Comgr source build

amd/comgr/test-lit/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111

1212
config.test_source_root = os.path.dirname(__file__)
1313
config.test_exec_root = config.my_obj_root
14+
15+
if not config.comgr_disable_spirv:
16+
config.available_features.add("comgr-has-spirv")

amd/comgr/test-lit/lit.site.cfg.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import os
33
config.my_src_root = r'@CMAKE_CURRENT_SOURCE_DIR@'
44
config.my_obj_root = r'@CMAKE_CURRENT_BINARY_DIR@'
55

6+
config.comgr_disable_spirv = @COMGR_DISABLE_SPIRV@
7+
68
# Needed for clang, llvm-dis, etc.
79
config.environment['PATH'] = os.pathsep.join(["@LLVM_TOOLS_BINARY_DIR@",
810
config.environment['PATH']])

amd/comgr/test-lit/spirv-translator.cl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: comgr-has-spirv
12
// COM: Enable this test once changes from amdspirv docker land
23

34
// COM: Generate a spirv-targeted LLVM IR file from an OpenCL kernel

amd/comgr/test-lit/spirv-translator.hip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// XFAIL: *
2+
// REQUIRES: comgr-has-spirv
23
// COM: Generate a SPIRV file from a HIP kernel
34
// RUN: clang -x hip --offload-arch=amdgcnspirv -nogpulib -nogpuinc \
45
// RUN: --no-gpu-bundle-output --offload-device-only -O3 %s -o %t.spv

0 commit comments

Comments
 (0)