File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Expand file tree Collapse file tree 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) {
3131 }
3232}
3333
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-
4934int get_current_device_id () {
5035 return dpct::dev_mgr::instance ().current_device_id ();
5136}
Original file line number Diff line number Diff line change @@ -374,7 +374,21 @@ void check_allow_gpu_index(const int device_index);
374374device_id: device ID is shown by ggml_backend_sycl_print_sycl_devices().
375375 It is only used to set current working device.
376376*/
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+
378392
379393int get_current_device_id ();
380394
You can’t perform that action at this time.
0 commit comments