Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion sycl/doc/EnvironmentVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ subject to change. Do not rely on these variables in production code.
| SYCL_DISABLE_EXECUTION_GRAPH_CLEANUP | Any(\*) | Disable cleanup of finished command nodes at host-device synchronization points. |
| SYCL_THROW_ON_BLOCK | Any(\*) | Throw an exception on attempt to wait for a blocked command. |
| SYCL_DEVICELIB_INHIBIT_NATIVE | String of device library extensions (separated by a whitespace) | Do not rely on device native support for devicelib extensions listed in this option. |
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. Special characters, such as parenthesis, must be escaped. More than one device can be specified using the piping symbol "\|".|
| SYCL_DEVICE_ALLOWLIST | A list of devices and their driver version following the pattern: BackendName:XXX,DeviceType:YYY,DeviceVendorId:ZZZ,DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformVersion, DeviceName and PlatformName | Filter out devices that do not match the pattern specified. BackendName accepts `host`, `opencl`, `level_zero` or `cuda`. DeviceType accepts `host`, `cpu`, `gpu` or `acc`. DeviceVendorId accepts uint32_t in hex form (0xXYZW). DriverVersion, PlatformVersion, DeviceName and PlatformName accept regular expression. Special characters, such as parenthesis, must be escaped. DPC++ runtime will select only those devices which satisfy provided values above and regex. More than one device can be specified using the piping symbol "\|".|
| SYCL_QUEUE_THREAD_POOL_SIZE | Positive integer | Number of threads in thread pool of queue. |
| SYCL_DEVICELIB_NO_FALLBACK | Any(\*) | Disable loading and linking of device library images |
| SYCL_PI_LEVEL_ZERO_MAX_COMMAND_LIST_CACHE | Positive integer | Maximum number of oneAPI Level Zero Command lists that can be allocated with no reuse before throwing an "out of resources" error. Default is 20000, threshold may be increased based on resource availabilty and workload demand. |
Expand Down
18 changes: 17 additions & 1 deletion sycl/source/detail/config.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//==---------------- config.hpp - SYCL context ------------------*- C++-*---==//
//==---------------- config.hpp - SYCL config -------------------*- C++-*---==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down Expand Up @@ -166,6 +166,22 @@ template <> class SYCLConfig<SYCL_PI_TRACE> {
}
};

// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST
static const std::array<std::pair<std::string, info::device_type>, 5>
SyclDeviceTypeMap = {{{"host", info::device_type::host},
{"cpu", info::device_type::cpu},
{"gpu", info::device_type::gpu},
{"acc", info::device_type::accelerator},
{"*", info::device_type::all}}};

// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST
static const std::array<std::pair<std::string, backend>, 5> SyclBeMap = {
{{"host", backend::host},
{"opencl", backend::opencl},
{"level_zero", backend::level_zero},
{"cuda", backend::cuda},
{"*", backend::all}}};

template <> class SYCLConfig<SYCL_DEVICE_FILTER> {
using BaseT = SYCLConfigBase<SYCL_DEVICE_FILTER>;

Expand Down
13 changes: 0 additions & 13 deletions sycl/source/detail/device_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ namespace sycl {
namespace detail {

device_filter::device_filter(const std::string &FilterString) {
const std::array<std::pair<std::string, info::device_type>, 5>
SyclDeviceTypeMap = {{{"host", info::device_type::host},
{"cpu", info::device_type::cpu},
{"gpu", info::device_type::gpu},
{"acc", info::device_type::accelerator},
{"*", info::device_type::all}}};
const std::array<std::pair<std::string, backend>, 5> SyclBeMap = {
{{"host", backend::host},
{"opencl", backend::opencl},
{"level_zero", backend::level_zero},
{"cuda", backend::cuda},
{"*", backend::all}}};

size_t Cursor = 0;
size_t ColonPos = 0;
auto findElement = [&](auto Element) {
Expand Down
Loading