Revert "Return 0 from fp64 queries when fp64 is unsupported"

This reverts commit 92df163d8e.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-12-08 16:11:41 +01:00
committed by Compute-Runtime-Automation
parent 818db03a68
commit d46a9dd347
2 changed files with 8 additions and 13 deletions

View File

@@ -46,24 +46,19 @@ void ClDevice::setupFp64Flags() {
deviceExtensions += "cl_khr_fp64 ";
deviceInfo.singleFpConfig = static_cast<cl_device_fp_config>(CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
deviceInfo.doubleFpConfig = defaultFpFlags;
deviceInfo.nativeVectorWidthDouble = 1;
deviceInfo.preferredVectorWidthDouble = 1;
} else if (DebugManager.flags.OverrideDefaultFP64Settings.get() == -1) {
if (hwInfo.capabilityTable.ftrSupportsFP64) {
deviceExtensions += "cl_khr_fp64 ";
deviceInfo.doubleFpConfig = defaultFpFlags;
deviceInfo.nativeVectorWidthDouble = 1;
deviceInfo.preferredVectorWidthDouble = 1;
} else {
deviceInfo.doubleFpConfig = 0;
deviceInfo.nativeVectorWidthDouble = 0;
deviceInfo.preferredVectorWidthDouble = 0;
}
deviceInfo.singleFpConfig = static_cast<cl_device_fp_config>(
hwInfo.capabilityTable.ftrSupports64BitMath
? CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT
: 0);
deviceInfo.doubleFpConfig = hwInfo.capabilityTable.ftrSupportsFP64
? defaultFpFlags
: 0;
}
}
@@ -272,12 +267,14 @@ void ClDevice::initializeCaps() {
deviceInfo.preferredVectorWidthInt = 4;
deviceInfo.preferredVectorWidthLong = 1;
deviceInfo.preferredVectorWidthFloat = 1;
deviceInfo.preferredVectorWidthDouble = 1;
deviceInfo.preferredVectorWidthHalf = 8;
deviceInfo.nativeVectorWidthChar = 16;
deviceInfo.nativeVectorWidthShort = 8;
deviceInfo.nativeVectorWidthInt = 4;
deviceInfo.nativeVectorWidthLong = 1;
deviceInfo.nativeVectorWidthFloat = 1;
deviceInfo.nativeVectorWidthDouble = 1;
deviceInfo.nativeVectorWidthHalf = 8;
deviceInfo.maxReadWriteImageArgs = hwInfo.capabilityTable.supportsImages ? 128 : 0;
deviceInfo.executionCapabilities = CL_EXEC_KERNEL;

View File

@@ -146,12 +146,14 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_EQ(4u, caps.preferredVectorWidthInt);
EXPECT_EQ(1u, caps.preferredVectorWidthLong);
EXPECT_EQ(1u, caps.preferredVectorWidthFloat);
EXPECT_EQ(1u, caps.preferredVectorWidthDouble);
EXPECT_EQ(8u, caps.preferredVectorWidthHalf);
EXPECT_EQ(16u, caps.nativeVectorWidthChar);
EXPECT_EQ(8u, caps.nativeVectorWidthShort);
EXPECT_EQ(4u, caps.nativeVectorWidthInt);
EXPECT_EQ(1u, caps.nativeVectorWidthLong);
EXPECT_EQ(1u, caps.nativeVectorWidthFloat);
EXPECT_EQ(1u, caps.nativeVectorWidthDouble);
EXPECT_EQ(8u, caps.nativeVectorWidthHalf);
EXPECT_EQ(1u, caps.linkerAvailable);
EXPECT_NE(0u, sharedCaps.globalMemCachelineSize);
@@ -994,15 +996,11 @@ TEST_F(DeviceGetCapsTest, givenFp64SupportForcedWhenCheckingFp64SupportThenFp64I
EXPECT_NE(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_NE(0u, caps.doubleFpConfig);
EXPECT_EQ(1u, fp64FeaturesCount);
EXPECT_NE(0u, caps.nativeVectorWidthDouble);
EXPECT_NE(0u, caps.preferredVectorWidthDouble);
EXPECT_TRUE(isValueSet(caps.singleFpConfig, CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT));
} else {
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
EXPECT_EQ(0u, fp64FeaturesCount);
EXPECT_EQ(0u, caps.nativeVectorWidthDouble);
EXPECT_EQ(0u, caps.preferredVectorWidthDouble);
EXPECT_FALSE(isValueSet(caps.singleFpConfig, CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT));
}
}