Skip to content

Commit

Permalink
[SWDEV-492880] Add ROCm path for hipRTC (#3391)
Browse files Browse the repository at this point in the history
* Add ROCm path for hipRTC

* Update ROCm path handling in BuildHip function and add logs for hipRTC build options

* Fix formatting issue.

* Add ROCM_PATH using  MIOpen Macros

* Update format with Clang script

* Logging HIPRTC compile just for rocm path
with tracing log level

---------

Co-authored-by: Brian Harrison <[email protected]>
Co-authored-by: BrianHarrisonAMD <[email protected]>
Co-authored-by: Chris Erb <[email protected]>
  • Loading branch information
4 people authored Jan 21, 2025
1 parent 7853529 commit ec8ec1d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/comgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_DEBUG_SRAM_EDC_DISABLED)

MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_DEBUG_OPENCL_WAVE64_NOWGP)

/// Base directory of ROCm
MIOPEN_DECLARE_ENV_VAR_STR(ROCM_PATH)

#ifndef MIOPEN_AMD_COMGR_VERSION_MAJOR
#define MIOPEN_AMD_COMGR_VERSION_MAJOR 0
#endif
Expand Down Expand Up @@ -991,6 +994,16 @@ void BuildHip(const std::string& name,
}))
opts.push_back("-std=c++17");

auto rocm_path = env::value(ROCM_PATH);

if(rocm_path.empty())
{
rocm_path = "/opt/rocm";
}
opts.push_back("-I" + rocm_path + "/include");

MIOPEN_LOG_T("HIPRTC compile ROCm path: " << rocm_path);

HiprtcProgram prog(name, text);
prog.Compile(opts);
prog.GetCode(binary);
Expand Down

0 comments on commit ec8ec1d

Please sign in to comment.