diff options
author | AidanBeltonS <87009434+AidanBeltonS@users.noreply.github.com> | 2024-03-15 09:26:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 14:56:20 +0530 |
commit | 753e36f650fa2a5869f89188d9ee745dc74cf14b (patch) | |
tree | 32c825e46dc2a2a02e9e865bc69670b3a75079d3 /ggml-sycl.cpp | |
parent | 7ce2c77f88e1ca66ec48417e56f91746bac018c2 (diff) |
[SYCL] Fix non-intel device selection (#6042)
* Fix non-intel device selection
* Update ggml-sycl.cpp
Co-authored-by: Neo Zhang Jianyu <jianyu.zhang@intel.com>
* Update ggml-sycl.cpp
Co-authored-by: Neo Zhang Jianyu <jianyu.zhang@intel.com>
---------
Co-authored-by: Abhilash Majumder <30946547+abhilash1910@users.noreply.github.com>
Co-authored-by: Neo Zhang Jianyu <jianyu.zhang@intel.com>
Diffstat (limited to 'ggml-sycl.cpp')
-rw-r--r-- | ggml-sycl.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ggml-sycl.cpp b/ggml-sycl.cpp index 9f650638..a1ca6aba 100644 --- a/ggml-sycl.cpp +++ b/ggml-sycl.cpp @@ -3451,7 +3451,7 @@ class sycl_gpu_mgr { dpct::device_info prop; dpct::get_device_info(prop, device); if (max_compute_units == prop.get_max_compute_units() && - prop.get_major_version() == 1) { + is_ext_oneapi_device(device)) { gpus.push_back(id); devices.push_back(device); work_group_size = prop.get_max_work_group_size(); @@ -3484,6 +3484,15 @@ class sycl_gpu_mgr { assert(false); return -1; } + + bool is_ext_oneapi_device(const sycl::device &dev) { + sycl::backend dev_backend = dev.get_backend(); + if (dev_backend == sycl::backend::ext_oneapi_level_zero || + dev_backend == sycl::backend::ext_oneapi_cuda || + dev_backend == sycl::backend::ext_oneapi_hip) + return true; + return false; + } }; static sycl_gpu_mgr *g_sycl_gpu_mgr = NULL; |