Skip to content

Commit

Permalink
[SYCL] Replace acc with 'fpga' in tests using ONEAPI_DEVICE_SELECTOR (
Browse files Browse the repository at this point in the history
#12551)

As per the ONEAPI_DEVICE_SELECTOR
[documentation](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector),
the device type can only be cpu, gpu, or fpga (or any combination of
those). Currently, 'acc' is also accepted by ONEAPI_DEVICE_SELECTOR as a
valid device type, which is incorrect.

This PR modifies existing test cases to use 'fpga' instead of 'acc' in
ONEAPI_DEVICE_SELECTOR.
In future, we will completely drop 'acc' from device type in
ONEAPI_DEVICE_SELECTOR.

Partially addresses: #12387
  • Loading branch information
uditagarwal97 authored Feb 5, 2024
1 parent f331ba2 commit e94b247
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions sycl/test-e2e/FilterSelector/filter_list_cpu_gpu_acc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

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

// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:fpga" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
//
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc,cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:fpga,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:fpga,cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
//
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu,acc,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu,fpga,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
//
// CHECK-ACC-ONLY: Device: acc
// CHECK-ACC-ONLY-NOT: Device: cpu
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/FilterSelector/select_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:cpu;level_zero:gpu' %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:acc %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:fpga %{run-unfiltered-devices} %t.out
//
// Checks if only specified device types can be acquired from select_device
// when ONEAPI_DEVICE_SELECTOR is set
Expand Down Expand Up @@ -45,7 +45,7 @@ int main() {
device d = cs.select_device();
}
if (!envVal || forcedPIs == "*" ||
forcedPIs.find("acc") != std::string::npos) {
forcedPIs.find("fpga") != std::string::npos) {
accelerator_selector as;
device d = as.select_device();
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/FilterSelector/select_device_acc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %{build} -o %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:acc' %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:fpga' %{run-unfiltered-devices} %t.out
//
// Checks if only specified device types can be acquired from select_device
// when ONEAPI_DEVICE_SELECTOR is set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga,spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out

// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:acc %{run} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:fpga %{run} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out
4 changes: 2 additions & 2 deletions sycl/test-e2e/Sampler/basic-rw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./binx.bin
ONEAPI_DEVICE_SELECTOR=opencl:cpu ./binx.bin
ONEAPI_DEVICE_SELECTOR=opecl:acc ../binx.bin <-- does not support image
operations at this time.
ONEAPI_DEVICE_SELECTOR=opencl:fpga ../binx.bin <-- does not support
image operations at this time.
*/

Expand Down

0 comments on commit e94b247

Please sign in to comment.