Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Fix AMD architecture flag #425

Merged
merged 1 commit into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SYCL/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Defaults to AMD if no value is given. Supported values are:
- **AMD** - for ROCm to target AMD GPUs
- **NVIDIA** - for ROCm to target NVIDIA GPUs

***MCPU*** Flag must be set for when using ROCm triple.
***AMD_ARCH*** Flag must be set for when using ROCm triple.
For example it may be set to "gfx906".


Expand Down
6 changes: 3 additions & 3 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@
lit_config.error("Unknown ROCm platform '" + config.rocm_platform + "' supported platforms are " + ', '.join(supported_rocm_platforms))

if config.sycl_be == "rocm" and config.rocm_platform == "AMD":
mcpu_flag = '-mcpu=' + config.mcpu
arch_flag = '-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice --offload-arch=' + config.amd_arch
else:
mcpu_flag = ""
arch_flag = ""

# extra_include points to sycl/sycl.hpp location to workaround compiler
# versions which supports only CL/sycl.hpp
config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags + ' ' + mcpu_flag + ( "/I" if cl_options else "-I") + config.extra_include ) )
config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags + ' ' + arch_flag + ' ' + ( "/I" if cl_options else "-I") + config.extra_include ) )
config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags + ( "/I" if cl_options else "-I") + config.extra_include ) )
config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) )

Expand Down
2 changes: 1 addition & 1 deletion SYCL/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ config.opencl_include_dir = os.path.join(config.sycl_include, 'sycl')
config.target_devices = lit_config.params.get("target_devices", "@SYCL_TARGET_DEVICES@")
config.sycl_be = lit_config.params.get("sycl_be", "@SYCL_BE@")
config.rocm_platform = "@ROCM_PLATFORM@"
config.mcpu = "@MCPU@"
config.amd_arch = "@AMD_ARCH@"
config.sycl_threads_lib = '@SYCL_THREADS_LIB@'
config.extra_environment = lit_config.params.get("extra_environment", "@LIT_EXTRA_ENVIRONMENT@")
config.cxx_flags = "@CMAKE_CXX_FLAGS@"
Expand Down