From d8346a28c8216e58e6a0e8fb4664086785e0aae9 Mon Sep 17 00:00:00 2001 From: Nicolas Miller Date: Mon, 30 Aug 2021 10:35:27 +0100 Subject: [PATCH] [SYCL] Fix AMD architecture flag The flag is no longer passed through mcpu --- SYCL/README.md | 2 +- SYCL/lit.cfg.py | 6 +++--- SYCL/lit.site.cfg.py.in | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SYCL/README.md b/SYCL/README.md index 01a31d4d14..2c70742883 100644 --- a/SYCL/README.md +++ b/SYCL/README.md @@ -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". diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 49c76a89c1..b4c078a3b9 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -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) ) diff --git a/SYCL/lit.site.cfg.py.in b/SYCL/lit.site.cfg.py.in index b56fee118c..1d784297cf 100644 --- a/SYCL/lit.site.cfg.py.in +++ b/SYCL/lit.site.cfg.py.in @@ -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@"