@@ -29,9 +29,10 @@ def do_configure(args):
2929 libclc_targets_to_build = ''
3030 libclc_gen_remangled_variants = 'OFF'
3131 sycl_build_pi_cuda = 'OFF'
32- sycl_build_pi_esimd_cpu = 'OFF'
33- sycl_build_pi_rocm = 'OFF'
34- sycl_build_pi_rocm_platform = 'AMD'
32+ sycl_build_pi_esimd_emulator = 'OFF'
33+ sycl_build_pi_hip = 'OFF'
34+ sycl_build_pi_hip_platform = 'AMD'
35+ sycl_clang_extra_flags = ''
3536 sycl_werror = 'ON'
3637 llvm_enable_assertions = 'ON'
3738 llvm_enable_doxygen = 'OFF'
@@ -40,15 +41,21 @@ def do_configure(args):
4041 llvm_enable_lld = 'OFF'
4142
4243 sycl_enable_xpti_tracing = 'ON'
44+ xpti_enable_werror = 'ON'
45+
46+ if args .ci_defaults :
47+ print ("#############################################" )
48+ print ("# Default CI configuration will be applied. #" )
49+ print ("#############################################" )
4350
4451 # replace not append, so ARM ^ X86
4552 if args .arm :
4653 llvm_targets_to_build = 'ARM;AArch64'
4754
4855 if args .enable_esimd_cpu_emulation :
49- sycl_build_pi_esimd_cpu = 'ON'
56+ sycl_build_pi_esimd_emulator = 'ON'
5057
51- if args .cuda or args .rocm :
58+ if args .cuda or args .hip :
5259 llvm_enable_projects += ';libclc'
5360
5461 if args .cuda :
@@ -57,23 +64,26 @@ def do_configure(args):
5764 libclc_gen_remangled_variants = 'ON'
5865 sycl_build_pi_cuda = 'ON'
5966
60- if args .rocm :
61- if args .rocm_platform == 'AMD' :
67+ if args .hip :
68+ if args .hip_platform == 'AMD' :
6269 llvm_targets_to_build += ';AMDGPU'
6370 libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa'
71+ if args .hip_amd_arch :
72+ sycl_clang_extra_flags += "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + args .hip_amd_arch
6473
65- # The ROCm plugin for AMD uses lld for linking
74+ # The HIP plugin for AMD uses lld for linking
6675 llvm_enable_projects += ';lld'
67- elif args .rocm_platform == 'NVIDIA' and not args .cuda :
76+ elif args .hip_platform == 'NVIDIA' and not args .cuda :
6877 llvm_targets_to_build += ';NVPTX'
6978 libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
7079 libclc_gen_remangled_variants = 'ON'
7180
72- sycl_build_pi_rocm_platform = args .rocm_platform
73- sycl_build_pi_rocm = 'ON'
81+ sycl_build_pi_hip_platform = args .hip_platform
82+ sycl_build_pi_hip = 'ON'
7483
7584 if args .no_werror :
7685 sycl_werror = 'OFF'
86+ xpti_enable_werror = 'OFF'
7787
7888 if args .no_assertions :
7989 llvm_enable_assertions = 'OFF'
@@ -107,8 +117,8 @@ def do_configure(args):
107117 "-DLIBCLC_TARGETS_TO_BUILD={}" .format (libclc_targets_to_build ),
108118 "-DLIBCLC_GENERATE_REMANGLED_VARIANTS={}" .format (libclc_gen_remangled_variants ),
109119 "-DSYCL_BUILD_PI_CUDA={}" .format (sycl_build_pi_cuda ),
110- "-DSYCL_BUILD_PI_ROCM ={}" .format (sycl_build_pi_rocm ),
111- "-DSYCL_BUILD_PI_ROCM_PLATFORM ={}" .format (sycl_build_pi_rocm_platform ),
120+ "-DSYCL_BUILD_PI_HIP ={}" .format (sycl_build_pi_hip ),
121+ "-DSYCL_BUILD_PI_HIP_PLATFORM ={}" .format (sycl_build_pi_hip_platform ),
112122 "-DLLVM_BUILD_TOOLS=ON" ,
113123 "-DSYCL_ENABLE_WERROR={}" .format (sycl_werror ),
114124 "-DCMAKE_INSTALL_PREFIX={}" .format (install_dir ),
@@ -118,7 +128,9 @@ def do_configure(args):
118128 "-DBUILD_SHARED_LIBS={}" .format (llvm_build_shared_libs ),
119129 "-DSYCL_ENABLE_XPTI_TRACING={}" .format (sycl_enable_xpti_tracing ),
120130 "-DLLVM_ENABLE_LLD={}" .format (llvm_enable_lld ),
121- "-DSYCL_BUILD_PI_ESIMD_CPU={}" .format (sycl_build_pi_esimd_cpu )
131+ "-DSYCL_BUILD_PI_ESIMD_EMULATOR={}" .format (sycl_build_pi_esimd_emulator ),
132+ "-DXPTI_ENABLE_WERROR={}" .format (xpti_enable_werror ),
133+ "-DSYCL_CLANG_EXTRA_FLAGS={}" .format (sycl_clang_extra_flags )
122134 ]
123135
124136 if args .l0_headers and args .l0_loader :
@@ -178,8 +190,9 @@ def main():
178190 parser .add_argument ("-t" , "--build-type" ,
179191 metavar = "BUILD_TYPE" , default = "Release" , help = "build type: Debug, Release" )
180192 parser .add_argument ("--cuda" , action = 'store_true' , help = "switch from OpenCL to CUDA" )
181- parser .add_argument ("--rocm" , action = 'store_true' , help = "switch from OpenCL to ROCm" )
182- parser .add_argument ("--rocm-platform" , type = str , choices = ['AMD' , 'NVIDIA' ], default = 'AMD' , help = "choose ROCm backend" )
193+ parser .add_argument ("--hip" , action = 'store_true' , help = "switch from OpenCL to HIP" )
194+ parser .add_argument ("--hip-platform" , type = str , choices = ['AMD' , 'NVIDIA' ], default = 'AMD' , help = "choose hardware platform for HIP backend" )
195+ 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" )
183196 parser .add_argument ("--arm" , action = 'store_true' , help = "build ARM support rather than x86" )
184197 parser .add_argument ("--enable-esimd-cpu-emulation" , action = 'store_true' , help = "build with ESIMD_CPU emulation support" )
185198 parser .add_argument ("--no-assertions" , action = 'store_true' , help = "build without assertions" )
@@ -193,6 +206,7 @@ def main():
193206 parser .add_argument ("--libcxx-library" , metavar = "LIBCXX_LIBRARY_PATH" , help = "libcxx library path" )
194207 parser .add_argument ("--use-lld" , action = "store_true" , help = "Use LLD linker for build" )
195208 parser .add_argument ("--llvm-external-projects" , help = "Add external projects to build. Add as comma seperated list." )
209+ parser .add_argument ("--ci-defaults" , action = "store_true" , help = "Enable default CI parameters" )
196210 args = parser .parse_args ()
197211
198212 print ("args:{}" .format (args ))
0 commit comments