Skip to content

Commit

Permalink
SWDEV-380238 - hipcc passes incorrect device lib path to clang on win…
Browse files Browse the repository at this point in the history
…dows (#3150)

hipcc should not pass --hip-device-lib-path to clang by default so that clang
decicde device lib path by itself.

hipcc only passes --hip-device-lib-path to clang if env var DEVICE_LIB_PATH
is specified.

DEVICE_LIB_PATH should be depricated in the future and users should use
--hip-device-lib-path instead.

Change-Id: I1ada35fb438643cbe68da777e3881aaa935162fa
  • Loading branch information
rocm-ci committed Feb 1, 2023
1 parent 436ba97 commit e18cbe6
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions bin/hipcc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,10 @@ BEGIN
$HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;

if ($HIP_PLATFORM eq "amd") {
# If using ROCclr runtime, need to find HIP_ROCCLR_HOME
if (!defined $DEVICE_LIB_PATH and -e "$HIP_ROCCLR_HOME/lib/bitcode") {
$DEVICE_LIB_PATH = "$HIP_ROCCLR_HOME/lib/bitcode";
}
$HIP_INCLUDE_PATH = "$HIP_ROCCLR_HOME/include";
if (!defined $HIP_LIB_PATH) {
$HIP_LIB_PATH = "$HIP_ROCCLR_HOME/lib";
}

if (!defined $DEVICE_LIB_PATH) {
if (-e "$ROCM_PATH/amdgcn/bitcode") {
$DEVICE_LIB_PATH = "$ROCM_PATH/amdgcn/bitcode";
}
else {
# This path is to support an older build of the device library
# TODO: To be removed in the future.
$DEVICE_LIB_PATH = "$ROCM_PATH/lib";
}
}
}

if ($verbose & 0x2) {
Expand Down Expand Up @@ -567,7 +552,7 @@ BEGIN
}

if ($hasHIP) {
if ($DEVICE_LIB_PATH ne "$ROCM_PATH/amdgcn/bitcode") {
if (defined $DEVICE_LIB_PATH) {
$HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\"";
}
}
Expand Down

0 comments on commit e18cbe6

Please sign in to comment.