Skip to content

Commit

Permalink
[COMgr] Prepare for COMgr 3.x (#3107)
Browse files Browse the repository at this point in the history
* amdcomgr-3(01) [cmake] Do not allow different values of MIOPEN_USE_COMGR and MIOPEN_USE_HIPRTC. Remove leftover of support of ROCm older than 5.0.

* amdcomgr-3(02) [importance_normal] Fix precompiled binary cache miss for Winograd Fury. Resolves #2778 (comment)

* amdcomgr-3(03) [winograd fury] Add comment.

* amdcomgr-3(04) [comgr] Removed comgr::BuildHip()

* amdcomgr-3(05) [comgr] Added support for AMD COMgr 3.0. Removed support for AMD COMgr older than 1.7.

* amdcomgr-3(06) [comgr] Removed support of unused enum members from to_string().

* amdcomgr-3(08) [comgr] Fix tidy error

---------

Co-authored-by: Evgenii Averin <[email protected]>
  • Loading branch information
atamazov and averinevg authored Jul 22, 2024
1 parent f972ecc commit 36ab779
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 337 deletions.
20 changes: 19 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ macro(set_var_to_condition var)
endif()
endmacro()

macro(set_if_bools_are_different var in1 in2)
set(${var} FALSE)
if(${in1})
if(NOT ${in2})
set(${var} TRUE)
endif()
else()
if(${in2})
set(${var} TRUE)
endif()
endif()
endmacro()

get_property(MIOPEN_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

# This has to be initialized before the project() command appears
Expand Down Expand Up @@ -252,9 +265,14 @@ set(MIOPEN_hip_VERSION ${MIOPEN_hip_VERSION_MAJOR}.${MIOPEN_hip_VERSION_MINOR}.$

# Do not enable HIPRTC by default for older ROCm versions in order to avoid
# build time errors, because HIPRTC is a relatively new component.
set_var_to_condition(MIOPEN_USE_HIPRTC_DEFAULT (MIOPEN_USE_COMGR AND (MIOPEN_hip_VERSION VERSION_GREATER_EQUAL 5)))
set_var_to_condition(MIOPEN_USE_HIPRTC_DEFAULT MIOPEN_USE_COMGR)
option(MIOPEN_USE_HIPRTC "Use HIPRTC to build HIP kernels instead of COMGR" ${MIOPEN_USE_HIPRTC_DEFAULT})

set_if_bools_are_different(MIOPEN_CONFIGURATION_ERROR_COMGR_HIPRTC MIOPEN_USE_COMGR MIOPEN_USE_HIPRTC)
if(MIOPEN_CONFIGURATION_ERROR_COMGR_HIPRTC)
message(FATAL_ERROR "MIOPEN_USE_COMGR (${MIOPEN_USE_COMGR}) and MIOPEN_USE_HIPRTC (${MIOPEN_USE_HIPRTC}) should be set to the same value")
endif()

# Do not append system include directories to HIP compiler flags when HIPRTC is used
set_var_to_condition(MIOPEN_HIP_COMPILER_USE_SYSTEM_INCLUDE_DIRECTORIES_DEFAULT
(NOT (MIOPEN_USE_HIPRTC AND (MIOPEN_hip_VERSION VERSION_GREATER_EQUAL 6.1.40091))))
Expand Down
Loading

0 comments on commit 36ab779

Please sign in to comment.