use hsa_executable_get_symbol_by_name in find_kernel_by_name (#1994)
Этот коммит содержится в:
@@ -1143,26 +1143,11 @@ inline hsa_status_t remove_agent_global_variables(hsa_executable_t, hsa_agent_t
|
||||
hsa_executable_symbol_t find_kernel_by_name(hsa_executable_t executable, const char* kname,
|
||||
hsa_agent_t* agent = nullptr) {
|
||||
using namespace hip_impl;
|
||||
|
||||
pair<const char*, hsa_executable_symbol_t> r{kname, {}};
|
||||
|
||||
hsa_executable_iterate_agent_symbols(
|
||||
executable, agent ? *agent : this_agent(),
|
||||
[](hsa_executable_t, hsa_agent_t, hsa_executable_symbol_t x, void* s) {
|
||||
auto p = static_cast<pair<const char*, hsa_executable_symbol_t>*>(s);
|
||||
|
||||
if (type(x) != HSA_SYMBOL_KIND_KERNEL) {
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
if (name(x) != p->first) return HSA_STATUS_SUCCESS;
|
||||
|
||||
p->second = x;
|
||||
|
||||
return HSA_STATUS_INFO_BREAK;
|
||||
},
|
||||
&r);
|
||||
|
||||
return r.second;
|
||||
hsa_executable_symbol_t symbol = { 0 };
|
||||
hsa_agent_t thisagent = agent ? *agent : this_agent();
|
||||
hsa_status_t err = hsa_executable_get_symbol_by_name(executable, kname, &thisagent ,&symbol);
|
||||
//TODO check err ?
|
||||
return symbol;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user