Skip to content

Commit

Permalink
Tests are crashing if no default device (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy authored Feb 21, 2023
1 parent d7219e2 commit 4012c98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions dpnp/backend/src/queue_sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ class backend_sycl
#else
// temporal solution. Started from Sept-2020
DPCTLSyclQueueRef DPCtrl_queue = DPCTLQueueMgr_GetCurrentQueue();
if (DPCtrl_queue == nullptr)
{
std::string reason = (DPCTLQueueMgr_GetQueueStackSize() == static_cast<size_t>(-1))
? ": the queue stack is empty, probably no device is available."
: ".";
throw std::runtime_error("Failed to create a copy of SYCL queue with default device" + reason);
}
return *(reinterpret_cast<sycl::queue*>(DPCtrl_queue));
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion dpnp/dpnp_algo/dpnp_algo.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ cdef extern from "constants.hpp":

cdef extern from "dpnp_iface.hpp":
void dpnp_queue_initialize_c(QueueOptions selector)
size_t dpnp_queue_is_cpu_c()
size_t dpnp_queue_is_cpu_c() except +

char * dpnp_memory_alloc_c(size_t size_in_bytes) except +
void dpnp_memory_free_c(void * ptr)
Expand Down

0 comments on commit 4012c98

Please sign in to comment.