wsl/libhsakmt: set default node
Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Tianci Yin <tianci.yin@amd.com> Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/82>
This commit is contained in:
@@ -116,6 +116,14 @@ static HSAKMT_STATUS init_vars_from_env(void) {
|
||||
if (envvar)
|
||||
dxg_runtime->enable_thunk_sub_allocator = atoi(envvar);
|
||||
|
||||
envvar = getenv("ROCR_VISIBLE_DEVICES");
|
||||
if (envvar) {
|
||||
std::string devices(envvar);
|
||||
size_t first_num_pos = devices.find_first_of("0123456789");
|
||||
if (first_num_pos != std::string::npos)
|
||||
dxg_runtime->default_node = std::stoi(devices.substr(first_num_pos)) + 1;
|
||||
}
|
||||
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user