Report cl_khr_integer_dot_product extension
Related-To: NEO-6206 With this commir OpenCL will report cl_khr_integer_dot_product extension in version 2. With all properties enabled. Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
parent
d29ed25f8b
commit
31983ec043
|
@ -287,5 +287,11 @@ const ProductHelper &ClDevice::getProductHelper() const {
|
||||||
const GTPinGfxCoreHelper &ClDevice::getGTPinGfxCoreHelper() const {
|
const GTPinGfxCoreHelper &ClDevice::getGTPinGfxCoreHelper() const {
|
||||||
return *gtpinGfxCoreHelper;
|
return *gtpinGfxCoreHelper;
|
||||||
}
|
}
|
||||||
|
cl_version ClDevice::getExtensionVersion(std::string name) {
|
||||||
|
if (name.compare("cl_khr_integer_dot_product") == 0)
|
||||||
|
return CL_MAKE_VERSION(2u, 0, 0);
|
||||||
|
else
|
||||||
|
return CL_MAKE_VERSION(1u, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
|
@ -136,6 +136,7 @@ class ClDevice : public BaseObject<_cl_device_id> {
|
||||||
const GTPinGfxCoreHelper &getGTPinGfxCoreHelper() const;
|
const GTPinGfxCoreHelper &getGTPinGfxCoreHelper() const;
|
||||||
|
|
||||||
std::unique_ptr<GTPinGfxCoreHelper> gtpinGfxCoreHelper;
|
std::unique_ptr<GTPinGfxCoreHelper> gtpinGfxCoreHelper;
|
||||||
|
cl_version getExtensionVersion(std::string name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initializeCaps();
|
void initializeCaps();
|
||||||
|
|
|
@ -405,6 +405,22 @@ void ClDevice::initializeCaps() {
|
||||||
deviceInfo.crossDeviceSharedMemCapabilities = productHelper.getCrossDeviceSharedMemCapabilities();
|
deviceInfo.crossDeviceSharedMemCapabilities = productHelper.getCrossDeviceSharedMemCapabilities();
|
||||||
deviceInfo.sharedSystemMemCapabilities = productHelper.getSharedSystemMemCapabilities(&hwInfo);
|
deviceInfo.sharedSystemMemCapabilities = productHelper.getSharedSystemMemCapabilities(&hwInfo);
|
||||||
|
|
||||||
|
deviceInfo.integerDotCapabilities = CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR | CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR;
|
||||||
|
deviceInfo.integerDotAccelerationProperties8Bit = {
|
||||||
|
CL_TRUE, // signed_accelerated;
|
||||||
|
CL_TRUE, // unsigned_accelerated;
|
||||||
|
CL_TRUE, // mixed_signedness_accelerated;
|
||||||
|
CL_TRUE, // accumulating_saturating_signed_accelerated;
|
||||||
|
CL_TRUE, // accumulating_saturating_unsigned_accelerated;
|
||||||
|
CL_TRUE}; // accumulating_saturating_mixed_signedness_accelerated;
|
||||||
|
deviceInfo.integerDotAccelerationProperties4x8BitPacked = {
|
||||||
|
CL_TRUE, // signed_accelerated;
|
||||||
|
CL_TRUE, // unsigned_accelerated;
|
||||||
|
CL_TRUE, // mixed_signedness_accelerated;
|
||||||
|
CL_TRUE, // accumulating_saturating_signed_accelerated;
|
||||||
|
CL_TRUE, // accumulating_saturating_unsigned_accelerated;
|
||||||
|
CL_TRUE}; // accumulating_saturating_mixed_signedness_accelerated;
|
||||||
|
|
||||||
initializeOsSpecificCaps();
|
initializeOsSpecificCaps();
|
||||||
getOpenclCFeaturesList(hwInfo, deviceInfo.openclCFeatures);
|
getOpenclCFeaturesList(hwInfo, deviceInfo.openclCFeatures);
|
||||||
}
|
}
|
||||||
|
@ -416,7 +432,7 @@ void ClDevice::initializeExtensionsWithVersion() {
|
||||||
deviceInfo.extensionsWithVersion.reserve(deviceExtensionsVector.size());
|
deviceInfo.extensionsWithVersion.reserve(deviceExtensionsVector.size());
|
||||||
for (auto deviceExtension : deviceExtensionsVector) {
|
for (auto deviceExtension : deviceExtensionsVector) {
|
||||||
cl_name_version deviceExtensionWithVersion;
|
cl_name_version deviceExtensionWithVersion;
|
||||||
deviceExtensionWithVersion.version = CL_MAKE_VERSION(1, 0, 0);
|
deviceExtensionWithVersion.version = getExtensionVersion(deviceExtension);
|
||||||
strcpy_s(deviceExtensionWithVersion.name, CL_NAME_VERSION_MAX_NAME_SIZE, deviceExtension.c_str());
|
strcpy_s(deviceExtensionWithVersion.name, CL_NAME_VERSION_MAX_NAME_SIZE, deviceExtension.c_str());
|
||||||
deviceInfo.extensionsWithVersion.push_back(deviceExtensionWithVersion);
|
deviceInfo.extensionsWithVersion.push_back(deviceExtensionWithVersion);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,6 +180,9 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName,
|
||||||
case CL_DEVICE_VENDOR_ID: getCap<CL_DEVICE_VENDOR_ID >(src, srcSize, retSize); break;
|
case CL_DEVICE_VENDOR_ID: getCap<CL_DEVICE_VENDOR_ID >(src, srcSize, retSize); break;
|
||||||
case CL_DEVICE_VERSION: getStr<CL_DEVICE_VERSION >(src, srcSize, retSize); break;
|
case CL_DEVICE_VERSION: getStr<CL_DEVICE_VERSION >(src, srcSize, retSize); break;
|
||||||
case CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT: getCap<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT >(src, srcSize, retSize); break;
|
case CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT: getCap<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT >(src, srcSize, retSize); break;
|
||||||
|
case CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR: getCap<CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR >(src, srcSize, retSize); break;
|
||||||
|
case CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR: getCap<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR >(src, srcSize, retSize); break;
|
||||||
|
case CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR: getCap<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR >(src, srcSize, retSize); break;
|
||||||
case CL_DRIVER_VERSION: getStr<CL_DRIVER_VERSION >(src, srcSize, retSize); break; // clang-format on
|
case CL_DRIVER_VERSION: getStr<CL_DRIVER_VERSION >(src, srcSize, retSize); break; // clang-format on
|
||||||
case CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES:
|
case CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES:
|
||||||
if (paramValueSize == sizeof(cl_bool)) {
|
if (paramValueSize == sizeof(cl_bool)) {
|
||||||
|
|
|
@ -142,6 +142,9 @@ struct ClDeviceInfo {
|
||||||
cl_unified_shared_memory_capabilities_intel crossDeviceSharedMemCapabilities;
|
cl_unified_shared_memory_capabilities_intel crossDeviceSharedMemCapabilities;
|
||||||
cl_unified_shared_memory_capabilities_intel sharedSystemMemCapabilities;
|
cl_unified_shared_memory_capabilities_intel sharedSystemMemCapabilities;
|
||||||
StackVec<uint32_t, 4> supportedThreadArbitrationPolicies;
|
StackVec<uint32_t, 4> supportedThreadArbitrationPolicies;
|
||||||
|
cl_device_integer_dot_product_capabilities_khr integerDotCapabilities;
|
||||||
|
cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8Bit;
|
||||||
|
cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties4x8BitPacked;
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@ template<> struct Map<CL_DEVICE_MAX_WRITE_IMAGE_ARGS > : public MapBa
|
||||||
template<> struct Map<CL_DEVICE_PRINTF_BUFFER_SIZE > : public MapBase<CL_DEVICE_PRINTF_BUFFER_SIZE, size_t, &DeviceInfo::printfBufferSize> {};
|
template<> struct Map<CL_DEVICE_PRINTF_BUFFER_SIZE > : public MapBase<CL_DEVICE_PRINTF_BUFFER_SIZE, size_t, &DeviceInfo::printfBufferSize> {};
|
||||||
template<> struct Map<CL_DEVICE_PROFILING_TIMER_RESOLUTION > : public MapBase<CL_DEVICE_PROFILING_TIMER_RESOLUTION, size_t, &DeviceInfo::outProfilingTimerResolution> {};
|
template<> struct Map<CL_DEVICE_PROFILING_TIMER_RESOLUTION > : public MapBase<CL_DEVICE_PROFILING_TIMER_RESOLUTION, size_t, &DeviceInfo::outProfilingTimerResolution> {};
|
||||||
template<> struct Map<CL_DEVICE_VENDOR_ID > : public MapBase<CL_DEVICE_VENDOR_ID, uint32_t, &DeviceInfo::vendorId> {};
|
template<> struct Map<CL_DEVICE_VENDOR_ID > : public MapBase<CL_DEVICE_VENDOR_ID, uint32_t, &DeviceInfo::vendorId> {};
|
||||||
|
|
||||||
template<> struct Map<CL_DEVICE_ATOMIC_FENCE_CAPABILITIES > : public ClMapBase<CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, uint64_t, &ClDeviceInfo::atomicFenceCapabilities> {};
|
template<> struct Map<CL_DEVICE_ATOMIC_FENCE_CAPABILITIES > : public ClMapBase<CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, uint64_t, &ClDeviceInfo::atomicFenceCapabilities> {};
|
||||||
template<> struct Map<CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES > : public ClMapBase<CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, uint64_t, &ClDeviceInfo::atomicMemoryCapabilities> {};
|
template<> struct Map<CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES > : public ClMapBase<CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, uint64_t, &ClDeviceInfo::atomicMemoryCapabilities> {};
|
||||||
template<> struct Map<CL_DEVICE_AVAILABLE > : public ClMapBase<CL_DEVICE_AVAILABLE, uint32_t, &ClDeviceInfo::deviceAvailable> {};
|
template<> struct Map<CL_DEVICE_AVAILABLE > : public ClMapBase<CL_DEVICE_AVAILABLE, uint32_t, &ClDeviceInfo::deviceAvailable> {};
|
||||||
|
@ -175,6 +174,10 @@ template<> struct Map<CL_DEVICE_VERSION > :
|
||||||
template<> struct Map<CL_DRIVER_VERSION > : public ClMapBase<CL_DRIVER_VERSION, const char *, &ClDeviceInfo::driverVersion> {};
|
template<> struct Map<CL_DRIVER_VERSION > : public ClMapBase<CL_DRIVER_VERSION, const char *, &ClDeviceInfo::driverVersion> {};
|
||||||
template<> struct Map<CL_DRIVER_UUID_KHR > : public ClMapBase<CL_DRIVER_UUID_KHR, const char *, &ClDeviceInfo::driverVersion> {};
|
template<> struct Map<CL_DRIVER_UUID_KHR > : public ClMapBase<CL_DRIVER_UUID_KHR, const char *, &ClDeviceInfo::driverVersion> {};
|
||||||
template<> struct Map<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT > : public ClMapBase<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT, uint32_t, &ClDeviceInfo::workGroupCollectiveFunctionsSupport> {};
|
template<> struct Map<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT > : public ClMapBase<CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT, uint32_t, &ClDeviceInfo::workGroupCollectiveFunctionsSupport> {};
|
||||||
|
template<> struct Map<CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR > : public ClMapBase<CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR, cl_device_integer_dot_product_capabilities_khr, &ClDeviceInfo::integerDotCapabilities> {};
|
||||||
|
template<> struct Map<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR > : public ClMapBase<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR, cl_device_integer_dot_product_acceleration_properties_khr, &ClDeviceInfo::integerDotAccelerationProperties4x8BitPacked> {};
|
||||||
|
template<> struct Map<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR > : public ClMapBase<CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR, cl_device_integer_dot_product_acceleration_properties_khr, &ClDeviceInfo::integerDotAccelerationProperties8Bit> {};
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
} // namespace ClDeviceInfoTable
|
} // namespace ClDeviceInfoTable
|
||||||
|
|
|
@ -283,7 +283,8 @@ TEST_F(clGetDeviceInfoTests, GivenClDeviceExtensionsParamWhenGettingDeviceInfoTh
|
||||||
"cl_khr_subgroup_clustered_reduce ",
|
"cl_khr_subgroup_clustered_reduce ",
|
||||||
"cl_intel_device_attribute_query ",
|
"cl_intel_device_attribute_query ",
|
||||||
"cl_khr_suggested_local_work_size ",
|
"cl_khr_suggested_local_work_size ",
|
||||||
"cl_intel_split_work_group_barrier "};
|
"cl_intel_split_work_group_barrier ",
|
||||||
|
"cl_khr_integer_dot_product "};
|
||||||
|
|
||||||
for (auto extension : supportedExtensions) {
|
for (auto extension : supportedExtensions) {
|
||||||
auto foundOffset = extensionString.find(extension);
|
auto foundOffset = extensionString.find(extension);
|
||||||
|
@ -454,4 +455,52 @@ INSTANTIATE_TEST_CASE_P(
|
||||||
GetDeviceInfoVectorWidth,
|
GetDeviceInfoVectorWidth,
|
||||||
testing::ValuesIn(devicePreferredVector));
|
testing::ValuesIn(devicePreferredVector));
|
||||||
|
|
||||||
|
TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDotCapsThenCorrectValuesAreSet) {
|
||||||
|
size_t paramRetSize = 0;
|
||||||
|
cl_device_integer_dot_product_capabilities_khr integerDotCapabilities{};
|
||||||
|
|
||||||
|
clGetDeviceInfo(
|
||||||
|
testedClDevice,
|
||||||
|
CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR,
|
||||||
|
sizeof(integerDotCapabilities),
|
||||||
|
&integerDotCapabilities,
|
||||||
|
¶mRetSize);
|
||||||
|
EXPECT_TRUE((integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR) && (integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDot8BitPropertiesThenCorrectValuesAreSet) {
|
||||||
|
size_t paramRetSize = 0;
|
||||||
|
cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8Bit{};
|
||||||
|
|
||||||
|
clGetDeviceInfo(
|
||||||
|
testedClDevice,
|
||||||
|
CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR,
|
||||||
|
sizeof(integerDotAccelerationProperties8Bit),
|
||||||
|
&integerDotAccelerationProperties8Bit,
|
||||||
|
¶mRetSize);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.accumulating_saturating_mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.accumulating_saturating_signed_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.accumulating_saturating_unsigned_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.signed_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8Bit.unsigned_accelerated);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(clGetDeviceInfoTests, givenClDeviceWhenGetInfoForIntegerDot8BitPackedPropertiesThenCorrectValuesAreSet) {
|
||||||
|
size_t paramRetSize = 0;
|
||||||
|
cl_device_integer_dot_product_acceleration_properties_khr integerDotAccelerationProperties8BitPacked{};
|
||||||
|
|
||||||
|
clGetDeviceInfo(
|
||||||
|
testedClDevice,
|
||||||
|
CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR,
|
||||||
|
sizeof(integerDotAccelerationProperties8BitPacked),
|
||||||
|
&integerDotAccelerationProperties8BitPacked,
|
||||||
|
¶mRetSize);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.accumulating_saturating_mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.accumulating_saturating_signed_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.accumulating_saturating_unsigned_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.signed_accelerated);
|
||||||
|
EXPECT_TRUE(integerDotAccelerationProperties8BitPacked.unsigned_accelerated);
|
||||||
|
}
|
||||||
} // namespace ULT
|
} // namespace ULT
|
||||||
|
|
|
@ -204,7 +204,11 @@ TEST_F(clGetPlatformInfoTests, WhenCheckingPlatformExtensionsWithVersionThenThey
|
||||||
|
|
||||||
std::string allExtensions;
|
std::string allExtensions;
|
||||||
for (size_t i = 0; i < extensionsCount; i++) {
|
for (size_t i = 0; i < extensionsCount; i++) {
|
||||||
EXPECT_EQ(CL_MAKE_VERSION(1u, 0u, 0u), platformExtensionsWithVersion[i].version);
|
if (strcmp(platformExtensionsWithVersion[i].name, "cl_khr_integer_dot_product") == 0) {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), platformExtensionsWithVersion[i].version);
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), platformExtensionsWithVersion[i].version);
|
||||||
|
}
|
||||||
allExtensions += platformExtensionsWithVersion[i].name;
|
allExtensions += platformExtensionsWithVersion[i].name;
|
||||||
allExtensions += " ";
|
allExtensions += " ";
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,8 @@ struct DeviceGetCapsTest : public ::testing::Test {
|
||||||
EXPECT_STREQ("__opencl_c_generic_address_space", (++openclCFeatureIterator)->name);
|
EXPECT_STREQ("__opencl_c_generic_address_space", (++openclCFeatureIterator)->name);
|
||||||
EXPECT_STREQ("__opencl_c_program_scope_global_variables", (++openclCFeatureIterator)->name);
|
EXPECT_STREQ("__opencl_c_program_scope_global_variables", (++openclCFeatureIterator)->name);
|
||||||
EXPECT_STREQ("__opencl_c_work_group_collective_functions", (++openclCFeatureIterator)->name);
|
EXPECT_STREQ("__opencl_c_work_group_collective_functions", (++openclCFeatureIterator)->name);
|
||||||
|
EXPECT_STREQ("__opencl_c_integer_dot_product_input_4x8bit", (++openclCFeatureIterator)->name);
|
||||||
|
EXPECT_STREQ("__opencl_c_integer_dot_product_input_4x8bit_packed", (++openclCFeatureIterator)->name);
|
||||||
EXPECT_STREQ("__opencl_c_subgroups", (++openclCFeatureIterator)->name);
|
EXPECT_STREQ("__opencl_c_subgroups", (++openclCFeatureIterator)->name);
|
||||||
if (hwInfo.capabilityTable.supportsFloatAtomics) {
|
if (hwInfo.capabilityTable.supportsFloatAtomics) {
|
||||||
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_add", (++openclCFeatureIterator)->name);
|
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_add", (++openclCFeatureIterator)->name);
|
||||||
|
@ -965,7 +967,11 @@ TEST_F(DeviceGetCapsTest, givenDefaultDeviceWhenQueriedForExtensionsWithVersionT
|
||||||
EXPECT_FALSE(pClDevice->getDeviceInfo().extensionsWithVersion.empty());
|
EXPECT_FALSE(pClDevice->getDeviceInfo().extensionsWithVersion.empty());
|
||||||
|
|
||||||
for (auto extensionWithVersion : pClDevice->getDeviceInfo().extensionsWithVersion) {
|
for (auto extensionWithVersion : pClDevice->getDeviceInfo().extensionsWithVersion) {
|
||||||
EXPECT_EQ(CL_MAKE_VERSION(1u, 0u, 0u), extensionWithVersion.version);
|
if (strcmp(extensionWithVersion.name, "cl_khr_integer_dot_product") == 0) {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), extensionWithVersion.version);
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), extensionWithVersion.version);
|
||||||
|
}
|
||||||
allExtensions += extensionWithVersion.name;
|
allExtensions += extensionWithVersion.name;
|
||||||
allExtensions += " ";
|
allExtensions += " ";
|
||||||
}
|
}
|
||||||
|
@ -973,6 +979,69 @@ TEST_F(DeviceGetCapsTest, givenDefaultDeviceWhenQueriedForExtensionsWithVersionT
|
||||||
EXPECT_STREQ(pClDevice->deviceExtensions.c_str(), allExtensions.c_str());
|
EXPECT_STREQ(pClDevice->deviceExtensions.c_str(), allExtensions.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenGetExtensionsVersionCalledThenCorrectVersionIsSet) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->getDeviceInfo(CL_DEVICE_EXTENSIONS_WITH_VERSION, 0, nullptr, nullptr);
|
||||||
|
for (auto extensionWithVersion : pClDevice->getDeviceInfo().extensionsWithVersion) {
|
||||||
|
if (strcmp(extensionWithVersion.name, "cl_khr_integer_dot_product") == 0) {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(2u, 0, 0), pClDevice->getExtensionVersion(std::string(extensionWithVersion.name)));
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(CL_MAKE_VERSION(1u, 0, 0), pClDevice->getExtensionVersion(std::string(extensionWithVersion.name)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenIntegerDotInput4xBitCapIsSet) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->initializeCaps();
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenIntegerDotInput4xBitPackedCapIsSet) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->initializeCaps();
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotCapabilities & CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenAllFieldsInIntegerDotAccPropertiesAreTrue) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->initializeCaps();
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_signed_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.accumulating_saturating_unsigned_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.signed_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties8Bit.unsigned_accelerated);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenCapsInitializedThenAllFieldsInIntegerDotAccPackedPropertiesAreTrue) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->initializeCaps();
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_signed_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.accumulating_saturating_unsigned_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.mixed_signedness_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.signed_accelerated);
|
||||||
|
EXPECT_TRUE(pClDevice->deviceInfo.integerDotAccelerationProperties4x8BitPacked.unsigned_accelerated);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(DeviceGetCapsTest, givenClDeviceWhenEnableIntegerDotExtensionEnalbedThenDotIntegerExtensionIsInExtensionString) {
|
||||||
|
UltClDeviceFactory deviceFactory{1, 0};
|
||||||
|
auto pClDevice = deviceFactory.rootDevices[0];
|
||||||
|
pClDevice->initializeCaps();
|
||||||
|
static const char *const supportedExtensions[] = {
|
||||||
|
"cl_khr_integer_dot_product "};
|
||||||
|
for (auto extension : supportedExtensions) {
|
||||||
|
auto foundOffset = pClDevice->deviceExtensions.find(extension);
|
||||||
|
EXPECT_TRUE(foundOffset != std::string::npos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(DeviceGetCapsTest, givenFp64SupportForcedWhenCheckingFp64SupportThenFp64IsCorrectlyReported) {
|
TEST_F(DeviceGetCapsTest, givenFp64SupportForcedWhenCheckingFp64SupportThenFp64IsCorrectlyReported) {
|
||||||
DebugManagerStateRestore dbgRestorer;
|
DebugManagerStateRestore dbgRestorer;
|
||||||
int32_t overrideDefaultFP64SettingsValues[] = {-1, 0, 1};
|
int32_t overrideDefaultFP64SettingsValues[] = {-1, 0, 1};
|
||||||
|
|
|
@ -56,6 +56,12 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
|
||||||
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_work_group_collective_functions");
|
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_work_group_collective_functions");
|
||||||
openclCFeatures.push_back(openClCFeature);
|
openclCFeatures.push_back(openClCFeature);
|
||||||
|
|
||||||
|
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_integer_dot_product_input_4x8bit");
|
||||||
|
openclCFeatures.push_back(openClCFeature);
|
||||||
|
|
||||||
|
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_integer_dot_product_input_4x8bit_packed");
|
||||||
|
openclCFeatures.push_back(openClCFeature);
|
||||||
|
|
||||||
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_subgroups");
|
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_subgroups");
|
||||||
openclCFeatures.push_back(openClCFeature);
|
openclCFeatures.push_back(openClCFeature);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,8 @@ std::string CompilerProductHelperHw<gfxProduct>::getDeviceExtensions(const Hardw
|
||||||
"cl_khr_subgroup_clustered_reduce "
|
"cl_khr_subgroup_clustered_reduce "
|
||||||
"cl_intel_device_attribute_query "
|
"cl_intel_device_attribute_query "
|
||||||
"cl_khr_suggested_local_work_size "
|
"cl_khr_suggested_local_work_size "
|
||||||
"cl_intel_split_work_group_barrier ";
|
"cl_intel_split_work_group_barrier "
|
||||||
|
"cl_khr_integer_dot_product ";
|
||||||
|
|
||||||
auto supportsFp64 = hwInfo.capabilityTable.ftrSupportsFP64;
|
auto supportsFp64 = hwInfo.capabilityTable.ftrSupportsFP64;
|
||||||
if (DebugManager.flags.OverrideDefaultFP64Settings.get() != -1) {
|
if (DebugManager.flags.OverrideDefaultFP64Settings.get() != -1) {
|
||||||
|
|
Loading…
Reference in New Issue