fix for multiple cards
This commit is contained in:
parent
aeaed61904
commit
a4c8edcb67
2 changed files with 17 additions and 19 deletions
|
@ -307,14 +307,7 @@ void sycl_device_mgr::detect_all_sycl_device_list() try {
|
||||||
int device_count = dpct::dev_mgr::instance().device_count();
|
int device_count = dpct::dev_mgr::instance().device_count();
|
||||||
|
|
||||||
for (int id = 0; id < device_count; id++) {
|
for (int id = 0; id < device_count; id++) {
|
||||||
sycl::device device = dpct::dev_mgr::instance().get_device(id);
|
add_device_info(id);
|
||||||
device_ids.push_back(id);
|
|
||||||
devices.push_back(device);
|
|
||||||
dpct::device_info prop;
|
|
||||||
dpct::get_device_info(prop, device);
|
|
||||||
work_group_sizes.push_back(prop.get_max_work_group_size());
|
|
||||||
max_compute_units.push_back(prop.get_max_compute_units());
|
|
||||||
hw_familys.push_back(get_device_family(&device));
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} catch (sycl::exception const &exc) {
|
} catch (sycl::exception const &exc) {
|
||||||
|
@ -343,13 +336,7 @@ void sycl_device_mgr::detect_sycl_visible_device_list() try {
|
||||||
}
|
}
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
}
|
}
|
||||||
sycl::device device = dpct::dev_mgr::instance().get_device(id);
|
add_device_info(id);
|
||||||
device_ids.push_back(id);
|
|
||||||
devices.push_back(device);
|
|
||||||
dpct::device_info prop;
|
|
||||||
dpct::get_device_info(prop, device);
|
|
||||||
work_group_sizes.push_back(prop.get_max_work_group_size());
|
|
||||||
max_compute_units.push_back(prop.get_max_compute_units());
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} catch (sycl::exception const &exc) {
|
} catch (sycl::exception const &exc) {
|
||||||
|
@ -382,10 +369,7 @@ void sycl_device_mgr::detect_sycl_gpu_list_with_max_cu() try {
|
||||||
dpct::get_device_info(prop, device);
|
dpct::get_device_info(prop, device);
|
||||||
if (local_max_compute_units == prop.get_max_compute_units() &&
|
if (local_max_compute_units == prop.get_max_compute_units() &&
|
||||||
is_ext_oneapi_device(device)) {
|
is_ext_oneapi_device(device)) {
|
||||||
device_ids.push_back(id);
|
add_device_info(id);
|
||||||
devices.push_back(device);
|
|
||||||
work_group_sizes.push_back(prop.get_max_work_group_size());
|
|
||||||
max_compute_units.push_back(prop.get_max_compute_units());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -405,6 +389,18 @@ bool sycl_device_mgr::is_ext_oneapi_device(const sycl::device &dev) {
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sycl_device_mgr::add_device_info(int id) {
|
||||||
|
sycl::device device = dpct::dev_mgr::instance().get_device(id);
|
||||||
|
device_ids.push_back(id);
|
||||||
|
devices.push_back(device);
|
||||||
|
dpct::device_info prop;
|
||||||
|
dpct::get_device_info(prop, device);
|
||||||
|
work_group_sizes.push_back(prop.get_max_work_group_size());
|
||||||
|
max_compute_units.push_back(prop.get_max_compute_units());
|
||||||
|
hw_familys.push_back(get_device_family(&device));
|
||||||
|
}
|
||||||
|
|
||||||
//--sycl_device_mgr--
|
//--sycl_device_mgr--
|
||||||
|
|
||||||
//--ggml_sycl_device_info--
|
//--ggml_sycl_device_info--
|
||||||
|
|
|
@ -183,6 +183,7 @@ inline dpct::err0 ggml_sycl_set_device(const int device_id) try {
|
||||||
std::exit(1);
|
std::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class sycl_device_mgr {
|
class sycl_device_mgr {
|
||||||
public:
|
public:
|
||||||
std::vector<int> device_ids;
|
std::vector<int> device_ids;
|
||||||
|
@ -211,6 +212,7 @@ class sycl_device_mgr {
|
||||||
void detect_sycl_gpu_list_with_max_cu();
|
void detect_sycl_gpu_list_with_max_cu();
|
||||||
int get_device_count();
|
int get_device_count();
|
||||||
bool is_ext_oneapi_device(const sycl::device &dev);
|
bool is_ext_oneapi_device(const sycl::device &dev);
|
||||||
|
void add_device_info(int id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue