forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Fix ONEAPI_DEVICE_SELECTOR handling of discard filters. (intel…
…#13927) Currently, ONEAPI_DEVICE_SELECTOR incorrectly parses '!', used for discard filters.
- Loading branch information
1 parent
46cfb06
commit 1d24713
Showing
2 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: %{build} -o %t.out | ||
|
||
// Test discard filters in ONEAPI_DEVICE_SELECTOR. | ||
// RUN: env ONEAPI_DEVICE_SELECTOR="!*:gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}{{gpu|GPU|Gpu}}{{.*}}]:[{{.*}}]" | ||
// RUN: env ONEAPI_DEVICE_SELECTOR="!*:cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}{{cpu|CPU|cpu}}{{.*}}]:[{{.*}}]" | ||
// RUN: env ONEAPI_DEVICE_SELECTOR="!*:cpu,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}{{cpu|CPU|cpu|gpu|GPU|Gpu}}{{.*}}]:[{{.*}}]" | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR="!opencl:*" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}]:[{{.*}}{{OpenCL|opencl|Opencl}}{{.*}}]" | ||
// RUN: env ONEAPI_DEVICE_SELECTOR="!level_zero:*" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}]:[{{.*}}{{Level-Zero}}{{.*}}]" | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR="!level_zero:cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --allow-empty --implicit-check-not="[{{.*}}{{cpu|CPU|Cpu}}{{.*}}]:[{{.*}}{{Level-Zero}}{{.*}}]" | ||
|
||
#include <iostream> | ||
#include <sycl/detail/core.hpp> | ||
using namespace sycl; | ||
|
||
int main() { | ||
for (auto &d : device::get_devices()) { | ||
// Get device name and backend name. | ||
std::string device_name = d.get_info<info::device::name>(); | ||
std::string be_name = d.get_platform().get_info<info::platform::name>(); | ||
|
||
std::cout << "[" << device_name << "]:[" << be_name << "]" << std::endl; | ||
} | ||
return 0; | ||
} |