Skip to content

[SYCL][ROCM] Added ROCm backend to device filter #4077

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 5 commits into from
Jul 9, 2021
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
3 changes: 2 additions & 1 deletion sycl/source/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ static const std::array<std::pair<std::string, info::device_type>, 5>
{"*", 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 = {
static const std::array<std::pair<std::string, backend>, 6> SyclBeMap = {
{{"host", backend::host},
{"opencl", backend::opencl},
{"level_zero", backend::level_zero},
{"cuda", backend::cuda},
{"rocm", backend::rocm},
{"*", backend::all}}};

template <> class SYCLConfig<SYCL_DEVICE_FILTER> {
Expand Down
3 changes: 2 additions & 1 deletion sycl/source/detail/device_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ device_filter::device_filter(const std::string &FilterString) {
} catch (...) {
std::string Message =
std::string("Invalid device filter: ") + FilterString +
"\nPossible backend values are {host,opencl,level_zero,cuda,*}.\n"
"\nPossible backend values are "
"{host,opencl,level_zero,cuda,rocm,*}.\n"
"Possible device types are {host,cpu,gpu,acc,*}.\n"
"Device number should be an non-negative integer.\n";
throw cl::sycl::invalid_parameter_error(Message, PI_INVALID_VALUE);
Expand Down
9 changes: 4 additions & 5 deletions sycl/unittests/allowlist/ParseAllowList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ TEST(ParseAllowListTests, CheckAllValidBackendNameValuesAreProcessed) {
}
sycl::detail::AllowListParsedT ActualValue =
sycl::detail::parseAllowList(AllowList);
sycl::detail::AllowListParsedT ExpectedValue{{{"BackendName", "host"}},
{{"BackendName", "opencl"}},
{{"BackendName", "level_zero"}},
{{"BackendName", "cuda"}},
{{"BackendName", "*"}}};
sycl::detail::AllowListParsedT ExpectedValue{
{{"BackendName", "host"}}, {{"BackendName", "opencl"}},
{{"BackendName", "level_zero"}}, {{"BackendName", "cuda"}},
{{"BackendName", "rocm"}}, {{"BackendName", "*"}}};
EXPECT_EQ(ExpectedValue, ActualValue);
}

Expand Down