@@ -15,6 +15,9 @@ def do_configure(args):
15
15
16
16
llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw'
17
17
18
+ libclc_amd_target_names = ';amdgcn--;amdgcn--amdhsa'
19
+ libclc_nvidia_target_names = 'nvptx64--;nvptx64--nvidiacl'
20
+
18
21
if args .llvm_external_projects :
19
22
llvm_external_projects += ";" + args .llvm_external_projects .replace ("," , ";" )
20
23
@@ -55,22 +58,22 @@ def do_configure(args):
55
58
56
59
if args .cuda :
57
60
llvm_targets_to_build += ';NVPTX'
58
- libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl'
61
+ libclc_targets_to_build = libclc_nvidia_target_names
59
62
libclc_gen_remangled_variants = 'ON'
60
63
sycl_build_pi_cuda = 'ON'
61
64
62
65
if args .hip :
63
66
if args .hip_platform == 'AMD' :
64
67
llvm_targets_to_build += ';AMDGPU'
65
- libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa'
68
+ libclc_targets_to_build += libclc_amd_target_names
66
69
if args .hip_amd_arch :
67
70
sycl_clang_extra_flags += "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + args .hip_amd_arch
68
71
69
72
# The HIP plugin for AMD uses lld for linking
70
73
llvm_enable_projects += ';lld'
71
74
elif args .hip_platform == 'NVIDIA' and not args .cuda :
72
75
llvm_targets_to_build += ';NVPTX'
73
- libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
76
+ libclc_targets_to_build += libclc_nvidia_target_names
74
77
libclc_gen_remangled_variants = 'ON'
75
78
76
79
sycl_build_pi_hip_platform = args .hip_platform
@@ -109,10 +112,10 @@ def do_configure(args):
109
112
if 'NVPTX' not in llvm_targets_to_build :
110
113
llvm_targets_to_build += ';NVPTX'
111
114
# Add both NVIDIA and AMD libclc targets
112
- if 'amdgcn--;amdgcn--amdhsa' not in libclc_targets_to_build :
113
- libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa'
114
- if 'nvptx64--;nvptx64--nvidiacl' not in libclc_targets_to_build :
115
- libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'
115
+ if libclc_amd_target_names not in libclc_targets_to_build :
116
+ libclc_targets_to_build += libclc_amd_target_names
117
+ if libclc_nvidia_target_names not in libclc_targets_to_build :
118
+ libclc_targets_to_build += libclc_nvidia_target_names
116
119
117
120
install_dir = os .path .join (abs_obj_dir , "install" )
118
121
0 commit comments