@@ -311,7 +311,7 @@ static void rms_norm_f32_sycl(const float* x, float* dst, const int ncols,
311
311
}
312
312
}
313
313
314
- void ggml_sycl_op_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
314
+ static void ggml_sycl_op_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) try {
315
315
316
316
GGML_ASSERT (dst->src [0 ]->type == GGML_TYPE_F32);
317
317
GGML_ASSERT (dst->type == GGML_TYPE_F32);
@@ -328,9 +328,12 @@ void ggml_sycl_op_norm(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
328
328
dpct::queue_ptr main_stream = ctx.stream ();
329
329
330
330
norm_f32_sycl (src0_dd, dst_dd, ne00, nrows, eps, main_stream, ctx.device );
331
+ } catch (const sycl::exception & exc) {
332
+ std::cerr << exc.what () << " Exception caught at file:" << __FILE__ << " , line:" << __LINE__ << std::endl;
333
+ std::exit (1 );
331
334
}
332
335
333
- void ggml_sycl_op_group_norm (ggml_backend_sycl_context& ctx, ggml_tensor* dst) {
336
+ static void ggml_sycl_op_group_norm (ggml_backend_sycl_context& ctx, ggml_tensor* dst) try {
334
337
335
338
GGML_ASSERT (dst->src [0 ]->type == GGML_TYPE_F32);
336
339
GGML_ASSERT (dst->type == GGML_TYPE_F32);
@@ -346,9 +349,12 @@ void ggml_sycl_op_group_norm(ggml_backend_sycl_context& ctx, ggml_tensor* dst) {
346
349
float * dst_dd = static_cast <float *>(dst->data );
347
350
dpct::queue_ptr main_stream = ctx.stream ();
348
351
group_norm_f32_sycl (src0_dd, dst_dd, num_groups, eps, group_size, dst->src [0 ]->ne [0 ] * dst->src [0 ]->ne [1 ] * dst->src [0 ]->ne [2 ], main_stream, ctx.device );
352
+ } catch (const sycl::exception & exc) {
353
+ std::cerr << exc.what () << " Exception caught at file:" << __FILE__ << " , line:" << __LINE__ << std::endl;
354
+ std::exit (1 );
349
355
}
350
356
351
- void ggml_sycl_op_rms_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
357
+ static void ggml_sycl_op_rms_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) try {
352
358
353
359
GGML_ASSERT (dst->src [0 ]->type == GGML_TYPE_F32);
354
360
GGML_ASSERT (dst->type == GGML_TYPE_F32);
@@ -364,4 +370,25 @@ void ggml_sycl_op_rms_norm(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
364
370
dpct::queue_ptr main_stream = ctx.stream ();
365
371
366
372
rms_norm_f32_sycl (src0_dd, dst_dd, ne00, nrows, eps, main_stream, ctx.device );
373
+ } catch (const sycl::exception & exc) {
374
+ std::cerr << exc.what () << " Exception caught at file:" << __FILE__ << " , line:" << __LINE__ << std::endl;
375
+ std::exit (1 );
367
376
}
377
+
378
+ void ggml_sycl_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
379
+ GGML_SYCL_DEBUG (" call %s\n " , __func__);
380
+ ggml_sycl_op_norm (ctx, dst);
381
+ GGML_SYCL_DEBUG (" call %s done\n " , __func__);
382
+ }
383
+
384
+ void ggml_sycl_rms_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
385
+ GGML_SYCL_DEBUG (" call %s\n " , __func__);
386
+ ggml_sycl_op_rms_norm (ctx, dst);
387
+ GGML_SYCL_DEBUG (" call %s done\n " , __func__);
388
+ }
389
+
390
+ void ggml_sycl_group_norm (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
391
+ GGML_SYCL_DEBUG (" call %s\n " , __func__);
392
+ ggml_sycl_op_group_norm (ctx, dst);
393
+ GGML_SYCL_DEBUG (" call %s done\n " , __func__);
394
+ }
0 commit comments