Skip to content

Commit

Permalink
[SYCL][E2E] Remove unnecessary custom device selector from InvokeSimd…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
ayylol authored Aug 30, 2024
1 parent c4fe7d5 commit e7c887c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
16 changes: 1 addition & 15 deletions sycl/test-e2e/InvokeSimd/invoke_simd_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ template <class SimdElemT>
return calc(val);
}

int ESIMD_selector_v(const device &device) {
if (const char *dev_filter = getenv("ONEAPI_DEVICE_SELECTOR")) {
std::string filter_string(dev_filter);
if (filter_string.find("gpu") != std::string::npos)
return device.is_gpu() ? 1000 : -1;
std::cerr << "Supported 'ONEAPI_DEVICE_SELECTOR' env var values is "
"'*:gpu' and '"
<< filter_string << "' does not contain such substrings.\n";
return -1;
}
// If "ONEAPI_DEVICE_SELECTOR" not defined, only allow gpu device
return device.is_gpu() ? 1000 : -1;
}

inline auto createExceptionHandler() {
return [](exception_list l) {
for (auto ep : l) {
Expand Down Expand Up @@ -147,7 +133,7 @@ template <class SpmdT, class SimdElemT, bool IsUniform> bool test(queue q) {
}

int main(void) {
queue q(ESIMD_selector_v, createExceptionHandler());
queue q(default_selector_v, createExceptionHandler());

auto dev = q.get_device();
std::cout << "Running on " << dev.get_info<sycl::info::device::name>()
Expand Down
16 changes: 1 addition & 15 deletions sycl/test-e2e/InvokeSimd/invoke_simd_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ ESIMD_CALLEE(float *A, esimd::simd<float, VL> b, int i) SYCL_ESIMD_FUNCTION {

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

int ESIMD_selector_v(const device &device) {
if (const char *dev_filter = getenv("ONEAPI_DEVICE_SELECTOR")) {
std::string filter_string(dev_filter);
if (filter_string.find("gpu") != std::string::npos)
return device.is_gpu() ? 1000 : -1;
std::cerr << "Supported 'ONEAPI_DEVICE_SELECTOR' env var values is "
"'*:gpu' and '"
<< filter_string << "' does not contain such substrings.\n";
return -1;
}
// If "ONEAPI_DEVICE_SELECTOR" not defined, only allow gpu device
return device.is_gpu() ? 1000 : -1;
}

inline auto createExceptionHandler() {
return [](exception_list l) {
for (auto ep : l) {
Expand All @@ -94,7 +80,7 @@ template <bool use_func_directly> bool test() {
constexpr unsigned Size = 1024;
constexpr unsigned GroupSize = 4 * VL;

queue q(ESIMD_selector_v, createExceptionHandler());
queue q(default_selector_v, createExceptionHandler());

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

0 comments on commit e7c887c

Please sign in to comment.