Skip to content

Commit 753e36f

Browse files
AidanBeltonSabhilash1910NeoZhangJianyu
authored
[SYCL] Fix non-intel device selection (#6042)
* Fix non-intel device selection * Update ggml-sycl.cpp Co-authored-by: Neo Zhang Jianyu <[email protected]> * Update ggml-sycl.cpp Co-authored-by: Neo Zhang Jianyu <[email protected]> --------- Co-authored-by: Abhilash Majumder <[email protected]> Co-authored-by: Neo Zhang Jianyu <[email protected]>
1 parent 7ce2c77 commit 753e36f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ggml-sycl.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3451,7 +3451,7 @@ class sycl_gpu_mgr {
34513451
dpct::device_info prop;
34523452
dpct::get_device_info(prop, device);
34533453
if (max_compute_units == prop.get_max_compute_units() &&
3454-
prop.get_major_version() == 1) {
3454+
is_ext_oneapi_device(device)) {
34553455
gpus.push_back(id);
34563456
devices.push_back(device);
34573457
work_group_size = prop.get_max_work_group_size();
@@ -3484,6 +3484,15 @@ class sycl_gpu_mgr {
34843484
assert(false);
34853485
return -1;
34863486
}
3487+
3488+
bool is_ext_oneapi_device(const sycl::device &dev) {
3489+
sycl::backend dev_backend = dev.get_backend();
3490+
if (dev_backend == sycl::backend::ext_oneapi_level_zero ||
3491+
dev_backend == sycl::backend::ext_oneapi_cuda ||
3492+
dev_backend == sycl::backend::ext_oneapi_hip)
3493+
return true;
3494+
return false;
3495+
}
34873496
};
34883497

34893498
static sycl_gpu_mgr *g_sycl_gpu_mgr = NULL;

0 commit comments

Comments
 (0)