Skip to content

[SYCL][E2E] Use %{run*} placeholder in tests #10470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 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" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does %{run-unfiltered-devices} just a nop to be stylistically accurate and to prevent adding %{run} here? Or there is something more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is, see

run_unfiltered_substitution = ''
if extra_env:
run_unfiltered_substitution = 'env {} '.format(' '.join(extra_env))
run_unfiltered_substitution += test.config.run_launcher
substitutions.append(('%{run-unfiltered-devices}', run_unfiltered_substitution))

// 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" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:acc,cpu" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
// 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="*:cpu,acc,gpu" %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu,acc,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
12 changes: 6 additions & 6 deletions sycl/test-e2e/FilterSelector/select_device.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %{build} -o %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:*" %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:cpu;level_zero:gpu' %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:acc %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:*" %{run-unfiltered-devices} %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %{run-unfiltered-devices} %t.out
// 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
//
// Checks if only specified device types can be acquired from select_device
// when ONEAPI_DEVICE_SELECTOR is set
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' %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:acc' %{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
2 changes: 1 addition & 1 deletion sycl/test-e2e/FilterSelector/select_device_cpu.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='*:cpu' %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='*:cpu' %{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
2 changes: 1 addition & 1 deletion sycl/test-e2e/FilterSelector/select_device_cuda.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=cuda:gpu %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{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
@@ -1,5 +1,5 @@
// RUN: %{build} -o %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{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
2 changes: 1 addition & 1 deletion sycl/test-e2e/FilterSelector/select_device_opencl.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='opencl:*' %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR='opencl:*' %{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