Skip to content

[HLSL] Add Offload distribution#196640

Open
bob80905 wants to merge 2 commits intollvm:mainfrom
bob80905:hlsl-offload-distribution
Open

[HLSL] Add Offload distribution#196640
bob80905 wants to merge 2 commits intollvm:mainfrom
bob80905:hlsl-offload-distribution

Conversation

@bob80905
Copy link
Copy Markdown
Contributor

@bob80905 bob80905 commented May 8, 2026

This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150

@llvmorg-github-actions llvmorg-github-actions Bot added clang Clang issues not falling into any other category HLSL HLSL Language Support labels May 8, 2026
@llvmorg-github-actions
Copy link
Copy Markdown

llvmorg-github-actions Bot commented May 8, 2026

@llvm/pr-subscribers-hlsl

@llvm/pr-subscribers-clang

Author: Joshua Batista (bob80905)

Changes

This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized.
This addresses llvm/offload-test-suite#1150


Full diff: https://github.com/llvm/llvm-project/pull/196640.diff

1 Files Affected:

  • (modified) clang/cmake/caches/HLSL.cmake (+27)
diff --git a/clang/cmake/caches/HLSL.cmake b/clang/cmake/caches/HLSL.cmake
index 24afcbbda2a40..2826a2ebd2296 100644
--- a/clang/cmake/caches/HLSL.cmake
+++ b/clang/cmake/caches/HLSL.cmake
@@ -14,3 +14,30 @@ if (HLSL_ENABLE_DISTRIBUTION)
       "clang;hlsl-resource-headers;clangd"
       CACHE STRING "")
 endif()
+
+# Enable the offload test suite distribution. This produces a portable
+# install prefix containing all binaries and test files needed to run the
+# HLSL offload test suite on another machine.
+#
+# Install with:
+#   cmake --build build --target install-distribution
+#   cmake --build build --target install-offload-tools
+#   cmake --build build --target install-offload-test-suite
+#
+# Prerequisites on the target machine:
+#   - Python 3.6+
+#   - pip install lit pyyaml
+#   - GPU drivers (D3D12, Vulkan, or Metal depending on test suite)
+#   - For non-clang test suites: a DXC executable (clang-dxc is included)
+#
+# After installing, configure and run tests:
+#   cd <prefix>/share/hlsl-test-suite
+#   ./configure-test-suite.py --suite clang-d3d12
+#   lit run/test/clang-d3d12
+if (HLSL_ENABLE_OFFLOAD_DISTRIBUTION)
+  # Lit utilities (FileCheck, split-file, etc.) require LLVM_INSTALL_UTILS.
+  set(LLVM_INSTALL_UTILS ON CACHE BOOL "")
+  set(LLVM_DISTRIBUTION_COMPONENTS
+      "clang;hlsl-resource-headers;FileCheck;split-file;obj2yaml;not"
+      CACHE STRING "")
+endif()

Comment thread clang/cmake/caches/HLSL.cmake
Comment thread clang/cmake/caches/HLSL.cmake Outdated
endif()

# Enable the offload test suite distribution. Produces a portable install
# prefix containing the binaries and test data needed to run the HLSL
Copy link
Copy Markdown
Contributor

@Icohedron Icohedron May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HLSL offload test suite distribution itself doesn't contain the tests. The install-offload-test-suite install target from the offload test suite installs the tests.

Suggested change
# prefix containing the binaries and test data needed to run the HLSL
# prefix containing the binaries, headers, and libs needed to run the HLSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category HLSL HLSL Language Support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants