Skip to content

[HLSL] Add Offload distribution#196640

Merged
bob80905 merged 3 commits into
llvm:mainfrom
bob80905:hlsl-offload-distribution
May 13, 2026
Merged

[HLSL] Add Offload distribution#196640
bob80905 merged 3 commits into
llvm: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
Comment thread clang/cmake/caches/HLSL.cmake Outdated
Copy link
Copy Markdown
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@bob80905 bob80905 merged commit 3315f67 into llvm:main May 13, 2026
10 of 11 checks passed
EuphoricThinking pushed a commit to EuphoricThinking/llvm-project that referenced this pull request May 14, 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
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.

4 participants