@@ -29,9 +29,10 @@ def do_configure(args):
29
29
libclc_targets_to_build = ''
30
30
libclc_gen_remangled_variants = 'OFF'
31
31
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 = ''
35
36
sycl_werror = 'ON'
36
37
llvm_enable_assertions = 'ON'
37
38
llvm_enable_doxygen = 'OFF'
@@ -40,15 +41,21 @@ def do_configure(args):
40
41
llvm_enable_lld = 'OFF'
41
42
42
43
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 ("#############################################" )
43
50
44
51
# replace not append, so ARM ^ X86
45
52
if args .arm :
46
53
llvm_targets_to_build = 'ARM;AArch64'
47
54
48
55
if args .enable_esimd_cpu_emulation :
49
- sycl_build_pi_esimd_cpu = 'ON'
56
+ sycl_build_pi_esimd_emulator = 'ON'
50
57
51
- if args .cuda or args .rocm :
58
+ if args .cuda or args .hip :
52
59
llvm_enable_projects += ';libclc'
53
60
54
61
if args .cuda :
@@ -57,23 +64,26 @@ def do_configure(args):
57
64
libclc_gen_remangled_variants = 'ON'
58
65
sycl_build_pi_cuda = 'ON'
59
66
60
- if args .rocm :
61
- if args .rocm_platform == 'AMD' :
67
+ if args .hip :
68
+ if args .hip_platform == 'AMD' :
62
69
llvm_targets_to_build += ';AMDGPU'
63
70
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
64
73
65
- # The ROCm plugin for AMD uses lld for linking
74
+ # The HIP plugin for AMD uses lld for linking
66
75
llvm_enable_projects += ';lld'
67
- elif args .rocm_platform == 'NVIDIA' and not args .cuda :
76
+ elif args .hip_platform == 'NVIDIA' and not args .cuda :
68
77
llvm_targets_to_build += ';NVPTX'
69
78
libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
70
79
libclc_gen_remangled_variants = 'ON'
71
80
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'
74
83
75
84
if args .no_werror :
76
85
sycl_werror = 'OFF'
86
+ xpti_enable_werror = 'OFF'
77
87
78
88
if args .no_assertions :
79
89
llvm_enable_assertions = 'OFF'
@@ -107,8 +117,8 @@ def do_configure(args):
107
117
"-DLIBCLC_TARGETS_TO_BUILD={}" .format (libclc_targets_to_build ),
108
118
"-DLIBCLC_GENERATE_REMANGLED_VARIANTS={}" .format (libclc_gen_remangled_variants ),
109
119
"-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 ),
112
122
"-DLLVM_BUILD_TOOLS=ON" ,
113
123
"-DSYCL_ENABLE_WERROR={}" .format (sycl_werror ),
114
124
"-DCMAKE_INSTALL_PREFIX={}" .format (install_dir ),
@@ -118,7 +128,9 @@ def do_configure(args):
118
128
"-DBUILD_SHARED_LIBS={}" .format (llvm_build_shared_libs ),
119
129
"-DSYCL_ENABLE_XPTI_TRACING={}" .format (sycl_enable_xpti_tracing ),
120
130
"-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 )
122
134
]
123
135
124
136
if args .l0_headers and args .l0_loader :
@@ -178,8 +190,9 @@ def main():
178
190
parser .add_argument ("-t" , "--build-type" ,
179
191
metavar = "BUILD_TYPE" , default = "Release" , help = "build type: Debug, Release" )
180
192
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" )
183
196
parser .add_argument ("--arm" , action = 'store_true' , help = "build ARM support rather than x86" )
184
197
parser .add_argument ("--enable-esimd-cpu-emulation" , action = 'store_true' , help = "build with ESIMD_CPU emulation support" )
185
198
parser .add_argument ("--no-assertions" , action = 'store_true' , help = "build without assertions" )
@@ -193,6 +206,7 @@ def main():
193
206
parser .add_argument ("--libcxx-library" , metavar = "LIBCXX_LIBRARY_PATH" , help = "libcxx library path" )
194
207
parser .add_argument ("--use-lld" , action = "store_true" , help = "Use LLD linker for build" )
195
208
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" )
196
210
args = parser .parse_args ()
197
211
198
212
print ("args:{}" .format (args ))
0 commit comments