Skip to content

Commit

Permalink
Merge pull request #1432 from kiritigowda/kg/gpu-targets
Browse files Browse the repository at this point in the history
GPU Targets - Updates
  • Loading branch information
amd-aakash authored Oct 17, 2024
2 parents fd6ea1a + 903af80 commit 9a88d5f
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,29 @@ endif()
if("${BACKEND}" STREQUAL "HIP")
set(LOOM OFF)
# Set supported GPU Targets
set(DEFAULT_AMDGPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102")
set(DEFAULT_GPU_TARGETS "gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102")
if (BUILD_WITH_AMD_ADVANCE)
set(DEFAULT_AMDGPU_TARGETS ${DEFAULT_AMDGPU_TARGETS} "gfx1200;gfx1201")
set(DEFAULT_GPU_TARGETS ${DEFAULT_GPU_TARGETS} "gfx1200;gfx1201")
endif()

# Set AMDGPU_TARGETS
if(DEFINED ENV{AMDGPU_TARGETS})
set(AMDGPU_TARGETS $ENV{AMDGPU_TARGETS} CACHE STRING "List of specific machine types for library to target")
elseif(AMDGPU_TARGETS)
message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS set with -D option${ColourReset}")
# Set AMD GPU_TARGETS
if((AMDGPU_TARGETS OR DEFINED ENV{AMDGPU_TARGETS}) AND (NOT GPU_TARGETS))
message("-- ${Red}${PROJECT_NAME} DEPRECATION -- AMDGPU_TARGETS use is deprecated. Use GPU_TARGETS${ColourReset}")
if(DEFINED ENV{AMDGPU_TARGETS})
set(GPU_TARGETS $ENV{AMDGPU_TARGETS} CACHE STRING "List of specific machine types for library to target")
else()
set(GPU_TARGETS ${AMDGPU_TARGETS})
endif()
endif()

if(DEFINED ENV{GPU_ARCHS})
set(GPU_TARGETS $ENV{GPU_ARCHS} CACHE STRING "List of specific machine types for library to target")
elseif(GPU_TARGETS)
message("-- ${White}${PROJECT_NAME} -- GPU_TARGETS set with -D option${ColourReset}")
else()
set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
set(GPU_TARGETS "${DEFAULT_GPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")
endif()
message("-- ${White}${PROJECT_NAME} -- AMDGPU_TARGETS: ${AMDGPU_TARGETS}${ColourReset}")
message("-- ${White}${PROJECT_NAME} -- AMD GPU_TARGETS: ${GPU_TARGETS}${ColourReset}")
endif()

message("-- ${Cyan}MIVisionX Developer Options${ColourReset}")
Expand Down

0 comments on commit 9a88d5f

Please sign in to comment.