Skip to content

Commit

Permalink
Merge pull request #266 from scchan/gfx900_option
Browse files Browse the repository at this point in the history
add gfx900 option, remove gpu code names
  • Loading branch information
whchung authored Mar 16, 2017
2 parents f81fbb1 + 5417b23 commit 810d137
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 46 deletions.
24 changes: 1 addition & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,30 +283,8 @@ foreach(long_form IN LISTS tmp)
list(APPEND HSA_AMDGPU_GPU_TARGET ${short_form})
endforeach()

# Map to LC-consumable name.
foreach(AMDGPU_GPU_TARGET IN LISTS HSA_AMDGPU_GPU_TARGET)
# AMDGPU_TARGET_LIST holds the values which are used by the compiler scripts.
if (AMDGPU_GPU_TARGET STREQUAL "gfx700")
list(APPEND AMDGPU_TARGET_LIST "kaveri")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx701")
list(APPEND AMDGPU_TARGET_LIST "hawaii")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx801")
list(APPEND AMDGPU_TARGET_LIST "carrizo")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx802")
list(APPEND AMDGPU_TARGET_LIST "tonga")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx803")
list(APPEND AMDGPU_TARGET_LIST "fiji")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx900")
list(APPEND AMDGPU_TARGET_LIST "gfx900")
elseif (AMDGPU_GPU_TARGET STREQUAL "gfx901")
list(APPEND AMDGPU_TARGET_LIST "gfx901")
else ()
message(FATAL_ERROR "${AMDGPU_GPU_TARGET} is not a valid AMDPU target!")
endif ()
endforeach(AMDGPU_GPU_TARGET)

# join list
string(REPLACE ";" " " AMDGPU_TARGET "${AMDGPU_TARGET_LIST}")
string(REPLACE ";" " " AMDGPU_TARGET "${HSA_AMDGPU_GPU_TARGET}")
MESSAGE(STATUS "HCC configured with AMDGPU targets: ${AMDGPU_TARGET}")

#################
Expand Down
2 changes: 1 addition & 1 deletion clang
Submodule clang updated from 4ed92a to 17ba13
10 changes: 5 additions & 5 deletions lib/clamp-device.in
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ fi
HCC_EXTRA_ARCH_FILE=""

# select appropriate ROCm-Device-Libs per AMDGPU_TARGET
if [ $AMDGPU_TARGET == "kaveri" ]; then
if [ $AMDGPU_TARGET == "gfx700" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_700.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX700
elif [ $AMDGPU_TARGET == "hawaii" ]; then
elif [ $AMDGPU_TARGET == "gfx701" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_701.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX701
elif [ $AMDGPU_TARGET == "carrizo" ]; then
elif [ $AMDGPU_TARGET == "gfx801" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_801.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX801
elif [ $AMDGPU_TARGET == "tonga" ]; then
elif [ $AMDGPU_TARGET == "gfx802" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_802.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX802
elif [ $AMDGPU_TARGET == "fiji" ]; then
elif [ $AMDGPU_TARGET == "gfx803" ]; then
OCLC_ISA_VERSION_LIB="$ROCM_LIB/oclc_isa_version_803.amdgcn.bc"
HCC_EXTRA_ARCH_FILE=$HCC_EXTRA_LIBRARIES_GFX803
elif [ $AMDGPU_TARGET == "gfx900" ]; then
Expand Down
15 changes: 1 addition & 14 deletions lib/clamp-link.in
Original file line number Diff line number Diff line change
Expand Up @@ -327,23 +327,10 @@ if [ -n "$HCC_AMDGPU_TARGET" ]; then
IFS=','
HCC_AMDGPU_TARGET_TOKENS=($HCC_AMDGPU_TARGET)
unset IFS

# parse individual token, override AMDGPU_TARGET_ARRAY
iter=0
for HCC_AMDGPU_TARGET_TOKEN in ${HCC_AMDGPU_TARGET_TOKENS[@]}; do
# map ISA version string to GPU family
if [ "$HCC_AMDGPU_TARGET_TOKEN" = "gfx701" ]; then
AMDGPU_TARGET_ARRAY[$iter]="hawaii"
elif [ "$HCC_AMDGPU_TARGET_TOKEN" = "gfx801" ]; then
AMDGPU_TARGET_ARRAY[$iter]="carrizo"
elif [ "$HCC_AMDGPU_TARGET_TOKEN" = "gfx802" ]; then
AMDGPU_TARGET_ARRAY[$iter]="tonga"
elif [ "$HCC_AMDGPU_TARGET_TOKEN" = "gfx803" ]; then
AMDGPU_TARGET_ARRAY[$iter]="fiji"
else
# not mappable, simply pass to backend and wish it accepts
AMDGPU_TARGET_ARRAY[$iter]=$HCC_AMDGPU_TARGET
fi
AMDGPU_TARGET_ARRAY[$iter]=$HCC_AMDGPU_TARGET
((iter++))
done
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/benchEmptyKernel/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void explicit_launch_null_kernel(const grid_launch_parm *lp, const Kernel &k)
void time_dispatch_hsa_kernel(std::string testName, const grid_launch_parm *lp, const char *nullkernel_hsaco_dir)
{
std::string nullkernel_hsaco(nullkernel_hsaco_dir);
nullkernel_hsaco += "/nullkernel-fiji.hsaco";
nullkernel_hsaco += "/nullkernel-gfx803.hsaco";
Kernel k = load_hsaco(lp->av, nullkernel_hsaco.c_str(), KERNEL_NAME);
std::chrono::time_point<std::chrono::high_resolution_clock> start, end;

Expand Down
4 changes: 2 additions & 2 deletions tests/benchEmptyKernel/nullkernel.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %hc --amdgpu-target=gfx701 --amdgpu-target=gfx801 --amdgpu-target=gfx802 --amdgpu-target=gfx803 -fPIC -Wl,-Bsymbolic -shared %S/nullkernel.cpp -o %T/nullkernel
// RUN: %extractkernel -i %T/nullkernel
// RUN: %hc --amdgpu-target=gfx801 --amdgpu-target=gfx802 --amdgpu-target=gfx803 -fPIC -Wl,-Bsymbolic -shared %S/nullkernel.cpp -o %T/nullkernel
// RUN: HCC_HOME=%llvm_libs_dir/../../ %extractkernel -i %T/nullkernel

#include "hc.hpp"
#include "grid_launch.hpp"
Expand Down

0 comments on commit 810d137

Please sign in to comment.