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
[ROCm/rocprofiler-register commit: e2db37ca8d]
This commit is contained in:
committed by
GitHub
parent
561bbc92ea
commit
d75ccb9081
@@ -1 +1 @@
|
||||
0.3.0
|
||||
0.4.0
|
||||
|
||||
@@ -54,7 +54,8 @@ if(ROCPROFILER_REGISTER_BUILD_CI AND NOT ROCPROFILER_REGISTER_ENABLE_CLANG_TIDY)
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT ROCM_DEP_ROCMCORE EQUAL ROCPROFILER_REGISTER_DEP_ROCMCORE)
|
||||
if((ROCM_DEP_ROCMCORE AND NOT ROCPROFILER_REGISTER_DEP_ROCMCORE)
|
||||
OR (NOT ROCM_DEP_ROCMCORE AND ROCPROFILER_REGISTER_DEP_ROCMCORE))
|
||||
message(
|
||||
AUTHOR_WARNING
|
||||
"Conflicting option values: ROCM_DEP_ROCMCORE = ${ROCM_DEP_ROCMCORE} and ROCPROFILER_REGISTER_DEP_ROCMCORE = ${ROCPROFILER_REGISTER_DEP_ROCMCORE}"
|
||||
|
||||
+12
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user