Skip to content

Commit f856948

Browse files
committed
[SYCL] Run the LIT tests using the selected backend
sycl/test/CMakeLists.txt requests which backend to test by passing to the LIT configuration either PARAMS "SYCL_BE=PI_OPENCL" or PARAMS "SYCL_BE=PI_CUDA" This change passes the backend choice to the test throught its environment. Signed-off-by: Andrea Bocci <[email protected]>
1 parent dc729a7 commit f856948

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sycl/test/lit.cfg.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
print("Adding path to opencl-aot tool to PATH")
8989
os.environ['PATH'] = os.path.pathsep.join((os.getenv('PATH'), config.sycl_tools_dir))
9090

91-
backend=lit_config.params.get('SYCL_BE', "PI_OPENCL")
91+
backend = lit_config.params.get('SYCL_BE', "PI_OPENCL")
92+
config.environment['SYCL_BE'] = backend
9293

9394
get_device_count_by_type_path = os.path.join(config.llvm_tools_dir, "get_device_count_by_type")
9495

@@ -157,8 +158,6 @@ def getDeviceCount(device_type):
157158
if platform.system() == "Linux":
158159
gpu_run_on_linux_substitute = "env SYCL_DEVICE_TYPE=GPU "
159160
gpu_check_on_linux_substitute = "| FileCheck %s"
160-
if cuda:
161-
gpu_run_on_linux_substitute += " SYCL_BE=PI_CUDA "
162161

163162
config.substitutions.append( ('%GPU_RUN_PLACEHOLDER', gpu_run_substitute) )
164163
config.substitutions.append( ('%GPU_RUN_ON_LINUX_PLACEHOLDER', gpu_run_on_linux_substitute) )

0 commit comments

Comments
 (0)