Search for rocprofiler_set_api_table(...) via RTLD_DEFAULT (#56)

* Search for rocprofiler_set_api_table(...) via RTLD_DEFAULT

- check if rocprofiler_set_api_table function has already been loaded via dlsym(RTLD_DEFAULT, ...)
- fix warning about conflicting ROCM_DEP_ROCMCORE and ROCPROFILER_REGISTER_DEP_ROCMCORE

* Bump version to 0.4.0
Dieser Commit ist enthalten in:
Jonathan R. Madsen verfasst und GitHub committed 2024-02-25 21:14:27 -06:00
1 Ursprung 1f0d06b6cb
Commit e2db37ca8d
3 Dateien geändert
+15 -2

Keine Dateien entsprechen Ihrer Suche

@@ -273,6 +273,18 @@ rocp_load_rocprofiler_lib(std::string _rocp_reg_lib)
if(rocprofiler_set_api_table) rocprofiler_lib_config_fn = &rocprofiler_set_api_table;
// return if found via LD_PRELOAD
if(rocprofiler_lib_config_fn)
return std::make_tuple(rocprofiler_lib_handle, rocprofiler_lib_config_fn);
// look to see if entrypoint function is already a symbol
*(void**) (&rocprofiler_lib_config_fn) =
dlsym(RTLD_DEFAULT, rocprofiler_lib_register_entrypoint);
// return if found via RTLD_DEFAULT
if(rocprofiler_lib_config_fn)
return std::make_tuple(rocprofiler_lib_handle, rocprofiler_lib_config_fn);
if(_rocp_reg_lib.empty()) _rocp_reg_lib = rocprofiler_lib_name;
auto _rocp_reg_lib_path = fs::path{ _rocp_reg_lib };