diff --git a/.github/workflows/sycl_linux_build_and_test.yml b/.github/workflows/sycl_linux_build_and_test.yml index 29f4968c00f53..a50531b9ce8e3 100644 --- a/.github/workflows/sycl_linux_build_and_test.yml +++ b/.github/workflows/sycl_linux_build_and_test.yml @@ -40,7 +40,7 @@ on: build_configure_extra_args: type: string required: false - default: "--hip --hip-amd-arch=gfx906 --cuda" + default: "--hip --cuda" build_artifact_suffix: type: string required: true @@ -86,7 +86,7 @@ jobs: \"build_cache_root\":\"/__w/\", \"build_cache_suffix\":\"default\", \"build_cache_size\":\"2G\", - \"build_configure_extra_args\":\"--hip --hip-amd-arch=gfx906 --cuda\", + \"build_configure_extra_args\":\"--hip --cuda\", \"build_artifact_suffix\":\"default\", \"build_upload_artifact\":\"false\", \"intel_drivers_image\":\"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest\", diff --git a/buildbot/configure.py b/buildbot/configure.py index 77f1ff5ef4463..4e02e6046fd62 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -66,8 +66,6 @@ def do_configure(args): if args.hip_platform == 'AMD': llvm_targets_to_build += ';AMDGPU' libclc_targets_to_build += libclc_amd_target_names - if args.hip_amd_arch: - sycl_clang_extra_flags += "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch="+args.hip_amd_arch # The HIP plugin for AMD uses lld for linking llvm_enable_projects += ';lld' @@ -211,7 +209,6 @@ def main(): parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA") parser.add_argument("--hip", action='store_true', help="switch from OpenCL to HIP") parser.add_argument("--hip-platform", type=str, choices=['AMD', 'NVIDIA'], default='AMD', help="choose hardware platform for HIP backend") - parser.add_argument("--hip-amd-arch", type=str, help="Sets AMD gpu architecture for llvm lit tests, this is only needed for the HIP backend and AMD platform") parser.add_argument("--arm", action='store_true', help="build ARM support rather than x86") parser.add_argument("--enable-esimd-emulator", action='store_true', help="build with ESIMD emulation support") parser.add_argument("--no-assertions", action='store_true', help="build without assertions") diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index 5e561780db1dd..6bf8aead56624 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -502,10 +502,10 @@ skipped. If CUDA support has been built, it is tested only if there are CUDA devices available. -If testing with HIP for AMD make sure to specify the GPU being used -by adding `-hip-amd-arch=`to buildbot/configure.py or add -`-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=` -to the CMake variable `SYCL_CLANG_EXTRA_FLAGS`. +If testing with HIP for AMD, the lit tests will use `gfx906` as the default +architecture. It is possible to change it by adding +`-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=` to the CMake +variable `SYCL_CLANG_EXTRA_FLAGS`. #### Run DPC++ E2E test suite diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index 57d7f8ffaed55..e90c426f5f7b5 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -35,8 +35,6 @@ # test_exec_root: The root path where tests should be run. config.test_exec_root = os.path.join(config.sycl_obj_root, 'test') -llvm_config.use_clang(additional_flags=config.sycl_clang_extra_flags.split(' ')) - # Propagate some variables from the host environment. llvm_config.with_system_environment(['PATH', 'OCL_ICD_FILENAMES', 'SYCL_DEVICE_ALLOWLIST', 'SYCL_CONFIG_FILE_NAME']) @@ -100,6 +98,8 @@ lit_config.note("Triple: {}".format(triple)) config.substitutions.append( ('%sycl_triple', triple ) ) +additional_flags = config.sycl_clang_extra_flags.split(' ') + if config.cuda_be == "ON": config.available_features.add('cuda_be') @@ -115,12 +115,13 @@ if triple == 'amdgcn-amd-amdhsa': config.available_features.add('hip_amd') # For AMD the specific GPU has to be specified with --offload-arch - if not re.match('.*--offload-arch.*', config.sycl_clang_extra_flags): - raise Exception("Error: missing --offload-arch flag when trying to " \ - "run lit tests for AMD GPU, please add " \ - "--hip-amd-arch= to buildbot/configure.py or add" \ - "`-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=` to " \ - "the CMake variable SYCL_CLANG_EXTRA_FLAGS") + if not any([f.startswith('--offload-arch') for f in additional_flags]): + # If the offload arch wasn't specified in SYCL_CLANG_EXTRA_FLAGS, + # hardcode it to gfx906, this is fine because only compiler tests + additional_flags += ['-Xsycl-target-backend=amdgcn-amd-amdhsa', + '--offload-arch=gfx906'] + +llvm_config.use_clang(additional_flags=additional_flags) # Set timeout for test = 10 mins try: