Skip to content

Commit 84a31c6

Browse files
committed
ggml-sycl.cpp: Add try catch sycl::exception block in compute_forward
1 parent bb0532e commit 84a31c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3290,7 +3290,7 @@ catch (sycl::exception const &exc) {
32903290
std::exit(1);
32913291
}
32923292

3293-
static bool ggml_sycl_compute_forward(ggml_backend_sycl_context & ctx, struct ggml_tensor * dst) {
3293+
static bool ggml_sycl_compute_forward(ggml_backend_sycl_context & ctx, struct ggml_tensor * dst) try {
32943294
if (!g_sycl_loaded) return false;
32953295

32963296
if (dst->src[0] != nullptr && ggml_backend_buffer_is_sycl_split(dst->src[0]->buffer)) {
@@ -3483,6 +3483,9 @@ static bool ggml_sycl_compute_forward(ggml_backend_sycl_context & ctx, struct gg
34833483
}
34843484

34853485
return true;
3486+
} catch (sycl::exception & e) {
3487+
std::cerr << e.what() << "Exception caught at file:" << __FILE__ << ", line:" << __LINE__ << std::endl;
3488+
std::exit(1);
34863489
}
34873490

34883491
GGML_API void ggml_backend_sycl_get_device_description(int device, char *description,

0 commit comments

Comments
 (0)