Skip to content

Commit 2fcc0c9

Browse files
authored
[SPIRV] Add a means of turning off/on tests for specific spirv drivers (#678)
In the testing of KosmicKrisp Many tests for MoltenVK were XFAIL resulting in unexpected passes. This change makes those tests XFAIL for just MoltenVK. ## Results ``` OFFLOADTEST_GPU_NAME=KosmicKrisp ninja -C ../builds/llvm_relwithdebinfo_offload check-hlsl-clang-vk Total Discovered Tests: 329 Unsupported : 72 (21.88%) Passed : 186 (56.54%) Expectedly Failed: 71 (21.58%) OFFLOADTEST_GPU_NAME=KosmicKrisp ninja -C ../builds/llvm_relwithdebinfo_offload check-hlsl-vk Total Discovered Tests: 329 Unsupported : 59 (17.93%) Passed : 251 (76.29%) Expectedly Failed: 19 (5.78%) OFFLOADTEST_GPU_NAME=MoltenVK ninja -C ../builds/llvm_relwithdebinfo_offload check-hlsl-vk Total Discovered Tests: 329 Unsupported : 117 (35.56%) Passed : 189 (57.45%) Expectedly Failed: 23 (6.99%) OFFLOADTEST_GPU_NAME=MoltenVK ninja -C ../builds/llvm_relwithdebinfo_offload check-hlsl-clang-vk Total Discovered Tests: 329 Unsupported : 128 (38.91%) Passed : 134 (40.73%) Expectedly Failed: 67 (20.36%) ```
1 parent 09ad620 commit 2fcc0c9

30 files changed

Lines changed: 64 additions & 19 deletions

include/API/Device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct DeviceConfig {
3838
class Device {
3939
protected:
4040
std::string Description;
41+
std::string DriverName;
4142

4243
public:
4344
virtual const Capabilities &getCapabilities() = 0;
@@ -49,6 +50,7 @@ class Device {
4950
virtual ~Device() = 0;
5051

5152
llvm::StringRef getDescription() const { return Description; }
53+
llvm::StringRef getDriverName() const { return DriverName; }
5254

5355
static void registerDevice(std::shared_ptr<Device> D);
5456
static llvm::Error initialize(const DeviceConfig Config);

lib/API/VK/Device.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,19 @@ class VKDevice : public offloadtest::Device {
382382
const uint64_t DeviceNameSz =
383383
strnlen(Props.deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE);
384384
Description = std::string(Props.deviceName, DeviceNameSz);
385-
#if defined(__APPLE__) && defined(__aarch64__)
386385
DriverProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
387386
DriverProps.pNext = nullptr;
388387
Props2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
389388
Props2.pNext = &DriverProps;
390389
vkGetPhysicalDeviceProperties2(Device, &Props2);
391390
const uint64_t DriverNameSz =
392391
strnlen(DriverProps.driverName, VK_MAX_DRIVER_NAME_SIZE);
393-
Description +=
394-
" (" + std::string(DriverProps.driverName, DriverNameSz) + ")";
392+
DriverName = std::string(DriverProps.driverName, DriverNameSz);
393+
#if defined(__APPLE__) && defined(__aarch64__)
394+
// Apple silicon Macs may have multiple Vulkan drivers sharing one device
395+
// name. Include the driver name in the description to enable
396+
// adapter-regex matching.
397+
Description += " (" + DriverName + ")";
395398
#endif
396399
}
397400
VKDevice(const VKDevice &) = default;

test/Feature/CBuffer/array-dynamic-index.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ DescriptorSets:
7878
...
7979
#--- end
8080

81+
# Bug https://github.com/llvm/llvm-project/issues/177806
82+
# XFAIL: Vulkan && MoltenVK && Clang
83+
8184
# RUN: split-file %s %t
8285
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
8386
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/CBuffer/structs.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ DescriptorSets:
102102
# Bug https://github.com/llvm/llvm-project/issues/123968
103103
# XFAIL: Clang
104104

105+
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2595
106+
# XFAIL: Vulkan && MoltenVK
107+
105108
# RUN: split-file %s %t
106109
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_5 -Fo %t.o %t/source.hlsl
107110
# RUN: %offloader %t/pipeline.yaml %t.o | FileCheck %s

test/Feature/HLSLLib/cos.32.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DescriptorSets:
6262
#--- end
6363

6464
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2525
65-
# XFAIL: Vulkan && Darwin
65+
# XFAIL: Vulkan && MoltenVK
6666

6767
# RUN: split-file %s %t
6868
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/cosh.16.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DescriptorSets:
6262
#--- end
6363

6464
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2507
65-
# XFAIL: Vulkan && Darwin
65+
# XFAIL: Vulkan && MoltenVK
6666

6767
# REQUIRES: Half
6868
# RUN: split-file %s %t

test/Feature/HLSLLib/frac.32.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ DescriptorSets:
6161
...
6262
#--- end
6363

64+
# Bug: https://github.com/llvm/offload-test-suite/issues/682
65+
# XFAIL: Vulkan && KosmicKrisp
66+
# Expected: [ nan, nan, 0, 0, 0, 0.5, nan, 0, 0.71828, 0.599976, 0.611, nan ]
67+
# Result: [ nan, 0, 0, 0, 0, 0.5, 0, 0, 0.71828, 0.599976, 0.611, nan ]
68+
6469
# RUN: split-file %s %t
6570
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
6671
# RUN: %offloader %t/pipeline.yaml %t.o

test/Feature/HLSLLib/reflect.16.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ DescriptorSets:
187187
# REQUIRES: Half
188188

189189
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2524
190-
# XFAIL: Vulkan && Darwin
190+
# XFAIL: Vulkan && MoltenVK
191191

192192
# RUN: split-file %s %t
193193
# RUN: %dxc_target -T cs_6_5 -enable-16bit-types -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/refract.16.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ DescriptorSets:
188188
# REQUIRES: Half
189189

190190
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2524
191-
# XFAIL: Vulkan && Darwin
191+
# XFAIL: Vulkan && MoltenVK
192192

193193
# RUN: split-file %s %t
194194
# RUN: %dxc_target -T cs_6_5 -enable-16bit-types -Fo %t.o %t/source.hlsl

test/Feature/HLSLLib/sin.32.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DescriptorSets:
6262
#--- end
6363

6464
# Bug https://github.com/KhronosGroup/SPIRV-Cross/issues/2525
65-
# XFAIL: Vulkan && Darwin
65+
# XFAIL: Vulkan && MoltenVK
6666

6767
# RUN: split-file %s %t
6868
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl

0 commit comments

Comments
 (0)