Skip to content

Commit 23640b3

Browse files
authored
Execution Tests: Skip SM6.9 double precision tests when double precision not supported (#8117)
This PR updates the exec tests to skip in non-hlk environment for double precision SM6.9 tests when the device doesn't have double precision support. Verified via short circuiting the logic in doesDeviceSupportDouble. Resolves #7523
1 parent 63faca0 commit 23640b3

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tools/clang/unittests/HLSLExec/LongVectors.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ template <typename T> constexpr bool is16BitType() {
3535
std::is_same_v<T, HLSLHalf_t>;
3636
}
3737

38+
template <typename T> constexpr bool isDoubleType() {
39+
return std::is_same_v<T, double>;
40+
}
41+
3842
struct DataType {
3943
const char *HLSLTypeString;
4044
bool Is16Bit;
@@ -1938,6 +1942,15 @@ class DxilConf_SM69_Vectorized {
19381942
WEX::TestExecution::SetVerifyOutput VerifySettings(
19391943
WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
19401944

1945+
#ifndef _HLK_CONF
1946+
if (isDoubleType<T>() && !doesDeviceSupportDouble(D3DDevice)) {
1947+
WEX::Logging::Log::Comment(
1948+
L"Skipping test as device does not support double precision.");
1949+
WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped);
1950+
return;
1951+
}
1952+
#endif
1953+
19411954
UINT WaveSize = 0;
19421955

19431956
if (OverrideWaveLaneCount > 0) {
@@ -1962,6 +1975,16 @@ class DxilConf_SM69_Vectorized {
19621975
template <typename T, OpType OP> void runTest() {
19631976
WEX::TestExecution::SetVerifyOutput verifySettings(
19641977
WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
1978+
1979+
#ifndef _HLK_CONF
1980+
if (isDoubleType<T>() && !doesDeviceSupportDouble(D3DDevice)) {
1981+
WEX::Logging::Log::Comment(
1982+
L"Skipping test as device does not support double precision.");
1983+
WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped);
1984+
return;
1985+
}
1986+
#endif
1987+
19651988
dispatchTest<T, OP>(D3DDevice, VerboseLogging, OverrideInputSize);
19661989
}
19671990

0 commit comments

Comments
 (0)