Skip to content

Commit d0b4172

Browse files
authored
[SYCL][NFC] Remove deprecated variables from LIT (#2794)
Remove use of deprecated environment variables (SYCL_BE, SYCL_DEVICE_TYPE) from LIT framework. Use SYCL_DEVICE_FILTER instead: - rename CMake parameter SYCL_BE to SYCL_PLUGIN to avoid mix-up with deprecated environment variable; - update [CPU|GPU|ACC]_RUN_PLACEHOLDER to use SYCL_DEVICE_FILTER; - change values format used to define a backend and a device type to match SYCL_DEVICE_FILTER requirements; - add BE_RUN_PLACEHOLDER to set backend only for tests which require that; - add RUN_ON_HOST substitution to clearly state target device in RUN command.
1 parent 9cde152 commit d0b4172

File tree

135 files changed

+219
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+219
-214
lines changed

sycl/test/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ list(APPEND SYCL_DEPLOY_TEST_DEPS
4545
add_lit_testsuite(check-sycl-deploy "Running the SYCL regression tests"
4646
${CMAKE_CURRENT_BINARY_DIR}
4747
ARGS ${DEPLOY_RT_TEST_ARGS}
48-
PARAMS "SYCL_BE=PI_OPENCL"
48+
PARAMS "SYCL_PLUGIN=opencl"
4949
DEPENDS ${SYCL_DEPLOY_TEST_DEPS}
5050
EXCLUDE_FROM_CHECK_ALL
5151
)
@@ -58,15 +58,15 @@ add_lit_testsuites(SYCL ${CMAKE_CURRENT_SOURCE_DIR}
5858

5959
add_lit_testsuites(SYCL-DEPLOY ${CMAKE_CURRENT_SOURCE_DIR}
6060
ARGS ${DEPLOY_RT_TEST_ARGS}
61-
PARAMS "SYCL_BE=PI_OPENCL"
61+
PARAMS "SYCL_PLUGIN=opencl"
6262
DEPENDS ${SYCL_DEPLOY_TEST_DEPS}
6363
EXCLUDE_FROM_CHECK_ALL
6464
)
6565

6666
add_lit_testsuite(check-sycl-opencl "Running the SYCL regression tests for OpenCL"
6767
${CMAKE_CURRENT_BINARY_DIR}
6868
ARGS ${RT_TEST_ARGS}
69-
PARAMS "SYCL_BE=PI_OPENCL"
69+
PARAMS "SYCL_PLUGIN=opencl"
7070
DEPENDS ${SYCL_TEST_DEPS}
7171
EXCLUDE_FROM_CHECK_ALL
7272
)
@@ -75,7 +75,7 @@ set_target_properties(check-sycl-opencl PROPERTIES FOLDER "SYCL tests")
7575
add_lit_testsuite(check-sycl-level-zero "Running the SYCL regression tests for Level Zero"
7676
${CMAKE_CURRENT_BINARY_DIR}
7777
ARGS ${RT_TEST_ARGS}
78-
PARAMS "SYCL_BE=PI_LEVEL_ZERO"
78+
PARAMS "SYCL_PLUGIN=level_zero"
7979
DEPENDS ${SYCL_TEST_DEPS}
8080
EXCLUDE_FROM_CHECK_ALL
8181
)
@@ -89,7 +89,7 @@ if(SYCL_BUILD_PI_CUDA)
8989
add_lit_testsuite(check-sycl-cuda "Running the SYCL regression tests for CUDA"
9090
${CMAKE_CURRENT_BINARY_DIR}
9191
ARGS ${RT_TEST_ARGS}
92-
PARAMS "SYCL_BE=PI_CUDA"
92+
PARAMS "SYCL_PLUGIN=cuda"
9393
DEPENDS ${SYCL_TEST_DEPS}
9494
EXCLUDE_FROM_CHECK_ALL
9595
)
@@ -98,7 +98,7 @@ if(SYCL_BUILD_PI_CUDA)
9898
add_dependencies(check-sycl check-sycl-cuda)
9999

100100
add_lit_testsuites(SYCL-CUDA ${CMAKE_CURRENT_SOURCE_DIR}
101-
PARAMS "SYCL_BE=PI_CUDA"
101+
PARAMS "SYCL_PLUGIN=cuda"
102102
DEPENDS ${SYCL_TEST_DEPS}
103103
EXCLUDE_FROM_CHECK_ALL
104104
)

sycl/test/Unit/lit.cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ def find_shlibpath_var():
7373
lit_config.warning("unable to inject shared library path on '{}'"
7474
.format(platform.system()))
7575

76-
config.environment['SYCL_BE'] = lit_config.params.get('SYCL_BE', "PI_OPENCL")
77-
lit_config.note("Backend (SYCL_BE): {}".format(config.environment['SYCL_BE']))
76+
config.environment['SYCL_DEVICE_FILTER'] = lit_config.params.get('SYCL_PLUGIN', "opencl")
77+
lit_config.note("Backend: {}".format(config.environment['SYCL_DEVICE_FILTER']))

sycl/test/atomic_ref/accessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/add.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/compare_exchange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/exchange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/load.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/max.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/min.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/atomic_ref/sub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/basic_tests/accessor/accessor_property_list_rt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55

sycl/test/basic_tests/built-ins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
// CUDA does not support printf.
55
// UNSUPPORTED: cuda

sycl/test/basic_tests/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx %s -o %t.out -lsycl -I %sycl_include
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
//==--------------- context.cpp - SYCL context test ------------------------==//
55
//

sycl/test/basic_tests/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx %s -o %t.out -I %sycl_include -lsycl
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
//==--------------- device.cpp - SYCL device test --------------------------==//
55
//

sycl/test/basic_tests/device_selector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_BE=%sycl_be %t.out
2+
// RUN: %BE_RUN_PLACEHOLDER %t.out
33
//
44
// Checks that no device is selected when no device of desired type is
55
// available.

sycl/test/basic_tests/esimd/vadd.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
// TODO ESIMD enable host device under -fsycl
22
// RUN: %clangxx -I %sycl_include %s -o %t.out -lsycl
3-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
3+
// RUN: %RUN_ON_HOST %t.out
44

55
#include <CL/sycl.hpp>
66
#include <CL/sycl/INTEL/esimd.hpp>
77
#include <iostream>
8+
#include <string>
89

910
using namespace cl::sycl;
1011

1112
class ESIMDSelector : public device_selector {
12-
// Require GPU device unless HOST is requested in SYCL_DEVICE_TYPE env
13+
// Require GPU device unless HOST is requested in SYCL_DEVICE_FILTER env
1314
virtual int operator()(const device &device) const {
14-
if (const char *dev_type = getenv("SYCL_DEVICE_TYPE")) {
15-
if (!strcmp(dev_type, "GPU"))
15+
if (const char *dev_filter = getenv("SYCL_DEVICE_FILTER")) {
16+
std::string filter_string(dev_filter);
17+
if (filter_string.find("gpu") != std::string::npos)
1618
return device.is_gpu() ? 1000 : -1;
17-
if (!strcmp(dev_type, "HOST"))
19+
if (filter_string.find("host") != std::string::npos)
1820
return device.is_host() ? 1000 : -1;
19-
std::cerr << "Supported 'SYCL_DEVICE_TYPE' env var values are 'GPU' and "
20-
"'HOST', '"
21-
<< dev_type << "' is not.\n";
21+
std::cerr
22+
<< "Supported 'SYCL_DEVICE_FILTER' env var values are 'gpu' and "
23+
"'host', '"
24+
<< filter_string << "' does not contain such substrings.\n";
2225
return -1;
2326
}
24-
// If "SYCL_DEVICE_TYPE" not defined, only allow gpu device
27+
// If "SYCL_DEVICE_FILTER" not defined, only allow gpu device
2528
return device.is_gpu() ? 1000 : -1;
2629
}
2730
};

sycl/test/basic_tests/event_async_exception.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
//==---- event_async_exception.cpp - Test for event async exceptions -------==//
55
//

sycl/test/basic_tests/host_image_accessor_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
//==---- host_image_accessor_read.cpp - SYCL host image accessor check ----==//
55
//

sycl/test/basic_tests/linear-host-dev.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s
2+
// RUN: %RUN_ON_HOST %t.out | FileCheck %s
33

44
#include <CL/sycl.hpp>
55
#include <algorithm>

sycl/test/basic_tests/parallel_for_range_host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55

sycl/test/basic_tests/property_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx %s -o %t.out -lsycl -I%sycl_include
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33
//
44
// CHECK: PASSED
55
//==--------------- property_list.cpp - SYCL property list test ------------==//

sycl/test/basic_tests/reduction_ctor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
// This performs basic checks such as reduction creation, getIdentity() method,
55
// and the combine() method of the aux class 'reducer'.

sycl/test/bit_cast/bit_cast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55

sycl/test/extensions/usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t1.out
2+
// RUN: %RUN_ON_HOST %t1.out
33

44
//==---------- allocator_equal.cpp - Allocator Equality test ---------------==//
55
//

sycl/test/function-pointers/fp-as-kernel-arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33
// FIXME: This test should use runtime early exit once correct check for
44
// corresponding extension is implemented
55

sycl/test/function-pointers/pass-fp-through-buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33
// FIXME: This test should use runtime early exit once correct check for
44
// corresponding extension is implemented
55

sycl/test/functor/functor_inheritance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55
#include <cassert>

sycl/test/functor/kernel_functor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s
22
// RUN: cd %T
3-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
3+
// RUN: %RUN_ON_HOST %t.out
44

55
//==--- kernel_functor.cpp - Functors as SYCL kernel test ------------------==//
66
//

sycl/test/kernel_param/array-kernel-param-nested-run.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks kernel execution with array parameters inside structs.
22

33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
4-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
4+
// RUN: %RUN_ON_HOST %t.out
55

66
#include <CL/sycl.hpp>
77
#include <iostream>

sycl/test/kernel_param/array-kernel-param-run.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks kernel execution with array kernel parameters.
22

33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
4-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
4+
// RUN: %RUN_ON_HOST %t.out
55

66
#include <CL/sycl.hpp>
77
#include <iostream>

sycl/test/kernel_param/non-standard-layout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
#include <CL/sycl.hpp>
55

sycl/test/kernel_param/struct_kernel_param.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33

44
//==-struct_kernel_param.cpp-Checks passing structs as kernel params--------==//
55
//

sycl/test/kernel_param/union_kernel_param.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks kernel execution with union type as kernel parameters.
22

33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
4-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
4+
// RUN: %RUN_ON_HOST %t.out
55

66
#include <CL/sycl.hpp>
77
#include <cstdio>

sycl/test/lit.cfg.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@
7575

7676
llvm_config.add_tool_substitutions(['llvm-spirv'], [config.sycl_tools_dir])
7777

78-
backend=lit_config.params.get('SYCL_BE', "PI_OPENCL")
79-
lit_config.note("Backend (SYCL_BE): {}".format(backend))
80-
config.substitutions.append( ('%sycl_be', backend) )
78+
backend=lit_config.params.get('SYCL_PLUGIN', "opencl")
79+
lit_config.note("Backend: {}".format(backend))
80+
config.substitutions.append( ('%sycl_be', { 'opencl': 'PI_OPENCL', 'cuda': 'PI_CUDA', 'level_zero': 'PI_LEVEL_ZERO'}[backend]) )
81+
config.substitutions.append( ('%BE_RUN_PLACEHOLDER', "env SYCL_DEVICE_FILTER={SYCL_PLUGIN} ".format(SYCL_PLUGIN=backend)) )
82+
config.substitutions.append( ('%RUN_ON_HOST', "env SYCL_DEVICE_FILTER=host ") )
8183

8284
get_device_count_by_type_path = os.path.join(config.llvm_tools_dir, "get_device_count_by_type")
8385

@@ -131,11 +133,11 @@ def getDeviceCount(device_type):
131133
if getDeviceCount("cpu")[0]:
132134
found_at_least_one_device = True
133135
lit_config.note("Found available CPU device")
134-
cpu_run_substitute = "env SYCL_DEVICE_TYPE=CPU SYCL_BE={SYCL_BE} ".format(SYCL_BE=backend)
136+
cpu_run_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:cpu ".format(SYCL_PLUGIN=backend)
135137
cpu_check_substitute = "| FileCheck %s"
136138
config.available_features.add('cpu')
137139
if platform.system() == "Linux":
138-
cpu_run_on_linux_substitute = "env SYCL_DEVICE_TYPE=CPU SYCL_BE={SYCL_BE} ".format(SYCL_BE=backend)
140+
cpu_run_on_linux_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:cpu ".format(SYCL_PLUGIN=backend)
139141
cpu_check_on_linux_substitute = "| FileCheck %s"
140142
else:
141143
lit_config.warning("CPU device not found")
@@ -157,7 +159,7 @@ def getDeviceCount(device_type):
157159
if gpu_count > 0:
158160
found_at_least_one_device = True
159161
lit_config.note("Found available GPU device")
160-
gpu_run_substitute = " env SYCL_DEVICE_TYPE=GPU SYCL_BE={SYCL_BE} ".format(SYCL_BE=backend)
162+
gpu_run_substitute = " env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu ".format(SYCL_PLUGIN=backend)
161163
gpu_check_substitute = "| FileCheck %s"
162164
config.available_features.add('gpu')
163165
if cuda:
@@ -166,10 +168,10 @@ def getDeviceCount(device_type):
166168
config.available_features.add('level_zero')
167169

168170
if platform.system() == "Linux":
169-
gpu_run_on_linux_substitute = "env SYCL_DEVICE_TYPE=GPU SYCL_BE={SYCL_BE} ".format(SYCL_BE=backend)
171+
gpu_run_on_linux_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu ".format(SYCL_PLUGIN=backend)
170172
gpu_check_on_linux_substitute = "| FileCheck %s"
171173
# ESIMD-specific setup. Requires OpenCL for now.
172-
esimd_run_substitute = " env SYCL_BE=PI_OPENCL SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen"
174+
esimd_run_substitute = " env SYCL_DEVICE_FILTER=opencl:gpu SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen"
173175
config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) )
174176
config.substitutions.append( ('%clangxx-esimd', "clang++ -fsycl-explicit-simd" ) )
175177
else:
@@ -185,7 +187,7 @@ def getDeviceCount(device_type):
185187
if getDeviceCount("accelerator")[0]:
186188
found_at_least_one_device = True
187189
lit_config.note("Found available accelerator device")
188-
acc_run_substitute = " env SYCL_DEVICE_TYPE=ACC "
190+
acc_run_substitute = " env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:acc ".format(SYCL_PLUGIN=backend)
189191
acc_check_substitute = "| FileCheck %s"
190192
config.available_features.add('accelerator')
191193
else:

sycl/test/multi_ptr/multi_ptr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t.out
2-
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
2+
// RUN: %RUN_ON_HOST %t.out
33
// RUN: %clangxx -DRESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t1.out
4-
// RUN: env SYCL_DEVICE_TYPE=HOST %t1.out
4+
// RUN: %RUN_ON_HOST %t1.out
55

66
//==--------------- multi_ptr.cpp - SYCL multi_ptr test --------------------==//
77
//

0 commit comments

Comments
 (0)