Disable cl_khr_subgroups extension on gen12.

Resolves: NEO-3622

Change-Id: Idab55e5fb6a51ea0a08714f447bb9fce85f1dbcd
Signed-off-by: Piotr Zdunowski <piotr.zdunowski@intel.com>
This commit is contained in:
Piotr Zdunowski
2020-03-25 13:06:45 +01:00
committed by sys_ocldev
parent 3e881aed57
commit 52704236bd
10 changed files with 93 additions and 20 deletions

View File

@ -116,9 +116,14 @@ void ClDevice::initializeCaps() {
auto supportsVme = hwInfo.capabilityTable.supportsVme;
auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme;
deviceInfo.independentForwardProgress = false;
if (enabledClVersion >= 21) {
deviceInfo.independentForwardProgress = true;
deviceExtensions += "cl_khr_subgroups ";
if (hwHelper.isIndependentForwardProgressSupported()) {
deviceInfo.independentForwardProgress = true;
deviceExtensions += "cl_khr_subgroups ";
}
deviceExtensions += "cl_khr_il_program ";
if (supportsVme) {
deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation ";
@ -128,8 +133,6 @@ void ClDevice::initializeCaps() {
}
deviceExtensions += "cl_intel_spirv_subgroups ";
deviceExtensions += "cl_khr_spirv_no_integer_wrap_decoration ";
} else {
deviceInfo.independentForwardProgress = false;
}
if (enabledClVersion >= 20) {

View File

@ -150,6 +150,11 @@ std::string HwHelperHw<Family>::getExtensions() const {
return "cl_intel_subgroup_local_block_io ";
}
template <>
bool HwHelperHw<Family>::isIndependentForwardProgressSupported() {
return false;
}
template <>
void MemorySynchronizationCommands<Family>::setExtraCacheFlushFields(Family::PIPE_CONTROL *pipeControl) {
pipeControl->setHdcPipelineFlush(true);

View File

@ -140,12 +140,6 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_EQ(expectedDeviceSubgroups[i], sharedCaps.maxSubGroups[i]);
}
if (device->getEnabledClVersion() >= 21) {
EXPECT_TRUE(caps.independentForwardProgress != 0);
} else {
EXPECT_FALSE(caps.independentForwardProgress != 0);
}
EXPECT_EQ(sharedCaps.maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), caps.maxNumOfSubGroups);
EXPECT_EQ(1024u, caps.maxOnDeviceEvents);
@ -396,15 +390,6 @@ TEST_F(DeviceGetCapsTest, givenEnableSharingFormatQuerySetTrueAndEnabledMultiple
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_intel_sharing_format_query "))));
}
TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKhrSubgroupsExtension) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
}
TEST_F(DeviceGetCapsTest, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrSubgroupsExtension) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(20);

View File

@ -70,3 +70,23 @@ GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckExtensionsThenSubgroupLocalBlock
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_subgroup_local_block_io")));
}
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
} else {
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
}
}
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_TRUE(caps.independentForwardProgress != 0);
} else {
EXPECT_FALSE(caps.independentForwardProgress != 0);
}
}

View File

@ -34,6 +34,18 @@ TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenSubgroupLocalB
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_subgroup_local_block_io")));
}
TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
}
TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_FALSE(caps.independentForwardProgress);
}
TGLLPTEST_F(Gen12LpDeviceCaps, allSkusSupportCorrectlyRoundedDivideSqrt) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);

View File

@ -18,6 +18,25 @@ GEN8TEST_F(Gen8DeviceCaps, defaultPreemptionMode) {
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
}
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
} else {
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
}
}
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_TRUE(caps.independentForwardProgress != 0);
} else {
EXPECT_FALSE(caps.independentForwardProgress != 0);
}
}
GEN8TEST_F(Gen8DeviceCaps, kmdNotifyMechanism) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
EXPECT_EQ(50000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);

View File

@ -26,6 +26,25 @@ GEN9TEST_F(Gen9DeviceCaps, skuSpecificCaps) {
}
}
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
} else {
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
}
}
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
const auto &caps = pClDevice->getDeviceInfo();
if (pClDevice->getEnabledClVersion() >= 21) {
EXPECT_TRUE(caps.independentForwardProgress != 0);
} else {
EXPECT_FALSE(caps.independentForwardProgress != 0);
}
}
GEN9TEST_F(Gen9DeviceCaps, allSkusSupportCorrectlyRoundedDivideSqrt) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_NE(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);

View File

@ -96,8 +96,10 @@ TEST_F(PlatformTest, PlatformgetAsCompilerEnabledExtensionsString) {
pPlatform->initializeWithNewDevices();
auto compilerExtensions = pPlatform->getClDevice(0)->peekCompilerExtensions();
auto &hwHelper = HwHelper::get(pPlatform->getClDevice(0)->getHardwareInfo().platform.eRenderCoreFamily);
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl")));
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos && hwHelper.isIndependentForwardProgressSupported()) {
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
}
}

View File

@ -83,6 +83,7 @@ class HwHelper {
virtual bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const = 0;
virtual bool is3DPipelineSelectWARequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isFusedEuDispatchEnabled(const HardwareInfo &hwInfo) const = 0;
virtual bool isIndependentForwardProgressSupported() = 0;
static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo);
static uint32_t getEnginesCount(const HardwareInfo &hwInfo);
@ -214,6 +215,8 @@ class HwHelperHw : public HwHelper {
uint32_t getMinimalSIMDSize() override;
bool isIndependentForwardProgressSupported() override;
protected:
static const AuxTranslationMode defaultAuxTranslationMode;
HwHelperHw() = default;

View File

@ -66,6 +66,11 @@ uint32_t HwHelperHw<GfxFamily>::calculateAvailableThreadCount(PRODUCT_FAMILY fam
return threadsPerEu * euCount;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isIndependentForwardProgressSupported() {
return true;
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
}