Skip to content

Commit

Permalink
Revert dropping acc support
Browse files Browse the repository at this point in the history
Will do it in a seperate PR
  • Loading branch information
uditagarwal97 committed Feb 2, 2024
1 parent dc54a26 commit fea9979
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
16 changes: 1 addition & 15 deletions sycl/source/detail/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,7 @@ void dumpConfig() {
#undef CONFIG
}

// Array is used by ONEAPI_DEVICE_SELECTOR.
// TODO: host device type will be removed once sycl_ext_oneapi_filter_selector
// is removed.
const std::array<std::pair<std::string, info::device_type>, 5> &
getODSDeviceTypeMap() {
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},
{"fpga", info::device_type::accelerator},
{"*", info::device_type::all}}};
return SyclDeviceTypeMap;
}

// Array is used by SYCL_DEVICE_ALLOWLIST.
// Array is used by SYCL_DEVICE_ALLOWLIST and ONEAPI_DEVICE_SELECTOR.
// TODO: host device type will be removed once sycl_ext_oneapi_filter_selector
// is removed.
const std::array<std::pair<std::string, info::device_type>, 6> &
Expand Down
6 changes: 1 addition & 5 deletions sycl/source/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,7 @@ template <> class SYCLConfig<SYCL_PARALLEL_FOR_RANGE_ROUNDING_PARAMS> {
}
};

// Array is used by ONEAPI_DEVICE_SELECTOR.
const std::array<std::pair<std::string, info::device_type>, 5> &
getODSDeviceTypeMap();

// Array is used by SYCL_DEVICE_ALLOWLIST.
// Array is used by SYCL_DEVICE_ALLOWLIST and ONEAPI_DEVICE_SELECTOR.
const std::array<std::pair<std::string, info::device_type>, 6> &
getSyclDeviceTypeMap();

Expand Down
6 changes: 3 additions & 3 deletions sycl/source/detail/device_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ static void Parse_ODS_Device(ods_target &Target,

// Handle explicit device type (e.g. 'gpu').
auto DeviceTypeMap =
getODSDeviceTypeMap(); // <-- std::array<std::pair<std::string,
// info::device::type>>
getSyclDeviceTypeMap(); // <-- std::array<std::pair<std::string,
// info::device::type>>
auto It =
std::find_if(std::begin(DeviceTypeMap), std::end(DeviceTypeMap),
[&](auto DtPair) { return TopDeviceStr == DtPair.first; });
Expand Down Expand Up @@ -262,7 +262,7 @@ Parse_ONEAPI_DEVICE_SELECTOR(const std::string &envString) {
std::ostream &operator<<(std::ostream &Out, const ods_target &Target) {
Out << Target.Backend;
if (Target.DeviceType) {
auto DeviceTypeMap = getODSDeviceTypeMap();
auto DeviceTypeMap = getSyclDeviceTypeMap();
auto Match = std::find_if(
DeviceTypeMap.begin(), DeviceTypeMap.end(),
[&](auto Pair) { return (Pair.second == Target.DeviceType); });
Expand Down

0 comments on commit fea9979

Please sign in to comment.