Skip to content

Commit d7c2c45

Browse files
committed
Fixed getting device context on windows
Signed-off-by: Gregory Shimansky <[email protected]>
1 parent dd34f7e commit d7c2c45

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

third_party/intel/backend/driver.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ static PyObject *loadBinary(PyObject *self, PyObject *args) {
137137
const size_t binary_size = PyBytes_Size(py_bytes);
138138

139139
uint8_t *binary_ptr = (uint8_t *)PyBytes_AsString(py_bytes);
140-
const auto ctx = sycl_device.get_platform().ext_oneapi_get_default_context();
140+
auto platform = sycl_device.get_platform();
141+
sycl::context ctx;
142+
try {
143+
ctx = platform.ext_oneapi_get_default_context();
144+
} catch (const std::runtime_error &ex) {
145+
#if _DEBUG
146+
std::cout << "ERROR: " << ex.what() << std::endl;
147+
#endif
148+
}
141149
const auto l0_device =
142150
sycl::get_native<sycl::backend::ext_oneapi_level_zero>(sycl_device);
143151
const auto l0_context =

0 commit comments

Comments
 (0)