Skip to content

Commit

Permalink
Add GFX908 specific HCC changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronenyeshi authored and scchan committed Jul 17, 2019
1 parent bbb7d7d commit 46b589f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ set(HSA_AMDGPU_GPU_TARGET "auto" CACHE STRING "Target AMDGPU ISA version")

# Temporary workaround for use of old long-form GFX_ip names, to be removed once
# we fully deprecate them.
string(REGEX MATCHALL "AMD:AMDGPU:(7:0:0|7:0:1|8:0:1|8:0:2|8:0:3|9:0:0|9:0:1|9:0:6)"
string(REGEX MATCHALL "AMD:AMDGPU:(7:0:0|7:0:1|8:0:1|8:0:2|8:0:3|9:0:0|9:0:1|9:0:6|9:0:8)"
tmp
${HSA_AMDGPU_GPU_TARGET})
foreach(long_form IN LISTS tmp)
Expand Down Expand Up @@ -427,6 +427,7 @@ if (HCC_INTEGRATE_ROCDL)
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_isa_version_901.amdgcn.bc oclc_isa_version_901.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_isa_version_804.amdgcn.bc oclc_isa_version_804.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_isa_version_906.amdgcn.bc oclc_isa_version_906.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_isa_version_908.amdgcn.bc oclc_isa_version_908.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../ocml/ocml.amdgcn.bc ocml.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_wavefrontsize64_on.amdgcn.bc oclc_wavefrontsize64_on.amdgcn.bc
COMMAND ${CMAKE_COMMAND} -E create_symlink ../oclc/oclc_wavefrontsize64_off.amdgcn.bc oclc_wavefrontsize64_off.amdgcn.bc
Expand Down
4 changes: 2 additions & 2 deletions cmake-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ add_executable(cmake-test cmake-test.cpp)
# without a GPU
get_target_property(cmake_test_link_flags cmake-test LINK_FLAGS)
if (cmake_test_link_flags)
set(new_cmake_test_link_flags "${cmake_test_link_flags} --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906")
set(new_cmake_test_link_flags "${cmake_test_link_flags} --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906 --amdgpu-target=gfx908")
else()
set(new_cmake_test_link_flags "--amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906")
set(new_cmake_test_link_flags "--amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906 --amdgpu-target=gfx908")
endif()
set_target_properties(cmake-test PROPERTIES LINK_FLAGS ${new_cmake_test_link_flags})

Expand Down
4 changes: 2 additions & 2 deletions hc2/external/elfio/elfio_amdgpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ enum : unsigned {
EF_AMDGPU_MACH_AMDGCN_GFX902 = 0x02d,
EF_AMDGPU_MACH_AMDGCN_GFX904 = 0x02e,
EF_AMDGPU_MACH_AMDGCN_GFX906 = 0x02f,
EF_AMDGPU_MACH_AMDGCN_GFX908 = 0x030,

// Reserved for AMDGCN-based processors.
EF_AMDGPU_MACH_AMDGCN_RESERVED0 = 0x027,
EF_AMDGPU_MACH_AMDGCN_RESERVED1 = 0x030,

// First/last AMDGCN-based processors.
EF_AMDGPU_MACH_AMDGCN_FIRST = EF_AMDGPU_MACH_AMDGCN_GFX600,
EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX906,
EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX908,

// Indicates if the xnack target feature is enabled for all code contained in
// the object.
Expand Down
4 changes: 4 additions & 0 deletions lib/clamp-device.in
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ elif [ $AMDGPU_TARGET == "gfx906" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_906.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX906
KMOPTLLC+=" -mattr=+sram-ecc"
elif [ $AMDGPU_TARGET == "gfx908" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_908.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX908
KMOPTLLC+=" -mattr=+sram-ecc"
fi
HCC_BC_LIBS="$ROCM_LIB/hc.amdgcn.bc $ROCM_LIB/hip.amdgcn.bc $ROCM_LIB/opencl.amdgcn.bc $ROCM_LIB/ocml.amdgcn.bc $ROCM_LIB/ockl.amdgcn.bc $OCLC_ISA_VERSION_LIB $ROCM_LIB/oclc_finite_only_off.amdgcn.bc $ROCM_LIB/oclc_daz_opt_off.amdgcn.bc $ROCM_LIB/oclc_correctly_rounded_sqrt_on.amdgcn.bc $ROCM_LIB/oclc_unsafe_math_off.amdgcn.bc"

Expand Down
1 change: 1 addition & 0 deletions lib/hsa/mcwamp_hsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,7 @@ class HSADevice final : public KalmarDevice
case hc::EF_AMDGPU_MACH_AMDGCN_GFX803 : triple.append("803"); break;
case hc::EF_AMDGPU_MACH_AMDGCN_GFX900 : triple.append("900"); break;
case hc::EF_AMDGPU_MACH_AMDGCN_GFX906 : triple.append("906"); break;
case hc::EF_AMDGPU_MACH_AMDGCN_GFX908 : triple.append("908"); break;
}

const auto isa{get_isa_name_from_triple(std::move(triple))};
Expand Down
2 changes: 1 addition & 1 deletion tests/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ config.substitutions.append( ('%cppfilt', 'c++filt -n') )
config.substitutions.append( ('%embed_kernel', os.path.join(config.mcwamp_tool_dir, "clamp-embed") ) )
config.substitutions.append( ('%extractkernel', os.path.join(config.executable_output_path,'extractkernel') ) )
config.substitutions.append( ('%not', os.path.join(config.llvm_tools_dir, 'not') ) )
config.substitutions.append( ('%target_all_gpus', "--amdgpu-target=gfx701 --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906") )
config.substitutions.append( ('%target_all_gpus', "--amdgpu-target=gfx701 --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906 --amdgpu-target=gfx908") )
config.substitutions.append( ('%lib_output_path', config.library_output_path ) )

0 comments on commit 46b589f

Please sign in to comment.