-
Notifications
You must be signed in to change notification settings - Fork 787
[CI] Provide libclc targets to build and test #5091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ def do_configure(args): | |
|
||
llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw' | ||
|
||
libclc_amd_target_names = ';amdgcn--;amdgcn--amdhsa' | ||
libclc_nvidia_target_names = 'nvptx64--;nvptx64--nvidiacl' | ||
|
||
if args.llvm_external_projects: | ||
llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";") | ||
|
||
|
@@ -43,18 +46,6 @@ def do_configure(args): | |
sycl_enable_xpti_tracing = 'ON' | ||
xpti_enable_werror = 'ON' | ||
|
||
build_libclc = False | ||
|
||
if args.ci_defaults: | ||
print("#############################################") | ||
print("# Default CI configuration will be applied. #") | ||
print("#############################################") | ||
|
||
# For clang-format and clang-tidy | ||
llvm_enable_projects += ";clang-tools-extra" | ||
# libclc is required for CI validation | ||
build_libclc = True | ||
|
||
# replace not append, so ARM ^ X86 | ||
if args.arm: | ||
llvm_targets_to_build = 'ARM;AArch64' | ||
|
@@ -63,26 +54,26 @@ def do_configure(args): | |
sycl_build_pi_esimd_emulator = 'ON' | ||
|
||
if args.cuda or args.hip: | ||
build_libclc = True | ||
llvm_enable_projects += ';libclc' | ||
|
||
if args.cuda: | ||
llvm_targets_to_build += ';NVPTX' | ||
libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl' | ||
libclc_targets_to_build = libclc_nvidia_target_names | ||
libclc_gen_remangled_variants = 'ON' | ||
sycl_build_pi_cuda = 'ON' | ||
|
||
if args.hip: | ||
if args.hip_platform == 'AMD': | ||
llvm_targets_to_build += ';AMDGPU' | ||
libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa' | ||
libclc_targets_to_build += libclc_amd_target_names | ||
if args.hip_amd_arch: | ||
sycl_clang_extra_flags += "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch="+args.hip_amd_arch | ||
|
||
# The HIP plugin for AMD uses lld for linking | ||
llvm_enable_projects += ';lld' | ||
elif args.hip_platform == 'NVIDIA' and not args.cuda: | ||
llvm_targets_to_build += ';NVPTX' | ||
libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl' | ||
libclc_targets_to_build += libclc_nvidia_target_names | ||
libclc_gen_remangled_variants = 'ON' | ||
|
||
sycl_build_pi_hip_platform = args.hip_platform | ||
|
@@ -103,10 +94,28 @@ def do_configure(args): | |
llvm_build_shared_libs = 'ON' | ||
|
||
if args.use_lld: | ||
llvm_enable_lld = 'ON' | ||
llvm_enable_lld = 'ON' | ||
|
||
if build_libclc: | ||
llvm_enable_projects += ';libclc' | ||
# CI Default conditionally appends to options, keep it at the bottom of | ||
# args handling | ||
if args.ci_defaults: | ||
print("#############################################") | ||
print("# Default CI configuration will be applied. #") | ||
print("#############################################") | ||
|
||
# For clang-format and clang-tidy | ||
llvm_enable_projects += ";clang-tools-extra" | ||
# libclc is required for CI validation | ||
if 'libclc' not in llvm_enable_projects: | ||
vladimirlaz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
llvm_enable_projects += ';libclc' | ||
# libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it | ||
if 'NVPTX' not in llvm_targets_to_build: | ||
llvm_targets_to_build += ';NVPTX' | ||
# Add both NVIDIA and AMD libclc targets | ||
if libclc_amd_target_names not in libclc_targets_to_build: | ||
libclc_targets_to_build += libclc_amd_target_names | ||
Comment on lines
+115
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think to build libclc for AMD target, LLVM's AMDGPU target back-end must be built. @jchlanda, am I right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was my guess as well, but I've just tried and |
||
if libclc_nvidia_target_names not in libclc_targets_to_build: | ||
libclc_targets_to_build += libclc_nvidia_target_names | ||
|
||
install_dir = os.path.join(abs_obj_dir, "install") | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ set(LIBCLC_TEST_DEPS | |
llvm-dis | ||
not | ||
clang | ||
count | ||
) | ||
|
||
add_custom_target(check-libclc) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexbatashev, @vladimirlaz, FYI.
When we originally discussed
--ci-defaults
option, I thought that these defaults can be overridden by additional options. E.g.--ci-defaults --option-X=val
, so that if--ci-defaults
sets--option-X
, users can replace the default value.Unfortunately, I don't see this requirement to be documented in the code and it seems to be not true for options modified inside this
if-statement
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bader it’s a good point, we shall fix it in the future