Skip to content

Tests are crashing if no default device #1311

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 1 commit into from
Feb 21, 2023
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
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