@@ -514,6 +514,7 @@ inline void ggml_sycl_op_silu(ggml_backend_sycl_context & ctx, ggml_tensor * dst
514
514
GGML_ASSERT (dst->type == GGML_TYPE_F32);
515
515
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
516
516
const dpct::queue_ptr main_stream = ctx.stream ();
517
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
517
518
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
518
519
float * dst_dd = static_cast <float *>(dst->data );
519
520
@@ -526,6 +527,7 @@ inline void ggml_sycl_op_gelu(ggml_backend_sycl_context & ctx, ggml_tensor * dst
526
527
GGML_ASSERT (dst->type == GGML_TYPE_F32);
527
528
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
528
529
const dpct::queue_ptr main_stream = ctx.stream ();
530
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
529
531
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
530
532
float * dst_dd = static_cast <float *>(dst->data );
531
533
@@ -538,6 +540,7 @@ inline void ggml_sycl_op_gelu_quick(ggml_backend_sycl_context & ctx, ggml_tensor
538
540
GGML_ASSERT (dst->type == GGML_TYPE_F32);
539
541
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
540
542
const dpct::queue_ptr main_stream = ctx.stream ();
543
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
541
544
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
542
545
float * dst_dd = static_cast <float *>(dst->data );
543
546
@@ -551,6 +554,7 @@ inline void ggml_sycl_op_tanh(ggml_backend_sycl_context & ctx, ggml_tensor *dst)
551
554
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
552
555
553
556
const dpct::queue_ptr main_stream = ctx.stream ();
557
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
554
558
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
555
559
float * dst_dd = static_cast <float *>(dst->data );
556
560
tanh_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
@@ -562,6 +566,7 @@ inline void ggml_sycl_op_relu(ggml_backend_sycl_context & ctx, ggml_tensor *dst)
562
566
GGML_ASSERT (dst->type == GGML_TYPE_F32);
563
567
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
564
568
const dpct::queue_ptr main_stream = ctx.stream ();
569
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
565
570
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
566
571
float * dst_dd = static_cast <float *>(dst->data );
567
572
relu_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
@@ -573,6 +578,7 @@ inline void ggml_sycl_op_hardsigmoid(ggml_backend_sycl_context & ctx, ggml_tenso
573
578
GGML_ASSERT (dst->type == GGML_TYPE_F32);
574
579
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
575
580
const dpct::queue_ptr main_stream = ctx.stream ();
581
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
576
582
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
577
583
float * dst_dd = static_cast <float *>(dst->data );
578
584
hardsigmoid_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
@@ -585,6 +591,7 @@ inline void ggml_sycl_op_hardswish(ggml_backend_sycl_context & ctx, ggml_tensor
585
591
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
586
592
587
593
const dpct::queue_ptr main_stream = ctx.stream ();
594
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
588
595
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
589
596
float * dst_dd = static_cast <float *>(dst->data );
590
597
@@ -597,6 +604,7 @@ inline void ggml_sycl_op_exp(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
597
604
GGML_ASSERT (dst->type == GGML_TYPE_F32);
598
605
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
599
606
const dpct::queue_ptr main_stream = ctx.stream ();
607
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
600
608
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
601
609
float * dst_dd = static_cast <float *>(dst->data );
602
610
exp_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
@@ -608,6 +616,7 @@ inline void ggml_sycl_op_log(ggml_backend_sycl_context & ctx, ggml_tensor *dst)
608
616
GGML_ASSERT ( dst->type == GGML_TYPE_F32);
609
617
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
610
618
const dpct::queue_ptr main_stream = ctx.stream ();
619
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
611
620
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
612
621
float * dst_dd = static_cast <float *>(dst->data );
613
622
@@ -620,6 +629,7 @@ inline void ggml_sycl_op_sigmoid(ggml_backend_sycl_context & ctx, ggml_tensor *d
620
629
GGML_ASSERT (dst->type == GGML_TYPE_F32);
621
630
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
622
631
const dpct::queue_ptr main_stream = ctx.stream ();
632
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
623
633
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
624
634
float * dst_dd = static_cast <float *>(dst->data );
625
635
@@ -632,6 +642,7 @@ inline void ggml_sycl_op_sqrt(ggml_backend_sycl_context & ctx, ggml_tensor * dst
632
642
GGML_ASSERT (dst->type == GGML_TYPE_F32);
633
643
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
634
644
const dpct::queue_ptr main_stream = ctx.stream ();
645
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
635
646
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
636
647
float * dst_dd = static_cast <float *>(dst->data );
637
648
sqrt_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
@@ -643,6 +654,7 @@ inline void ggml_sycl_op_sin(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
643
654
GGML_ASSERT (dst->type == GGML_TYPE_F32);
644
655
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
645
656
const dpct::queue_ptr main_stream = ctx.stream ();
657
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
646
658
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
647
659
float * dst_dd = static_cast <float *>(dst->data );
648
660
@@ -655,6 +667,7 @@ inline void ggml_sycl_op_cos(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
655
667
GGML_ASSERT (dst->type == GGML_TYPE_F32);
656
668
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
657
669
const dpct::queue_ptr main_stream = ctx.stream ();
670
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
658
671
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
659
672
float * dst_dd = static_cast <float *>(dst->data );
660
673
@@ -669,6 +682,7 @@ inline void ggml_sycl_op_step(ggml_backend_sycl_context & ctx, ggml_tensor *dst)
669
682
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
670
683
float * dst_dd = static_cast <float *>(dst->data );
671
684
dpct::queue_ptr main_stream = ctx.stream ();
685
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
672
686
673
687
step_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
674
688
}
@@ -681,6 +695,7 @@ inline void ggml_sycl_op_neg(ggml_backend_sycl_context & ctx, ggml_tensor *dst)
681
695
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
682
696
float * dst_dd = static_cast <float *>(dst->data );
683
697
dpct::queue_ptr main_stream = ctx.stream ();
698
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
684
699
685
700
neg_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
686
701
}
@@ -697,6 +712,7 @@ inline void ggml_sycl_op_leaky_relu(ggml_backend_sycl_context & ctx, ggml_tensor
697
712
float * dst_dd = static_cast <float *>(dst->data );
698
713
699
714
dpct::queue_ptr main_stream = ctx.stream ();
715
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
700
716
701
717
leaky_relu_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), negative_slope, main_stream);
702
718
}
@@ -709,6 +725,7 @@ inline void ggml_sycl_op_sqr(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
709
725
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
710
726
float * dst_dd = static_cast <float *>(dst->data );
711
727
dpct::queue_ptr main_stream = ctx.stream ();
728
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
712
729
713
730
sqr_f32_sycl (src0_dd, dst_dd, ggml_nelements (dst->src [0 ]), main_stream);
714
731
}
@@ -727,6 +744,7 @@ inline void ggml_sycl_op_upscale(ggml_backend_sycl_context & ctx, ggml_tensor *
727
744
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
728
745
float * dst_dd = static_cast <float *>(dst->data );
729
746
dpct::queue_ptr main_stream = ctx.stream ();
747
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
730
748
731
749
upscale_f32_sycl (src0_dd, dst_dd, dst->src [0 ]->nb [0 ], dst->src [0 ]->nb [1 ], dst->src [0 ]->nb [2 ], dst->src [0 ]->nb [3 ],
732
750
dst->ne [0 ], dst->ne [1 ], dst->ne [2 ], dst->ne [3 ], sf0, sf1, sf2, sf3,
@@ -743,6 +761,7 @@ inline void ggml_sycl_op_pad(ggml_backend_sycl_context & ctx, ggml_tensor * dst)
743
761
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
744
762
float * dst_dd = static_cast <float *>(dst->data );
745
763
dpct::queue_ptr main_stream = ctx.stream ();
764
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
746
765
747
766
pad_f32_sycl (src0_dd, dst_dd,
748
767
dst->src [0 ]->ne [0 ], dst->src [0 ]->ne [1 ], dst->src [0 ]->ne [2 ],
@@ -760,6 +779,7 @@ inline void ggml_sycl_op_acc(ggml_backend_sycl_context & ctx,
760
779
GGML_ASSERT (strcmp (dst->buffer ->buft ->iface .get_name (dst->buffer ->buft ), GGML_SYCL_NAME " _Split" ) != 0 );
761
780
762
781
const dpct::queue_ptr main_stream = ctx.stream ();
782
+ SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
763
783
const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
764
784
const float * src1_dd = static_cast <const float *>(dst->src [1 ]->data );
765
785
float * dst_dd = static_cast <float *>(dst->data );
0 commit comments