Skip to content

Commit f4014a6

Browse files
committed
concat: Handle SYCL exceptions
1 parent a8a7e87 commit f4014a6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ggml/src/ggml-sycl/concat.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static void concat_f32_sycl_non_cont(
158158
});
159159
}
160160

161-
void ggml_sycl_op_concat(ggml_backend_sycl_context & ctx, ggml_tensor *dst) {
161+
static void ggml_sycl_op_concat(ggml_backend_sycl_context & ctx, ggml_tensor * dst) try {
162162
const ggml_tensor *src0 = dst->src[0];
163163
const ggml_tensor *src1 = dst->src[1];
164164
queue_ptr stream = ctx.stream();
@@ -194,4 +194,13 @@ void ggml_sycl_op_concat(ggml_backend_sycl_context & ctx, ggml_tensor *dst) {
194194
src1->ne[1], src1->ne[2], src1->ne[3], src1->nb[0], src1->nb[1],
195195
src1->nb[2], src1->nb[3], dst->ne[0], dst->ne[1], dst->ne[2],
196196
dst->ne[3], dst->nb[0], dst->nb[1], dst->nb[2], dst->nb[3], dim);
197+
} catch (const sycl::exception & exc) {
198+
std::cerr << exc.what() << "Exception caught at file:" << __FILE__ << ", line:" << __LINE__ << std::endl;
199+
std::exit(1);
197200
}
201+
202+
void ggml_sycl_concat(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
203+
GGML_SYCL_DEBUG("call %s\n", __func__);
204+
ggml_sycl_op_concat(ctx, dst);
205+
GGML_SYCL_DEBUG("call %s done\n", __func__);
206+
}

ggml/src/ggml-sycl/concat.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
#include "common.hpp"
1717

18-
void ggml_sycl_op_concat(ggml_backend_sycl_context & ctx, ggml_tensor *dst);
18+
void ggml_sycl_concat(ggml_backend_sycl_context & ctx, ggml_tensor * dst);
1919

2020
#endif // GGML_SYCL_CONCAT_HPP

0 commit comments

Comments
 (0)