diff --git a/dpnp/backend/src/queue_sycl.hpp b/dpnp/backend/src/queue_sycl.hpp index 63dc01c1dab1..8683fdd5737d 100644 --- a/dpnp/backend/src/queue_sycl.hpp +++ b/dpnp/backend/src/queue_sycl.hpp @@ -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(-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(DPCtrl_queue)); #endif } diff --git a/dpnp/dpnp_algo/dpnp_algo.pxd b/dpnp/dpnp_algo/dpnp_algo.pxd index 65e07a9c7046..9bf161b0aaf7 100644 --- a/dpnp/dpnp_algo/dpnp_algo.pxd +++ b/dpnp/dpnp_algo/dpnp_algo.pxd @@ -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)