@@ -47,7 +47,7 @@ static ggml_sycl_device_info ggml_sycl_init() {
4747
4848 info.device_count = dpct::dev_mgr::instance ().device_count ();
4949 if (info.device_count == 0 ) {
50- GGML_LOG_ERROR (" %s: failed to initialize " GGML_SYCL_NAME " : %s\n " , __func__);
50+ GGML_LOG_ERROR (" %s: failed to initialize: %s\n " , GGML_SYCL_NAME , __func__);
5151 return info;
5252 }
5353
@@ -64,7 +64,7 @@ static ggml_sycl_device_info ggml_sycl_init() {
6464#else
6565 GGML_LOG_INFO (" %s: SYCL_USE_XMX: no\n " , __func__);
6666#endif
67- GGML_LOG_INFO (" %s: found %d " GGML_SYCL_NAME " devices:\n " , __func__, info.device_count );
67+ GGML_LOG_INFO (" %s: found %d %s devices:\n " , __func__, info.device_count , GGML_SYCL_NAME );
6868
6969 for (int i = 0 ; i < info.device_count ; ++i) {
7070 info.devices [i].vmm = 0 ;
@@ -137,7 +137,8 @@ void ggml_backend_sycl_print_sycl_devices() {
137137
138138 for (int id = 0 ; id < device_count; ++id) {
139139 sycl::device device = dpct::dev_mgr::instance ().get_device (id);
140- sycl::backend backend = device.get_backend ();
140+ // TODO: backend variable is unused here!
141+ // sycl::backend backend = device.get_backend();
141142 std::string backend_type = get_device_backend_and_type (device);
142143 int type_id = DeviceNums[backend_type]++;
143144 std::stringstream device_type;
@@ -420,13 +421,12 @@ ggml_backend_sycl_buffer_cpy_tensor(ggml_backend_buffer_t buffer,
420421 return true ;
421422 }
422423 return false ;
424+ // TODO: Buffer is unused
425+ (void ) buffer;
426+ } catch (const sycl::exception & exc) {
427+ std::cerr << exc.what () << " Exception caught at file:" << __FILE__ << " , line:" << __LINE__ << std::endl;
428+ std::exit (1 );
423429}
424- catch (sycl::exception const &exc) {
425- std::cerr << exc.what () << " Exception caught at file:" << __FILE__
426- << " , line:" << __LINE__ << std::endl;
427- std::exit (1 );
428- }
429-
430430
431431static void ggml_backend_sycl_buffer_clear (ggml_backend_buffer_t buffer,
432432 uint8_t value) try {
@@ -1092,10 +1092,7 @@ struct ggml_sycl_pool_leg : public ggml_sycl_pool {
10921092 ggml_sycl_buffer buffer_pool[MAX_SYCL_BUFFERS] = {};
10931093 size_t pool_size = 0 ;
10941094
1095- explicit ggml_sycl_pool_leg (queue_ptr qptr_, int device_) :
1096- qptr(qptr_),
1097- device(device_) {
1098- }
1095+ explicit ggml_sycl_pool_leg (queue_ptr qptr_, int device_) : device(device_), qptr(qptr_) {}
10991096
11001097 ~ggml_sycl_pool_leg () {
11011098 for (int i = 0 ; i < MAX_SYCL_BUFFERS; ++i) {
@@ -1238,7 +1235,7 @@ static void quantize_q8_1(const float * __restrict__ x, void * __restrict__ vy,
12381235 zeros[i] = 0 .f ;
12391236 qzeros[i] = 0 ;
12401237 }
1241- const TC xi = ix < kx ? *(TC *)&x[iy * kx + ix] : zeros;
1238+ const TC xi = ix < kx ? *(const TC *)&x[iy * kx + ix] : zeros;
12421239 float sum = xi[0 ];
12431240 float amax = sycl::fabs (xi[0 ]);
12441241#pragma unroll
@@ -1799,6 +1796,8 @@ static void pool2d_nchw_kernel(
17991796 switch (op) {
18001797 case GGML_OP_POOL_AVG: res = 0 ; break ;
18011798 case GGML_OP_POOL_MAX: res = -FLT_MAX; break ;
1799+ default :
1800+ break ; // TODO: handle this properly
18021801 }
18031802
18041803 for (int i = bh; i < eh; i += 1 ) {
@@ -1817,6 +1816,8 @@ static void pool2d_nchw_kernel(
18171816 switch (op) {
18181817 case GGML_OP_POOL_AVG: res += (cur / (kh * kw)); break ;
18191818 case GGML_OP_POOL_MAX: res = sycl::max (res, (To)cur); break ;
1819+ default :
1820+ break ; // TODO: handle this properly
18201821 }
18211822 }
18221823 }
@@ -1856,6 +1857,7 @@ static void get_rows_sycl(ggml_backend_sycl_context & ctx, const ggml_tensor *sr
18561857 });
18571858
18581859 (void ) dst;
1860+ (void ) ctx;
18591861}
18601862
18611863template <typename src0_t >
@@ -1894,9 +1896,9 @@ static void get_rows_sycl_float(ggml_backend_sycl_context & ctx, const ggml_tens
18941896 }
18951897
18961898 (void ) dst;
1899+ (void ) ctx;
18971900}
18981901
1899-
19001902static void quantize_row_q8_1_sycl (const float *x, void *vy, const int kx,
19011903 const int ky, const int kx_padded,
19021904 queue_ptr stream) {
@@ -2484,17 +2486,19 @@ inline void ggml_sycl_op_mul_mat_sycl(
24842486 const int64_t ne00 = src0->ne [0 ];
24852487 const int64_t ne10 = src1->ne [0 ];
24862488
2487- const int64_t ne0 = dst-> ne [ 0 ];
2489+
24882490
24892491 const int64_t row_diff = row_high - row_low;
24902492
24912493 int id;
24922494 SYCL_CHECK (
24932495 CHECK_TRY_ERROR (id = get_current_device_id ()));
2494-
2496+ #if !GGML_SYCL_DNNL
2497+ const int64_t ne0 = dst->ne [0 ];
24952498 // the main device has a larger memory buffer to hold the results from all GPUs
24962499 // ldc == nrows of the matrix that cuBLAS writes into
24972500 int ldc = id == ctx.device ? ne0 : row_diff;
2501+ #endif
24982502
24992503#ifdef GGML_SYCL_F16
25002504 bool use_fp16 = true ; // TODO(Yu) SYCL capability check
@@ -2531,9 +2535,9 @@ inline void ggml_sycl_op_mul_mat_sycl(
25312535 : src1_as_f16.get ();
25322536 ggml_sycl_pool_alloc<sycl::half> dst_f16 (ctx.pool (), row_diff * src1_ncols);
25332537
2534- const sycl::half alpha_f16 = 1 .0f ;
2535- const sycl::half beta_f16 = 0 .0f ;
25362538#if !GGML_SYCL_DNNL
2539+ const sycl::half alpha_f16 = 1 .0f ;
2540+ const sycl::half beta_f16 = 0 .0f ;
25372541 SYCL_CHECK (CHECK_TRY_ERROR (dpct::gemm (
25382542 *stream, oneapi::mkl::transpose::trans,
25392543 oneapi::mkl::transpose::nontrans, row_diff, src1_ncols, ne10,
@@ -2570,9 +2574,9 @@ inline void ggml_sycl_op_mul_mat_sycl(
25702574 const float * src0_ddf_i = src0->type == GGML_TYPE_F32 ? (const float *) src0_dd_i : src0_ddq_as_f32.get ();
25712575 const float * src1_ddf1_i = src1->type == GGML_TYPE_F32 ? (const float *) src1_ddf_i : src1_ddq_as_f32.get ();
25722576
2573- const float alpha = 1 .0f ;
2574- const float beta = 0 .0f ;
25752577#if !GGML_SYCL_DNNL
2578+ const float alpha = 1 .0f ;
2579+ const float beta = 0 .0f ;
25762580# ifdef GGML_SYCL_NVIDIA
25772581 SYCL_CHECK (CHECK_TRY_ERROR (oneapi::mkl::blas::column_major::gemm (
25782582 oneapi::mkl::backend_selector<oneapi::mkl::backend::cublas>{ *stream }, oneapi::mkl::transpose::trans,
@@ -2870,7 +2874,8 @@ static void ggml_sycl_op_mul_mat(ggml_backend_sycl_context & ctx, const ggml_ten
28702874
28712875 ggml_tensor_extra_gpu * src0_extra = (ggml_tensor_extra_gpu *) src0->extra ;
28722876 ggml_tensor_extra_gpu * src1_extra = (ggml_tensor_extra_gpu *) src1->extra ;
2873- ggml_tensor_extra_gpu * dst_extra = (ggml_tensor_extra_gpu *) dst->extra ;
2877+ // TODO: What's the use of this?
2878+ // ggml_tensor_extra_gpu * dst_extra = (ggml_tensor_extra_gpu *) dst->extra;
28742879
28752880 const bool src0_is_contiguous = ggml_is_contiguous (src0);
28762881 const bool src1_is_contiguous = ggml_is_contiguous (src1);
@@ -3296,8 +3301,8 @@ static void ggml_sycl_mul_mat_batched_sycl(ggml_backend_sycl_context & ctx,
32963301 GGML_ASSERT (src0->type == GGML_TYPE_F16);
32973302
32983303 GGML_TENSOR_BINARY_OP_LOCALS
3299-
3300- const int64_t ne_dst = ggml_nelements (dst);
3304+ // TODO: What's the use of this?
3305+ // const int64_t ne_dst = ggml_nelements(dst);
33013306
33023307 SYCL_CHECK (ggml_sycl_set_device (ctx.device ));
33033308 queue_ptr main_stream = ctx.stream ();;
@@ -3405,6 +3410,7 @@ catch (sycl::exception const &exc) {
34053410
34063411inline bool ggml_sycl_supports_mmq (enum ggml_type type) {
34073412 // TODO: accuracy issues in MMQ
3413+ (void ) type;
34083414 return false ;
34093415}
34103416
@@ -3836,13 +3842,17 @@ static void ggml_sycl_argmax(ggml_backend_sycl_context & ctx, const ggml_tensor
38363842}
38373843
38383844static void ggml_sycl_nop (ggml_backend_sycl_context & ctx, const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst) {
3845+ // TODO: Why this function even exists?
38393846 (void ) src0;
38403847 (void ) src1;
38413848 (void ) dst;
3849+ (void ) ctx;
38423850}
38433851
38443852void ggml_sycl_set_main_device (const int main_device) try {
3845- if (dpct::get_current_device_id () == main_device) return ;
3853+ if (dpct::get_current_device_id () == static_cast <unsigned int > (main_device)) {
3854+ return ;
3855+ }
38463856 check_allow_gpu_index (main_device);
38473857 dpct::select_device (main_device);
38483858
@@ -4210,6 +4220,7 @@ try
42104220{
42114221 ggml_backend_sycl_context *sycl_ctx =
42124222 (ggml_backend_sycl_context *)backend->context ;
4223+
42134224 sycl::event *sycl_event = static_cast <sycl::event *>(event->context );
42144225
42154226 const queue_ptr &stream = sycl_ctx->stream (sycl_ctx->device , 0 );
@@ -4224,7 +4235,8 @@ catch (sycl::exception const &exc)
42244235}
42254236
42264237static void ggml_backend_sycl_event_wait (ggml_backend_t backend, ggml_backend_event_t event) try {
4227- ggml_backend_sycl_context* sycl_ctx = static_cast <ggml_backend_sycl_context*>(backend->context );
4238+ // TODO: sycl_ctx is unused here
4239+ // ggml_backend_sycl_context* sycl_ctx = static_cast<ggml_backend_sycl_context*>(backend->context);
42284240 sycl::event* sycl_event = static_cast <sycl::event*>(event->context );
42294241
42304242 if (ggml_backend_is_sycl (backend)) {
@@ -4632,6 +4644,8 @@ static void *ggml_backend_sycl_reg_get_proc_address(ggml_backend_reg_t reg, cons
46324644 // SYCL doesn't support registering host memory, left here for reference
46334645 // "ggml_backend_register_host_buffer"
46344646 // "ggml_backend_unregister_host_buffer"
4647+ // doing this to make the compiler happy
4648+ (void ) name;
46354649 return nullptr ;
46364650}
46374651
0 commit comments