@@ -658,6 +658,17 @@ def open_check_file(file_name):
658658 # Use short names for LIT rules.
659659 config .available_features .add ("any-device-is-" + be )
660660
661+ if config .llvm_main_include_dir :
662+ lit_config .note ("Using device config file built from LLVM" )
663+ config .available_features .add ("device-config-file" )
664+ config .substitutions .append (
665+ ("%device_config_file_include_flag" , f"-I { config .llvm_main_include_dir } " )
666+ )
667+ elif os .path .exists (f"{ config .sycl_include } /llvm/SYCLLowerIR/DeviceConfigFile.hpp" ):
668+ lit_config .note ("Using installed device config file" )
669+ config .available_features .add ("device-config-file" )
670+ config .substitutions .append (("%device_config_file_include_flag" , "" ))
671+
661672# That has to be executed last so that all device-independent features have been
662673# discovered already.
663674config .sycl_dev_features = {}
@@ -828,15 +839,6 @@ def open_check_file(file_name):
828839 ("%clang" , " " + config .dpcpp_compiler + " " + config .c_flags )
829840 )
830841
831- if config .llvm_main_include_dir :
832- config .available_features .add ("device-config-file" )
833- config .substitutions .append (
834- ("%device_config_file_include_flag" , f"-I { config .llvm_main_include_dir } " )
835- )
836- elif os .path .exists (f"{ config .sycl_include } /llvm/SYCLLowerIR/DeviceConfigFile.hpp" ):
837- config .available_features .add ("device-config-file" )
838- config .substitutions .append (("%device_config_file_include_flag" , "" ))
839-
840842# Set timeout for a single test
841843try :
842844 import psutil
0 commit comments