Skip to content

Commit e7c887c

Browse files
authored
[SYCL][E2E] Remove unnecessary custom device selector from InvokeSimd tests (#15231)
The local lit configuration specifies that a GPU device is required to run InvokeSimd tests, so the default selector works just fine. In addition, the custom selector in the tests could only select GPUs.
1 parent c4fe7d5 commit e7c887c

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

sycl/test-e2e/InvokeSimd/invoke_simd_conv.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,6 @@ template <class SimdElemT>
5050
return calc(val);
5151
}
5252

53-
int ESIMD_selector_v(const device &device) {
54-
if (const char *dev_filter = getenv("ONEAPI_DEVICE_SELECTOR")) {
55-
std::string filter_string(dev_filter);
56-
if (filter_string.find("gpu") != std::string::npos)
57-
return device.is_gpu() ? 1000 : -1;
58-
std::cerr << "Supported 'ONEAPI_DEVICE_SELECTOR' env var values is "
59-
"'*:gpu' and '"
60-
<< filter_string << "' does not contain such substrings.\n";
61-
return -1;
62-
}
63-
// If "ONEAPI_DEVICE_SELECTOR" not defined, only allow gpu device
64-
return device.is_gpu() ? 1000 : -1;
65-
}
66-
6753
inline auto createExceptionHandler() {
6854
return [](exception_list l) {
6955
for (auto ep : l) {
@@ -147,7 +133,7 @@ template <class SpmdT, class SimdElemT, bool IsUniform> bool test(queue q) {
147133
}
148134

149135
int main(void) {
150-
queue q(ESIMD_selector_v, createExceptionHandler());
136+
queue q(default_selector_v, createExceptionHandler());
151137

152138
auto dev = q.get_device();
153139
std::cout << "Running on " << dev.get_info<sycl::info::device::name>()

sycl/test-e2e/InvokeSimd/invoke_simd_smoke.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ ESIMD_CALLEE(float *A, esimd::simd<float, VL> b, int i) SYCL_ESIMD_FUNCTION {
5555

5656
float SPMD_CALLEE(float *A, float b, int i) { return A[i] + b; }
5757

58-
int ESIMD_selector_v(const device &device) {
59-
if (const char *dev_filter = getenv("ONEAPI_DEVICE_SELECTOR")) {
60-
std::string filter_string(dev_filter);
61-
if (filter_string.find("gpu") != std::string::npos)
62-
return device.is_gpu() ? 1000 : -1;
63-
std::cerr << "Supported 'ONEAPI_DEVICE_SELECTOR' env var values is "
64-
"'*:gpu' and '"
65-
<< filter_string << "' does not contain such substrings.\n";
66-
return -1;
67-
}
68-
// If "ONEAPI_DEVICE_SELECTOR" not defined, only allow gpu device
69-
return device.is_gpu() ? 1000 : -1;
70-
}
71-
7258
inline auto createExceptionHandler() {
7359
return [](exception_list l) {
7460
for (auto ep : l) {
@@ -94,7 +80,7 @@ template <bool use_func_directly> bool test() {
9480
constexpr unsigned Size = 1024;
9581
constexpr unsigned GroupSize = 4 * VL;
9682

97-
queue q(ESIMD_selector_v, createExceptionHandler());
83+
queue q(default_selector_v, createExceptionHandler());
9884

9985
auto dev = q.get_device();
10086
std::cout << "Running with use_func_directly = " << use_func_directly

0 commit comments

Comments
 (0)