Skip to content
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

[SYCL][Joint Matrix] Relax matrix_combinations error handling #12866

Merged
Changes from 7 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
28 changes: 21 additions & 7 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,26 @@ struct get_device_info_impl<
using namespace ext::oneapi::experimental::matrix;
using namespace ext::oneapi::experimental;
backend CurrentBackend = Dev->getBackend();
architecture DeviceArch = get_device_info_impl<
ext::oneapi::experimental::architecture,
ext::oneapi::experimental::info::device::architecture>::get(Dev);
auto get_current_architecture = [&Dev]() -> std::optional<architecture> {
// this helper lambda ignores all runtime-related exceptions from
// quering the device architecture. For instance, if device architecture
// on user's machine is not supported by
// sycl_ext_oneapi_device_architecture, the runtime exception is ommited,
dm-vodopyanov marked this conversation as resolved.
Show resolved Hide resolved
// and std::nullopt is returned.
try {
return get_device_info_impl<
architecture,
ext::oneapi::experimental::info::device::architecture>::get(Dev);
} catch (sycl::exception &e) {
if (e.code() != errc::runtime)
std::rethrow_exception(std::make_exception_ptr(e));
}
return std::nullopt;
};
std::optional<architecture> DeviceArchOpt = get_current_architecture();
if (!DeviceArchOpt.has_value())
return {};
architecture DeviceArch = DeviceArchOpt.value();
if (architecture::intel_cpu_spr == DeviceArch)
return {
{16, 16, 64, 0, 0, 0, matrix_type::uint8, matrix_type::uint8,
Expand Down Expand Up @@ -850,10 +867,7 @@ struct get_device_info_impl<
for (const auto &Item : NvidiaArchNumbs)
if (Item.second == arch)
return Item.first;
throw sycl::exception(
make_error_code(errc::runtime),
"The current device architecture is not supported by "
"sycl_ext_oneapi_matrix.");
return 0.f;
};
float ComputeCapability = GetArchNum(DeviceArch);
std::vector<combination> sm_70_combinations = {
Expand Down
Loading