@@ -442,8 +442,6 @@ def open_check_file(file_name):
442442 for line in sp .splitlines ():
443443 if "Intel(R) Data Center GPU Max 1100" in line :
444444 config .available_features .add ("gpu-intel-pvc-1T" )
445- if "gfx90a" in line :
446- config .available_features .add ("gpu-amd-gfx90a" )
447445 if not line .startswith ("[" ):
448446 continue
449447 (backend , device ) = line [1 :].split ("]" )[0 ].split (":" )
@@ -540,39 +538,6 @@ def open_check_file(file_name):
540538 config .cuda_libs_dir = os .path .join (os .environ ["CUDA_PATH" ], r"lib64" )
541539 config .cuda_include = os .path .join (os .environ ["CUDA_PATH" ], "include" )
542540
543- # FIXME: This needs to be made per-device as well, possibly with a helper.
544- if "hip:gpu" in config .sycl_devices and config .hip_platform == "AMD" :
545- if not config .amd_arch :
546- lit_config .error (
547- "Cannot run tests for HIP without an offload-arch. Please "
548- + "specify one via the 'amd_arch' parameter or 'AMD_ARCH' CMake "
549- + "variable."
550- )
551- llvm_config .with_system_environment ("ROCM_PATH" )
552- config .available_features .add ("hip_amd" )
553- arch_flag = (
554- "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config .amd_arch
555- )
556- elif "hip:gpu" in config .sycl_devices and config .hip_platform == "NVIDIA" :
557- config .available_features .add ("hip_nvidia" )
558- arch_flag = ""
559- else :
560- arch_flag = ""
561-
562- if lit_config .params .get ("compatibility_testing" , False ):
563- config .substitutions .append (("%clangxx" , " true " ))
564- config .substitutions .append (("%clang" , " true " ))
565- else :
566- config .substitutions .append (
567- (
568- "%clangxx" ,
569- " " + config .dpcpp_compiler + " " + config .cxx_flags + " " + arch_flag ,
570- )
571- )
572- config .substitutions .append (
573- ("%clang" , " " + config .dpcpp_compiler + " " + config .c_flags )
574- )
575-
576541config .substitutions .append (("%threads_lib" , config .sycl_threads_lib ))
577542
578543if lit_config .params .get ("ze_debug" ):
@@ -805,12 +770,50 @@ def open_check_file(file_name):
805770 # Use short names for LIT rules.
806771 features .add (be )
807772
773+ if be == "hip" and config .hip_platform == "AMD" :
774+ if not config .amd_arch :
775+ # Guaranteed to be a single element in the set
776+ arch = [x for x in architecture_feature ][0 ]
777+ amd_arch_prefix = "arch-amd_gpu_"
778+ if amd_arch_prefix not in arch or len (architecture_feature ) != 1 :
779+ lit_config .error (
780+ "Cannot detect architecture for AMD HIP device, specify it explicitly"
781+ )
782+ config .amd_arch = arch .replace (amd_arch_prefix , "" )
783+ llvm_config .with_system_environment ("ROCM_PATH" )
784+ config .available_features .add ("hip_amd" )
785+ arch_flag = (
786+ "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config .amd_arch
787+ )
788+ config .substitutions .append (
789+ ("%rocm_path" , os .environ .get ("ROCM_PATH" , "/opt/rocm" ))
790+ )
791+ elif be == "hip" and config .hip_platform == "NVIDIA" :
792+ config .available_features .add ("hip_nvidia" )
793+ arch_flag = ""
794+ else :
795+ arch_flag = ""
796+
808797 config .sycl_dev_features [sycl_device ] = features .union (config .available_features )
809798 if is_intel_driver :
810799 config .intel_driver_ver [sycl_device ] = intel_driver_ver
811800 else :
812801 config .intel_driver_ver [sycl_device ] = {}
813802
803+ if lit_config .params .get ("compatibility_testing" , False ):
804+ config .substitutions .append (("%clangxx" , " true " ))
805+ config .substitutions .append (("%clang" , " true " ))
806+ else :
807+ config .substitutions .append (
808+ (
809+ "%clangxx" ,
810+ " " + config .dpcpp_compiler + " " + config .cxx_flags + " " + arch_flag ,
811+ )
812+ )
813+ config .substitutions .append (
814+ ("%clang" , " " + config .dpcpp_compiler + " " + config .c_flags )
815+ )
816+
814817# Set timeout for a single test
815818try :
816819 import psutil
0 commit comments