Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit de9a209

Browse files
authored
[SYCL] Replace SYCL_DEVICE_FILTER with ONEAPI_DEVICE_SELECTOR (#1354)
-Modified tests and config to use ONEAPI_DEVICE_SELECTOR instead of SYCL_DEVICE_FILTER -Added to test to check for warning message when using setting SYCL_DEVICE_FILTER environment variable
1 parent de95dbf commit de9a209

Some content is hidden

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

51 files changed

+165
-134
lines changed

SYCL/Basic/aspects.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_FILTER=%sycl_be %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' %t.out
33
//
44
// Hip is missing some of the parameters tested here so it fails with NVIDIA
55
// XFAIL: hip_nvidia

SYCL/Basic/buffer/buffer_allocator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=opencl %CPU_RUN_PLACEHOLDER %t.out
3-
// RUN: env SYCL_DEVICE_FILTER=opencl %GPU_RUN_PLACEHOLDER %t.out
4-
// RUN: env SYCL_DEVICE_FILTER=opencl %ACC_RUN_PLACEHOLDER %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='opencl:*' %CPU_RUN_PLACEHOLDER %t.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR='opencl:*' %GPU_RUN_PLACEHOLDER %t.out
4+
// RUN: env ONEAPI_DEVICE_SELECTOR='opencl:*' %ACC_RUN_PLACEHOLDER %t.out
55

66
//==---------- buffer_allocator.cpp - SYCL buffer allocator tests ----------==//
77
//

SYCL/Basic/context_platforms.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_FILTER=%sycl_be %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' %t.out
33
#include <iostream>
44
#include <sycl/sycl.hpp>
55

SYCL/Basic/diagnostics/device-check.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=cpu %t.out
3-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=gpu %t.out
4-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=acc %t.out
5-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=CPU %t.out
6-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=GPU %t.out
7-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=ACC %t.out
8-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=Cpu %t.out
9-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=Gpu %t.out
10-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=Acc %t.out
11-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be SYCL_DEVICE_TYPE=XPU %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=cpu %t.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=gpu %t.out
4+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=acc %t.out
5+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=CPU %t.out
6+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=GPU %t.out
7+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=ACC %t.out
8+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=Cpu %t.out
9+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=Gpu %t.out
10+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=Acc %t.out
11+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' SYCL_DEVICE_TYPE=XPU %t.out
1212

1313
//==------------------- device-check.cpp --------------------------==//
1414
// This is a diagnostic test which ensures that

SYCL/Basic/get_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
//==----------------- get_backend.cpp ------------------------==//
66
// This is a test of get_backend().
7-
// Do not set SYCL_DEVICE_FILTER. We do not want the preferred
7+
// Do not set ONEAPI_DEVICE_SELECTOR. We do not want the preferred
88
// backend.
99
//==----------------------------------------------------------==//
1010

SYCL/Basic/intel-ext-device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
3-
// RUN: env SYCL_DEVICE_FILTER=opencl:gpu %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %t.out
44
//
55
// REQUIRES: gpu
66
// UNSUPPORTED: cuda

SYCL/Basic/interop/construction_ocl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: opencl, opencl_icd
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %opencl_lib %s -o %t.ocl.out
3-
// RUN: env SYCL_DEVICE_FILTER="opencl" %t.ocl.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR="opencl:*" %t.ocl.out
44

55
#include <CL/cl.h>
66
#include <sycl/backend/opencl.hpp>

SYCL/Basic/interop/construction_ze.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: level_zero, level_zero_dev_kit
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.ze.out
3-
// RUN: env SYCL_DEVICE_FILTER="level_zero" %t.ze.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" %t.ze.out
44

55
#include <level_zero/ze_api.h>
66

SYCL/Basic/library_loading.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
33
// RUN: env SYCL_PI_TRACE=-1 %t.out &> %t_trace_no_filter.txt || true
44
// RUN: FileCheck --input-file=%t_trace_no_filter.txt --check-prefix=CHECK-NO-FILTER %s
5-
// RUN: env SYCL_PI_TRACE=-1 SYCL_DEVICE_FILTER=esimd_emulator %t.out &> %t_trace_esimd_filter.txt || true
5+
// RUN: env SYCL_PI_TRACE=-1 ONEAPI_DEVICE_SELECTOR='esimd_emulator:*' %t.out &> %t_trace_esimd_filter.txt || true
66
// RUN: FileCheck --input-file=%t_trace_esimd_filter.txt --check-prefix=CHECK-ESIMD-FILTER %s
77
// Checks pi traces on library loading
88

SYCL/Basic/query.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_FILTER="gpu" %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %t.out
33

44
// REQUIRES: gpu-intel-dg1
55
#include "query.hpp"

SYCL/Basic/query_emulate_subdevice.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 %s -o %t.out
22
// RUN: env CreateMultipleSubDevices=2 EnableTimestampPacket=1 \
3-
// RUN: NEOReadDebugKeys=1 SYCL_DEVICE_FILTER="gpu" %t.out
3+
// RUN: NEOReadDebugKeys=1 ONEAPI_DEVICE_SELECTOR="*:gpu" %t.out
44

55
// UNSUPPORTED: gpu-intel-dg1,cuda,hip
66
// Temporarily disable on L0 due to fails in CI

SYCL/Config/select_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ static std::vector<DevDescT> getAllowListDesc(std::string allowList) {
170170
int main() {
171171
bool passed = false;
172172
std::string sycl_be("opencl");
173-
if (getenv("SYCL_DEVICE_FILTER")) {
174-
sycl_be = getenv("SYCL_DEVICE_FILTER");
173+
if (getenv("ONEAPI_DEVICE_SELECTOR")) {
174+
sycl_be = getenv("ONEAPI_DEVICE_SELECTOR");
175175
}
176176

177177
// Test the GPU devices name and version number.

SYCL/DeprecatedFeatures/deprecated_intel_ext_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
3-
// RUN: env SYCL_DEVICE_FILTER=opencl:gpu %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %t.out
44
//
55
// REQUIRES: gpu
66
// UNSUPPORTED: cuda
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %clangxx -fsycl %s -o %t.out
2+
// RUN: env SYCL_DEVICE_FILTER='*' %t.out &> %t.log
3+
// RUN: FileCheck %s < %t.log
4+
//
5+
// CHECK: WARNING: The enviroment variable SYCL_DEVICE_FITLER is deprecated.
6+
// CHECK-SAME: Please use ONEAPI_DEVICE_SELECTOR instead.
7+
// CHECK-NEXT: For more details, please refer to:
8+
// CHECK-NEXT: https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector
9+
10+
//==---- deprecated_sycl_device_filter.cpp - SYCL 2020 deprecation test ----==//
11+
//
12+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
13+
// See https://llvm.org/LICENSE.txt for license information.
14+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
15+
//
16+
//===-----------------------------------------------------------------------------------------===//
17+
18+
// This test is to check if a warning message is displayed when using the
19+
// enviroment variable SYCL_DEVICE_FILTER
20+
// TODO: Remove test when SYCL_DEVICE_FILTER is removed
21+
#include <sycl/sycl.hpp>
22+
23+
int main() {
24+
using namespace sycl;
25+
platform p{};
26+
auto devices = p.get_devices();
27+
std::cout << "Passed test\n";
28+
return 0;
29+
}

SYCL/DeprecatedFeatures/platform.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 -D__SYCL_INTERNAL_API %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=%sycl_be %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='%sycl_be:*' %t.out
33
//==--------------- platform.cpp - SYCL platform test ----------------------==//
44
//
55
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

SYCL/DiscardEvents/discard_events_l0_inorder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
//
33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
44
//
5-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=0 SYCL_DEVICE_FILTER=level_zero %GPU_RUN_PLACEHOLDER %t.out
6-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_DEVICE_FILTER=level_zero %GPU_RUN_PLACEHOLDER %t.out
7-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=2 SYCL_DEVICE_FILTER=level_zero %GPU_RUN_PLACEHOLDER %t.out
8-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_DEVICE_FILTER=level_zero %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=0 ONEAPI_DEVICE_SELECTOR="level_zero:*" %GPU_RUN_PLACEHOLDER %t.out
6+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 ONEAPI_DEVICE_SELECTOR="level_zero:*" %GPU_RUN_PLACEHOLDER %t.out
7+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=2 ONEAPI_DEVICE_SELECTOR="level_zero:*" %GPU_RUN_PLACEHOLDER %t.out
8+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 ONEAPI_DEVICE_SELECTOR="level_zero:*" %GPU_RUN_PLACEHOLDER %t.out
99
//
1010
// The test is to check the execution of different queue operations has in-order
1111
// semantics regardless of batching.

SYCL/DiscardEvents/discard_events_l0_leak.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
//
55
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
66
//
7-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_DEVICE_FILTER=level_zero ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out wait 2>&1 %GPU_CHECK_PLACEHOLDER
8-
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_DEVICE_FILTER=level_zero ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out nowait 2>&1 %GPU_CHECK_PLACEHOLDER
7+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out wait 2>&1 %GPU_CHECK_PLACEHOLDER
8+
// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out nowait 2>&1 %GPU_CHECK_PLACEHOLDER
99
//
1010
// CHECK-NOT: LEAK
1111
//

SYCL/FilterSelector/filter_list_cpu_gpu_acc.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
// RUN: %clangxx -fsycl %S/Inputs/filter_list_queries.cpp -o %t.out
1212

13-
// RUN: env SYCL_DEVICE_FILTER=acc %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
14-
// RUN: env SYCL_DEVICE_FILTER=gpu %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
15-
// RUN: env SYCL_DEVICE_FILTER=cpu %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
13+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
14+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
15+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
1616
//
17-
// RUN: env SYCL_DEVICE_FILTER=acc,gpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
18-
// RUN: env SYCL_DEVICE_FILTER=acc,cpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
17+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc,gpu" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
18+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc,cpu" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
1919
//
20-
// RUN: env SYCL_DEVICE_FILTER=cpu,acc,gpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
20+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu,acc,gpu" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
2121
//
2222
// CHECK-ACC-ONLY: Device: acc
2323
// CHECK-ACC-ONLY-NOT: Device: cpu

SYCL/FilterSelector/select_device.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER="*" %t.out
3-
// RUN: env SYCL_DEVICE_FILTER=cpu %t.out
4-
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
5-
// RUN: env SYCL_DEVICE_FILTER=opencl:gpu %t.out
6-
// RUN: env SYCL_DEVICE_FILTER=cpu,level_zero:gpu %t.out
7-
// RUN: env SYCL_DEVICE_FILTER=opencl:acc %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:*" %t.out
3+
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %t.out
4+
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
5+
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %t.out
6+
// RUN: env ONEAPI_DEVICE_SELECTOR='*:cpu;level_zero:gpu' %t.out
7+
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:acc %t.out
88
//
99
// Checks if only specified device types can be acquired from select_device
10-
// when SYCL_DEVICE_FILTER is set
10+
// when ONEAPI_DEVICE_SELECTOR is set
1111
// Checks that no device is selected when no device of desired type is
1212
// available.
1313
//
@@ -20,10 +20,10 @@ using namespace sycl;
2020
using namespace std;
2121

2222
int main() {
23-
const char *envVal = std::getenv("SYCL_DEVICE_FILTER");
23+
const char *envVal = std::getenv("ONEAPI_DEVICE_SELECTOR");
2424
std::string forcedPIs;
2525
if (envVal) {
26-
std::cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
26+
std::cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2727
forcedPIs = envVal;
2828
}
2929
if (!envVal || forcedPIs == "*" ||

SYCL/FilterSelector/select_device_acc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=acc %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='*:acc' %t.out
33
//
44
// Checks if only specified device types can be acquired from select_device
5-
// when SYCL_DEVICE_FILTER is set
5+
// when ONEAPI_DEVICE_SELECTOR is set
66
// Checks that no device is selected when no device of desired type is
77
// available.
88
//
@@ -15,10 +15,10 @@ using namespace sycl;
1515
using namespace std;
1616

1717
int main() {
18-
const char *envVal = std::getenv("SYCL_DEVICE_FILTER");
18+
const char *envVal = std::getenv("ONEAPI_DEVICE_SELECTOR");
1919
std::string forcedPIs;
2020
if (envVal) {
21-
std::cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
21+
std::cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2222
forcedPIs = envVal;
2323
}
2424
{

SYCL/FilterSelector/select_device_cpu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=cpu %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='*:cpu' %t.out
33
//
44
// Checks if only specified device types can be acquired from select_device
5-
// when SYCL_DEVICE_FILTER is set
5+
// when ONEAPI_DEVICE_SELECTOR is set
66
// Checks that no device is selected when no device of desired type is
77
// available.
88
//
@@ -15,10 +15,10 @@ using namespace sycl;
1515
using namespace std;
1616

1717
int main() {
18-
const char *envVal = std::getenv("SYCL_DEVICE_FILTER");
18+
const char *envVal = std::getenv("ONEAPI_DEVICE_SELECTOR");
1919
std::string forcedPIs;
2020
if (envVal) {
21-
std::cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
21+
std::cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2222
forcedPIs = envVal;
2323
}
2424
{

SYCL/FilterSelector/select_device_cuda.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=cuda:gpu %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %t.out
33
//
44
// Checks if only specified device types can be acquired from select_device
5-
// when SYCL_DEVICE_FILTER is set.
5+
// when ONEAPI_DEVICE_SELECTOR is set.
66
// Checks that no device is selected when no device of desired type is
77
// available.
88
//
@@ -15,10 +15,10 @@ using namespace sycl;
1515
using namespace std;
1616

1717
int main() {
18-
const char *envVal = getenv("SYCL_DEVICE_FILTER");
18+
const char *envVal = getenv("ONEAPI_DEVICE_SELECTOR");
1919
string forcedPIs;
2020
if (envVal) {
21-
cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
21+
cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2222
forcedPIs = envVal;
2323
}
2424

SYCL/FilterSelector/select_device_level_zero.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
33
//
44
// Checks if only specified device types can be acquired from select_device
5-
// when SYCL_DEVICE_FILTER is set
5+
// when ONEAPI_DEVICE_SELECTOR is set
66
// Checks that no device is selected when no device of desired type is
77
// available.
88
//
@@ -15,10 +15,10 @@ using namespace sycl;
1515
using namespace std;
1616

1717
int main() {
18-
const char *envVal = getenv("SYCL_DEVICE_FILTER");
18+
const char *envVal = getenv("ONEAPI_DEVICE_SELECTOR");
1919
string forcedPIs;
2020
if (envVal) {
21-
cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
21+
cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2222
forcedPIs = envVal;
2323
}
2424

SYCL/FilterSelector/select_device_opencl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2-
// RUN: env SYCL_DEVICE_FILTER=opencl %t.out
2+
// RUN: env ONEAPI_DEVICE_SELECTOR='opencl:*' %t.out
33
//
44
// Checks if only specified device types can be acquired from select_device
5-
// when SYCL_DEVICE_FILTER is set
5+
// when ONEAPI_DEVICE_SELECTOR is set
66
// Checks that no device is selected when no device of desired type is
77
// available.
88
//
@@ -15,10 +15,10 @@ using namespace sycl;
1515
using namespace std;
1616

1717
int main() {
18-
const char *envVal = getenv("SYCL_DEVICE_FILTER");
18+
const char *envVal = getenv("ONEAPI_DEVICE_SELECTOR");
1919
string forcedPIs;
2020
if (envVal) {
21-
cout << "SYCL_DEVICE_FILTER=" << envVal << std::endl;
21+
cout << "ONEAPI_DEVICE_SELECTOR=" << envVal << std::endl;
2222
forcedPIs = envVal;
2323
}
2424

SYCL/InvokeSimd/invoke_simd_conv.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ template <class SimdElemT>
5353
class ESIMDSelector : public device_selector {
5454
// Require GPU device
5555
virtual int operator()(const device &device) const {
56-
if (const char *dev_filter = getenv("SYCL_DEVICE_FILTER")) {
56+
if (const char *dev_filter = getenv("ONEAPI_DEVICE_SELECTOR")) {
5757
std::string filter_string(dev_filter);
5858
if (filter_string.find("gpu") != std::string::npos)
5959
return device.is_gpu() ? 1000 : -1;
60-
std::cerr
61-
<< "Supported 'SYCL_DEVICE_FILTER' env var values is 'gpu' and '"
62-
<< filter_string << "' does not contain such substrings.\n";
60+
std::cerr << "Supported 'ONEAPI_DEVICE_SELECTOR' env var values is "
61+
"'*:gpu' and '"
62+
<< filter_string << "' does not contain such substrings.\n";
6363
return -1;
6464
}
65-
// If "SYCL_DEVICE_FILTER" not defined, only allow gpu device
65+
// If "ONEAPI_DEVICE_SELECTOR" not defined, only allow gpu device
6666
return device.is_gpu() ? 1000 : -1;
6767
}
6868
};

0 commit comments

Comments
 (0)