Make ROCM_DIR default ROCm path for rocprof

Signed-off-by: zichguan-amd <zichuan.guan@amd.com>


[ROCm/rdc commit: c042b4f582]
This commit is contained in:
zichguan-amd
2024-11-28 10:05:50 -05:00
کامیت شده توسط Guan, Zichuan
والد 3f11f0e76b
کامیت a5227aa61b
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
@@ -83,3 +83,6 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL Release)
TARGET ${RDC_LIB}
POST_BUILD COMMAND ${CMAKE_STRIP} ${RDC_LIB_COMPONENT}.so)
endif()
# pass ROCM_DIR to compiler
target_compile_definitions(${RDC_LIB} PRIVATE ROCM_DIR="${ROCM_DIR}")
@@ -154,7 +154,7 @@ rdc_status_t RdcRocpLib::rdc_telemetry_fields_unwatch(rdc_gpu_field_t* fields,
std::string RdcRocpLib::get_rocm_path() {
// set default rocm path in case lookup fails
std::string rocm_path("/opt/rocm");
std::string rocm_path(ROCM_DIR);
const char* rocm_path_env = getenv("ROCM_PATH");
if (rocm_path_env != nullptr) {
rocm_path = rocm_path_env;