Skip to content

Commit

Permalink
Add pragma to guard generic device usage and exception
Browse files Browse the repository at this point in the history
  • Loading branch information
s-Nick committed Sep 5, 2024
1 parent d21ac7b commit ee6569c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/oneapi/mkl/detail/backends_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ static std::map<domain, std::map<device, std::vector<const char*>>> libraries =
} },
{ device::generic_device,
{
#ifdef ENABLE_PORTBLAS_BACKEND
LIB_NAME("blas_portblas"),
#endif
} } } },

{ domain::dft,
Expand Down
4 changes: 4 additions & 0 deletions src/include/function_table_initializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ class table_initializer {
break;
}
if (!handle) {
#ifndef ENABLE_PORTBLAS_BACKEND
if (key == oneapi::mkl::device::generic_device) {
throw mkl::unsupported_device("", "", q.get_device());
}
else {
#endif
std::cerr << ERROR_MSG << '\n';
throw mkl::backend_not_found();
#ifndef ENABLE_PORTBLAS_BACKEND
}
#endif
}
auto t =
reinterpret_cast<function_table_t *>(::GET_FUNC(handle.get(), table_names[domain_id]));
Expand Down

0 comments on commit ee6569c

Please sign in to comment.