Skip to content

Commit 9f2fd8f

Browse files
Removed silent event APIs exits
1 parent df37af0 commit 9f2fd8f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

ggml/src/ggml-sycl.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4999,17 +4999,13 @@ static ggml_status ggml_backend_sycl_graph_compute(ggml_backend_t backend, ggml_
49994999
static void ggml_backend_sycl_event_record(ggml_backend_t backend, ggml_backend_event_t event)
50005000
try
50015001
{
5002-
if (event == nullptr || event->context == nullptr) {
5003-
return;
5004-
}
5005-
50065002
ggml_backend_sycl_context *sycl_ctx =
50075003
(ggml_backend_sycl_context *)backend->context;
50085004
sycl::event *sycl_event = static_cast<sycl::event *>(event->context);
50095005

50105006
const queue_ptr &stream = sycl_ctx->stream(sycl_ctx->device, 0);
50115007
// Record the current state of the queue
5012-
*sycl_event = stream->ext_oneapi_submit_barrier();
5008+
SYCL_CHECK(CHECK_TRY_ERROR(*sycl_event = stream->ext_oneapi_submit_barrier()));
50135009
}
50145010
catch (sycl::exception const &exc)
50155011
{
@@ -5019,10 +5015,6 @@ catch (sycl::exception const &exc)
50195015
}
50205016

50215017
static void ggml_backend_sycl_event_wait(ggml_backend_t backend, ggml_backend_event_t event) try {
5022-
if (event == nullptr || event->context == nullptr) {
5023-
return;
5024-
}
5025-
50265018
ggml_backend_sycl_context* sycl_ctx = static_cast<ggml_backend_sycl_context*>(backend->context);
50275019
sycl::event* sycl_event = static_cast<sycl::event*>(event->context);
50285020

@@ -5345,15 +5337,15 @@ static void ggml_backend_sycl_device_event_free(ggml_backend_dev_t dev, ggml_bac
53455337
}
53465338

53475339

5348-
static void ggml_backend_sycl_device_event_synchronize(ggml_backend_dev_t dev, ggml_backend_event_t event) {
5340+
static void ggml_backend_sycl_device_event_synchronize(ggml_backend_dev_t dev, ggml_backend_event_t event) try {
53495341
GGML_UNUSED(dev);
53505342

5351-
if (event == nullptr || event->context == nullptr) {
5352-
return;
5353-
}
5354-
53555343
sycl::event *sycl_event = static_cast<sycl::event *>(event->context);
53565344
SYCL_CHECK(CHECK_TRY_ERROR(sycl_event->wait()));
5345+
} catch (sycl::exception const &exc) {
5346+
std::cerr << exc.what() << "Exception caught at file:" << __FILE__
5347+
<< ", line:" << __LINE__ << std::endl;
5348+
std::exit(1);
53575349
}
53585350

53595351
static const ggml_backend_device_i ggml_backend_sycl_device_interface = {

0 commit comments

Comments
 (0)