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

Commit b360fac

Browse files
authored
[SYCL] Fix AMD architecture flag (#425)
The flag is no longer passed through mcpu
1 parent 8d5dcc7 commit b360fac

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

SYCL/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Defaults to AMD if no value is given. Supported values are:
111111
- **AMD** - for ROCm to target AMD GPUs
112112
- **NVIDIA** - for ROCm to target NVIDIA GPUs
113113

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

117117

SYCL/lit.cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@
184184
lit_config.error("Unknown ROCm platform '" + config.rocm_platform + "' supported platforms are " + ', '.join(supported_rocm_platforms))
185185

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

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

SYCL/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ config.opencl_include_dir = os.path.join(config.sycl_include, 'sycl')
2323
config.target_devices = lit_config.params.get("target_devices", "@SYCL_TARGET_DEVICES@")
2424
config.sycl_be = lit_config.params.get("sycl_be", "@SYCL_BE@")
2525
config.rocm_platform = "@ROCM_PLATFORM@"
26-
config.mcpu = "@MCPU@"
26+
config.amd_arch = "@AMD_ARCH@"
2727
config.sycl_threads_lib = '@SYCL_THREADS_LIB@'
2828
config.extra_environment = lit_config.params.get("extra_environment", "@LIT_EXTRA_ENVIRONMENT@")
2929
config.cxx_flags = "@CMAKE_CXX_FLAGS@"

0 commit comments

Comments
 (0)