mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-22 07:22:28 +08:00
Use try/catch only when exceptions are enabled.
This commit is contained in:
parent
d57430dd73
commit
1b95717358
@ -28,11 +28,15 @@ struct SyclDevice {
|
|||||||
template<typename dev_Selector> SyclDevice(dev_Selector s)
|
template<typename dev_Selector> SyclDevice(dev_Selector s)
|
||||||
:m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) {
|
:m_queue(cl::sycl::queue(s, [=](cl::sycl::exception_list l) {
|
||||||
for (const auto& e : l) {
|
for (const auto& e : l) {
|
||||||
|
#if EXCEPTIONS_ENABLED
|
||||||
try {
|
try {
|
||||||
std::rethrow_exception(e);
|
std::rethrow_exception(e);
|
||||||
} catch (cl::sycl::exception e) {
|
} catch (cl::sycl::exception e) {
|
||||||
std::cout << e.what() << std::endl;
|
std::cout << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
assert(false && "SyclDevice: Unhandled exception cought!");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
})) {}
|
})) {}
|
||||||
// destructor
|
// destructor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user