-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from hipcc to amdclang #1920
base: develop
Are you sure you want to change the base?
Conversation
if os.name == "nt": | ||
globalParameters["AssemblerPath"] = locateExe(globalParameters["ROCmBinPath"], "clang++.exe") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about amdclang on windows?
@@ -40,7 +40,7 @@ set(TENSILE_USE_OPENMP ON CACHE BOOL "Use OpenMP to improve performance.") | |||
set(TENSILE_STATIC_ONLY ON CACHE BOOL "Disable exposing Tensile symbols in a shared library.") | |||
|
|||
if(NOT DEFINED CXX_VERSION_STRING) | |||
if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$") | |||
if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" OR CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using CMAKE_<LANG>_COMPILER_VERSION
(new ticket):
https://cmake.org/cmake/help/v3.0/variable/CMAKE_LANG_COMPILER_VERSION.html
Tensile/Common.py
Outdated
@@ -2230,8 +2231,8 @@ def capRow(caps, cap): | |||
def which(p): | |||
exes = [p+x for x in ['', '.exe', '.bat']] | |||
system_path = os.environ['PATH'].split(os.pathsep) | |||
if p == 'hipcc' and 'CMAKE_CXX_COMPILER' in os.environ and os.path.isfile(os.environ['CMAKE_CXX_COMPILER']): | |||
return os.environ['CMAKE_CXX_COMPILER'] | |||
if (p == 'hipcc' or p == 'amdclang++') and 'CXX' in os.environ and os.path.isfile(os.environ['CXX']): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs testing on windows
@@ -466,7 +466,7 @@ def functionPrefix(self, kernel): | |||
kStr += " } while (assumed != old);%s" % (self.endLine) | |||
kStr += "}%s" % (self.endLine) | |||
""" | |||
if globalParameters["CxxCompiler"] == "hipcc": | |||
if globalParameters["CxxCompiler"] == "hipcc" or globalParameters["CxxCompiler"] == "amdclang++": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look into removing OCL ticket
hipccver = globalParameters['HipClangVersion'].split(".") | ||
hipccMaj = int(hipccver[0]) | ||
hipccMin = int(hipccver[1]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using amdclang we will always pass the if test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a ticket for dropping 5.2
@@ -40,7 +40,7 @@ set(TENSILE_USE_OPENMP ON CACHE BOOL "Use OpenMP to improve performance.") | |||
set(TENSILE_STATIC_ONLY ON CACHE BOOL "Disable exposing Tensile symbols in a shared library.") | |||
|
|||
if(NOT DEFINED CXX_VERSION_STRING) | |||
if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$") | |||
if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" OR CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this check match version-suffixed compiler names? If it needs that .*
at the start to match amdclang++
, I think it might need a .*
on the end to match clang++-17
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am exploring removing this logic altogether in favor of CMAKE_<LANG>_COMPILER_VERSION
fe3d527
to
a7ef0fc
Compare
The goal of this change set is to move the default compiler from hipcc to amdclang++. The most significant difference between hipcc and amdclang are the flags used when invoking the compiler wrapped by hipcc. We attempt to delineate those differences below by noting if a flag is defaulted (d), set manually (m) or unset (blank):
-O3
O2
by default-x hip
-D__HIP_HCC_COMPAT_MODE__=1
-mrelax-all
-mframe-pointer=all
-mframe-pointer=none
-Wno-format-nonliteral
-fallow-half-arguments-and-returns
-mllvm -amdgpu-early-inline-all=true
-mllvm -amdgpu-function-calls=false
--genco
--cuda-device-only
genco
is passedTo reproduce one can do the following:
Configure the HostTestLibrary directory
Run the build
Remove DecisionTree test binaries, rebuild with verbosity and review the history for build command
Run the build command from above with
-v
The command above will output the detailed compilation commands and arguments used to determine differences in compilation with hipcc and amdclang++.