Skip to content

Commit 791b196

Browse files
committed
Test workflow run
1 parent d11a3e6 commit 791b196

339 files changed

Lines changed: 37182 additions & 9 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-test-callable.yaml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: HLSL Test
22

33
permissions:
4-
contents: read
4+
contents: write
55
checks: write
6+
pull-requests: write
7+
68

79
on:
810
workflow_dispatch:
@@ -155,14 +157,14 @@ jobs:
155157
cd DXC
156158
mkdir build
157159
cd build
158-
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On ${{ github.workspace }}/DXC/
160+
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/DXC/cmake/caches/PredefinedParams.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DHLSL_DISABLE_SOURCE_GENERATION=On -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v --filter-out=Feature/MaximalReconvergence" ${{ github.workspace }}/DXC/
159161
ninja
160162
- name: Build LLVM
161163
run: |
162164
cd llvm-project
163165
mkdir build
164166
cd build
165-
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/
167+
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v --filter-out=Feature/MaximalReconvergence" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/
166168
ninja hlsl-test-depends
167169
- name: Dump GPU Info
168170
run: |
@@ -175,15 +177,37 @@ jobs:
175177
cd build
176178
ninja check-hlsl-unit
177179
ninja ${{ inputs.TestTarget }}
180+
- name: Generate maximal Reconvergence Tests
181+
if: always()
182+
run: |
183+
rm -rf OffloadTest/tools/TestGenerator/reconvergence/tests/*
184+
cd OffloadTest/tools/TestGenerator/reconvergence
185+
cmake -G Ninja -B build/
186+
ninja -C build
187+
- name: Run Maximal Reconvergence Test
188+
if: always()
189+
continue-on-error: true
190+
env:
191+
OFFLOADTEST_SUPPRESS_DIFF: 1
192+
run: |
193+
cd llvm-project
194+
cd build
195+
./bin/llvm-lit -v --xunit-xml-output=testresults-max-reconv.xunit.xml ${{ github.workspace }}/OffloadTest/tools/TestGenerator/reconvergence/tests
178196
- name: Publish Test Results
179197
uses: EnricoMi/publish-unit-test-result-action/macos@v2
180198
if: always() && inputs.OS == 'macOS'
181199
with:
200+
check_name: "HLSL Test Results"
182201
comment_mode: off
183202
files: llvm-project/build/**/testresults.xunit.xml
184-
#- name: Publish Test Results
185-
# uses: EnricoMi/publish-unit-test-result-action/windows@v2
186-
# if: always() && inputs.OS == 'windows'
187-
# with:
188-
# comment_mode: off
189-
# files: llvm-project/build/**/testresults.xunit.xml
203+
- name: Publish Maximal Reconvergence Test Results
204+
uses: EnricoMi/publish-unit-test-result-action/composite@v2
205+
if: always()
206+
with:
207+
check_name: "Maximal Reconvergence Test Results (${{ inputs.SKU }} ${{ inputs.TestTarget }})"
208+
comment_mode: off
209+
files: llvm-project/build/**/testresults-max-reconv.xunit.xml
210+
report_individual_runs: true
211+
json_thousands_separator: ','
212+
badge_branch: badges
213+
badge_label: "Maximal Reconvergence"

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ Experimental Runtime test suite for HLSL
2020
| Windows Vulkan NVIDIA GPU | [![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-dxc-vk.yaml/badge.svg)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-dxc-vk.yaml) | [![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-clang-vk.yaml/badge.svg)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-clang-vk.yaml) |
2121
| Windows Vulkan Qualcomm GPU | [![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-dxc-vk.yaml/badge.svg)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-dxc-vk.yaml) | [![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-clang-vk.yaml/badge.svg)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-clang-vk.yaml) |
2222

23+
## Maximal Reconvergence Status
24+
25+
| Testing Machine | DXC | Clang |
26+
|-----------------|-----|-------|
27+
| **Tier 1 Targets** |
28+
| Windows DirectX12 Intel GPU | [![DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-intel%20check-hlsl-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-dxc-d3d12.yaml) | [![Clang](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-intel%20check-hlsl-clang-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-clang-d3d12.yaml) |
29+
| Windows DirectX12 Warp (x64 LKG) | [![DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-amd%20check-hlsl-dxc-warp-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-warp-d3d12.yaml) | [![Clang](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-amd%20check-hlsl-clang-warp-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-warp-d3d12.yaml) |
30+
| Windows DirectX12 Warp (arm64 LKG) | [![DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-qc%20check-hlsl-dxc-warp-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-dxc-warp-d3d12.yaml) | [![Clang](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-qc%20check-hlsl-clang-warp-d3d12%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-qc-clang-warp-d3d12.yaml) |
31+
| Windows Vulkan Intel GPU | [![DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-intel%20check-hlsl-vk%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-dxc-vk.yaml) | [![Clang](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28windows-intel%20check-hlsl-clang-vk%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-clang-vk.yaml) |
32+
| **Tier 2 Targets** |
33+
| macOS Apple M1 | [![DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28macos%20check-hlsl-mtl%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/macos-dxc-mtl.yaml) | [![Clang & DXC](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/llvm/offload-test-suite/badges/Maximal%20Reconvergence%20Test%20Results%20%28macos%20check-hlsl-mtl%29.json)](https://github.com/llvm/offload-test-suite/actions/workflows/macos-clang-mtl.yaml) |
34+
35+
36+
2337
See the [Continuous Integration](docs/CI.md) documentation for the description of support tiers and builder hardware.
2438

2539
# Prerequisites

lib/Support/Check.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "llvm/Support/Error.h"
1717
#include "llvm/Support/raw_ostream.h"
1818
#include <cmath>
19+
#include <cstdlib>
1920
#include <sstream>
2021

2122
constexpr uint16_t Float16BitSign = 0x8000;
@@ -399,5 +400,26 @@ llvm::Error verifyResult(offloadtest::Result R) {
399400
}
400401
}
401402

403+
if (!std::getenv("OFFLOADTEST_SUPPRESS_DIFF")) {
404+
OS << "Expected:\n";
405+
llvm::yaml::Output YAMLOS(OS);
406+
YAMLOS << *R.ExpectedPtr;
407+
OS << "Got:\n";
408+
YAMLOS << *R.ActualPtr;
409+
410+
// Now print exact hex64 representations of each element of the
411+
// actual and expected buffers.
412+
413+
const std::string ExpectedBufferStr =
414+
getBufferStr(R.ExpectedPtr, R.ComparisonRule);
415+
const std::string ActualBufferStr =
416+
getBufferStr(R.ActualPtr, R.ComparisonRule);
417+
418+
OS << "Full Hex 64bit representation of Expected Buffer Values:\n"
419+
<< ExpectedBufferStr << "\n";
420+
OS << "Full Hex 64bit representation of Actual Buffer Values:\n"
421+
<< ActualBufferStr << "\n";
422+
}
423+
402424
return llvm::createStringError(Str.c_str());
403425
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#ifndef EXPERIMENTAL_USERS_CLUCIE_BALLOT_H_
2+
#define EXPERIMENTAL_USERS_CLUCIE_BALLOT_H_
3+
4+
#include <bitset>
5+
#include <cstdint>
6+
#include <ostream>
7+
8+
#include "VectorUtils.h"
9+
10+
namespace reconvergence {
11+
12+
struct Ballot : public std::bitset<128> {
13+
typedef std::bitset<128> super;
14+
15+
Ballot() : super() {}
16+
17+
Ballot(add_cref<super> ballot, uint32_t printbits = 128u)
18+
: super(ballot), m_bits(printbits) {}
19+
20+
Ballot(add_cref<UVec4> ballot, uint32_t printbits = 128u)
21+
: super(), m_bits(printbits) {
22+
*this = ballot;
23+
}
24+
25+
Ballot(uint64_t val, uint32_t printbits = 128u)
26+
: super(val), m_bits(printbits) {}
27+
28+
static Ballot withSetBit(uint32_t bit) {
29+
Ballot b;
30+
b.set(bit);
31+
return b;
32+
}
33+
34+
constexpr uint32_t size() const {
35+
return static_cast<uint32_t>(super::size());
36+
}
37+
38+
operator UVec4() const {
39+
UVec4 result;
40+
super ballot(*this);
41+
const super mask = 0xFFFFFFFF;
42+
for (uint32_t k = 0; k < 4u; ++k) {
43+
result[k] = static_cast<uint32_t>((ballot & mask).to_ulong());
44+
ballot >>= 32;
45+
}
46+
return result;
47+
}
48+
49+
add_ref<Ballot> operator=(add_cref<UVec4> vec) {
50+
for (uint32_t k = 0; k < 4u; ++k) {
51+
(*this) <<= 32;
52+
(*this) |= vec[3 - k];
53+
}
54+
return *this;
55+
}
56+
57+
protected:
58+
uint32_t m_bits;
59+
};
60+
} // namespace reconvergence
61+
62+
#endif // EXPERIMENTAL_USERS_CLUCIE_BALLOT_H_
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
#ifndef EXPERIMENTAL_USERS_CLUCIE_BALLOTS_H_
2+
#define EXPERIMENTAL_USERS_CLUCIE_BALLOTS_H_
3+
4+
#include <bitset>
5+
#include <cassert>
6+
#include <cstdint>
7+
#include <vector>
8+
9+
#include "Ballot.h"
10+
#include "VectorUtils.h"
11+
12+
namespace reconvergence {
13+
struct Ballots : protected std::vector<std::bitset<128>> {
14+
typedef std::vector<value_type> super;
15+
16+
static const constexpr uint32_t subgroupInvocationSize =
17+
static_cast<uint32_t>(value_type().size());
18+
19+
Ballots() : super() {}
20+
21+
explicit Ballots(uint32_t subgroupCount, const value_type &ballot = {})
22+
: super(subgroupCount) {
23+
if (ballot.any())
24+
*this = ballot;
25+
}
26+
27+
Ballots(const Ballots &other) : super(upcast(other)) {}
28+
29+
using super::operator[];
30+
31+
using super::at;
32+
33+
/**
34+
* @brief size method
35+
* @return Returns the number of bits that the Ballots holds.
36+
*/
37+
uint32_t size() const {
38+
return static_cast<uint32_t>(super::size() * subgroupInvocationSize);
39+
}
40+
41+
/**
42+
* @brief count method
43+
* @return Returns the number of bits that are set to true.
44+
*/
45+
uint32_t count() const {
46+
uint32_t n = 0u;
47+
for (const value_type &b : *this)
48+
n += static_cast<uint32_t>(b.count());
49+
return n;
50+
}
51+
52+
/**
53+
* @brief count method
54+
* @return Returns the number of bits that are set to true in given subgroup.
55+
*/
56+
uint32_t count(uint32_t subgroup) const {
57+
assert(subgroup < subgroupCount());
58+
return static_cast<uint32_t>(at(subgroup).count());
59+
}
60+
61+
uint32_t subgroupCount() const {
62+
return static_cast<uint32_t>(super::size());
63+
}
64+
65+
bool test(uint32_t bit) const {
66+
assert(bit < size());
67+
return at(bit / subgroupInvocationSize).test(bit % subgroupInvocationSize);
68+
}
69+
70+
bool set(uint32_t bit, bool value = true) {
71+
assert(bit <= size());
72+
const bool before = test(bit);
73+
at(bit / subgroupInvocationSize).set((bit % subgroupInvocationSize), value);
74+
return before;
75+
}
76+
77+
void full() {
78+
const uint32_t bb = size();
79+
for (uint32_t b = 0u; b < bb; ++b)
80+
set(b);
81+
}
82+
83+
Ballots &setn(uint32_t bits) {
84+
for (uint32_t i = 0u; i < bits; ++i)
85+
set(i);
86+
return *this;
87+
}
88+
89+
bool all() const {
90+
const uint32_t gg = subgroupCount();
91+
for (uint32_t g = 0u; g < gg; ++g) {
92+
if (false == at(g).all())
93+
return false;
94+
}
95+
return (gg != 0u);
96+
}
97+
98+
bool none() const {
99+
const uint32_t gg = subgroupCount();
100+
for (uint32_t g = 0u; g < gg; ++g) {
101+
if (false == at(g).none())
102+
return false;
103+
}
104+
return (gg != 0u);
105+
}
106+
107+
bool any() const {
108+
bool res = false;
109+
const uint32_t gg = subgroupCount();
110+
for (uint32_t g = 0u; g < gg; ++g)
111+
res |= super::at(g).any();
112+
return res;
113+
}
114+
115+
static uint32_t findBit(uint32_t otherFullyQualifiedInvocationID,
116+
uint32_t otherSubgroupSize) {
117+
return (((otherFullyQualifiedInvocationID / otherSubgroupSize) *
118+
subgroupInvocationSize) +
119+
(otherFullyQualifiedInvocationID % otherSubgroupSize));
120+
}
121+
122+
inline const super &upcast(const Ballots &other) const {
123+
return static_cast<const super &>(other);
124+
}
125+
126+
Ballots &operator&=(const Ballots &other) {
127+
assert(subgroupCount() == other.subgroupCount());
128+
const uint32_t gg = subgroupCount();
129+
for (uint32_t g = 0u; g < gg; ++g)
130+
super::at(g) = super::at(g) & upcast(other).at(g);
131+
return *this;
132+
}
133+
134+
Ballots operator&(const Ballots &other) const {
135+
Ballots res(*this);
136+
res &= other;
137+
return res;
138+
}
139+
140+
Ballots &operator|=(const Ballots &other) {
141+
assert(subgroupCount() == other.subgroupCount());
142+
const uint32_t gg = subgroupCount();
143+
for (uint32_t g = 0u; g < gg; ++g)
144+
super::at(g) = super::at(g) | upcast(other).at(g);
145+
return *this;
146+
}
147+
148+
Ballots operator|(const Ballots &other) const {
149+
Ballots res(*this);
150+
res |= other;
151+
return res;
152+
}
153+
154+
Ballots &operator<<=(uint32_t bits) { return ((*this) = ((*this) << bits)); }
155+
156+
Ballots operator<<(uint32_t bits) const {
157+
Ballots res(subgroupCount());
158+
if (bits < size() && bits != 0u) {
159+
for (uint32_t b = 0; b < size() - bits; ++b)
160+
res.set((b + bits), test(b));
161+
}
162+
return res;
163+
}
164+
165+
Ballots operator~() const {
166+
Ballots res(*this);
167+
const uint32_t gg = subgroupCount();
168+
for (uint32_t g = 0u; g < gg; ++g)
169+
res.at(g) = super::at(g).operator~();
170+
return res;
171+
}
172+
173+
bool operator==(const Ballots &other) const {
174+
if (super::size() == upcast(other).size()) {
175+
const uint32_t gg = subgroupCount();
176+
for (uint32_t g = 0u; g < gg; ++g) {
177+
if (at(g) != other[g])
178+
return false;
179+
}
180+
return true;
181+
}
182+
return false;
183+
}
184+
185+
Ballots &operator=(const Ballots &other) {
186+
assert((subgroupCount() == other.subgroupCount()));
187+
const uint32_t gg = subgroupCount();
188+
for (uint32_t g = 0u; g < gg; ++g)
189+
at(g) = other.at(g);
190+
return *this;
191+
}
192+
193+
Ballots &operator=(const value_type &forAllGroups) {
194+
assert(super::size() >= 1u);
195+
const uint32_t gg = subgroupCount();
196+
for (uint32_t g = 0u; g < gg; ++g)
197+
at(g) = forAllGroups;
198+
return *this;
199+
}
200+
};
201+
} // namespace reconvergence
202+
203+
#endif // EXPERIMENTAL_USERS_CLUCIE_BALLOTS_H_

0 commit comments

Comments
 (0)