File tree 2 files changed +15
-16
lines changed
2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -31,21 +31,6 @@ void check_allow_gpu_index(const int device_index) {
31
31
}
32
32
}
33
33
34
- void check_allow_gpu_id (const int device_id) {
35
- if (!g_sycl_gpu_mgr->is_allowed_gpu (device_id)) {
36
- char error_buf[256 ];
37
- snprintf (
38
- error_buf,
39
- sizeof (error_buf),
40
- " error: cannot set device=%d, which is not allowed. Please "
41
- " set GPU ID in: [%s]" ,
42
- device_id,
43
- g_sycl_gpu_mgr->gpus_list .c_str ());
44
- fprintf (stderr, " %s\n " , error_buf);
45
- throw std::invalid_argument (error_buf);
46
- }
47
- }
48
-
49
34
int get_current_device_id () {
50
35
return dpct::dev_mgr::instance ().current_device_id ();
51
36
}
Original file line number Diff line number Diff line change @@ -374,7 +374,21 @@ void check_allow_gpu_index(const int device_index);
374
374
device_id: device ID is shown by ggml_backend_sycl_print_sycl_devices().
375
375
It is only used to set current working device.
376
376
*/
377
- void check_allow_gpu_id (const int device_id);
377
+ inline void check_allow_gpu_id (const int device_id) {
378
+ if (!g_sycl_gpu_mgr->is_allowed_gpu (device_id)) {
379
+ char error_buf[256 ];
380
+ snprintf (
381
+ error_buf,
382
+ sizeof (error_buf),
383
+ " error: cannot set device=%d, which is not allowed. Please "
384
+ " set GPU ID in: [%s]" ,
385
+ device_id,
386
+ g_sycl_gpu_mgr->gpus_list .c_str ());
387
+ fprintf (stderr, " %s\n " , error_buf);
388
+ throw std::invalid_argument (error_buf);
389
+ }
390
+ }
391
+
378
392
379
393
int get_current_device_id ();
380
394
You can’t perform that action at this time.
0 commit comments