From 7d05d7c5a8b468966b1992c776ef495bd6ae0d71 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 4 Oct 2022 16:25:35 -0500 Subject: [PATCH] Fixing UnboundLocalError raised on line 347 This may arise when CPU RT is misconfigued and TBB library can not be found by the CPU driver, resulting in failure to create context, and hence the queue. --- dpctl/_sycl_queue.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dpctl/_sycl_queue.pyx b/dpctl/_sycl_queue.pyx index ad681657b6..3b3e8c7db1 100644 --- a/dpctl/_sycl_queue.pyx +++ b/dpctl/_sycl_queue.pyx @@ -344,7 +344,10 @@ cdef class SyclQueue(_SyclQueue): ) elif status == -3 or status == -7: raise SyclQueueCreationError( - "SYCL Context could not be created from '{}'.".format(arg) + "SYCL Context could not be created " + ("by default constructor" if len_args == 0 else + "from '{}'.".format(arg) + ) ) elif status == -4 or status == -6: if len_args == 2: