Disable cl_khr_subgroups extension

Related-To: NEO-3807

Change-Id: I03d6a72f897b883c10cff4f31c152d7c9f100b43
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz 2019-10-14 15:27:05 +02:00 committed by sys_ocldev
parent 09c775f347
commit 332e02ef27
6 changed files with 34 additions and 7 deletions

View File

@ -123,16 +123,18 @@ void Device::initializeCaps() {
auto supportsVme = hwInfo.capabilityTable.supportsVme; auto supportsVme = hwInfo.capabilityTable.supportsVme;
auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme; auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme;
deviceInfo.independentForwardProgress = false;
if (enabledClVersion >= 21) { if (enabledClVersion >= 21) {
deviceInfo.independentForwardProgress = true; if (hwHelper.allowsIndependentForwardProgress()) {
deviceExtensions += "cl_khr_subgroups "; deviceInfo.independentForwardProgress = true;
deviceExtensions += "cl_khr_subgroups ";
}
deviceExtensions += "cl_khr_il_program "; deviceExtensions += "cl_khr_il_program ";
deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation "; deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation ";
deviceExtensions += "cl_intel_spirv_media_block_io "; deviceExtensions += "cl_intel_spirv_media_block_io ";
deviceExtensions += "cl_intel_spirv_subgroups "; deviceExtensions += "cl_intel_spirv_subgroups ";
deviceExtensions += "cl_khr_spirv_no_integer_wrap_decoration "; deviceExtensions += "cl_khr_spirv_no_integer_wrap_decoration ";
} else {
deviceInfo.independentForwardProgress = false;
} }
if (enabledClVersion >= 20) { if (enabledClVersion >= 20) {

View File

@ -50,6 +50,11 @@ bool HwHelperHw<Family>::obtainRenderBufferCompressionPreference(const HardwareI
return Gen12LPHelpers::obtainRenderBufferCompressionPreference(hwInfo, size); return Gen12LPHelpers::obtainRenderBufferCompressionPreference(hwInfo, size);
} }
template <>
bool HwHelperHw<Family>::allowsIndependentForwardProgress() {
return false;
}
template <> template <>
void HwHelperHw<Family>::checkResourceCompatibility(Buffer *buffer, cl_int &errorCode) { void HwHelperHw<Family>::checkResourceCompatibility(Buffer *buffer, cl_int &errorCode) {
if (buffer->getGraphicsAllocation()->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) { if (buffer->getGraphicsAllocation()->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {

View File

@ -69,6 +69,7 @@ class HwHelper {
virtual uint32_t getMocsIndex(GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0; virtual uint32_t getMocsIndex(GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const = 0;
virtual bool requiresAuxResolves() const = 0; virtual bool requiresAuxResolves() const = 0;
virtual bool tilingAllowed(bool isSharedContext, const cl_image_desc &imgDesc, bool forceLinearStorage) = 0; virtual bool tilingAllowed(bool isSharedContext, const cl_image_desc &imgDesc, bool forceLinearStorage) = 0;
virtual bool allowsIndependentForwardProgress() = 0;
static constexpr uint32_t lowPriorityGpgpuEngineIndex = 1; static constexpr uint32_t lowPriorityGpgpuEngineIndex = 1;
@ -170,6 +171,8 @@ class HwHelperHw : public HwHelper {
bool tilingAllowed(bool isSharedContext, const cl_image_desc &imgDesc, bool forceLinearStorage) override; bool tilingAllowed(bool isSharedContext, const cl_image_desc &imgDesc, bool forceLinearStorage) override;
bool allowsIndependentForwardProgress() override;
protected: protected:
HwHelperHw() = default; HwHelperHw() = default;
}; };

View File

@ -233,4 +233,10 @@ bool HwHelperHw<GfxFamily>::tilingAllowed(bool isSharedContext, const cl_image_d
return !(imageType == CL_MEM_OBJECT_IMAGE1D || imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || return !(imageType == CL_MEM_OBJECT_IMAGE1D || imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY ||
imageType == CL_MEM_OBJECT_IMAGE1D_BUFFER || buffer); imageType == CL_MEM_OBJECT_IMAGE1D_BUFFER || buffer);
} }
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::allowsIndependentForwardProgress() {
return true;
}
} // namespace NEO } // namespace NEO

View File

@ -118,7 +118,9 @@ TEST(DeviceGetCapsTest, validate) {
EXPECT_EQ(16u, caps.maxSubGroups[1]); EXPECT_EQ(16u, caps.maxSubGroups[1]);
EXPECT_EQ(32u, caps.maxSubGroups[2]); EXPECT_EQ(32u, caps.maxSubGroups[2]);
if (device->getEnabledClVersion() >= 21) { auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily);
auto subGroupsSupported = hwHelper.allowsIndependentForwardProgress();
if (device->getEnabledClVersion() >= 21 && subGroupsSupported) {
EXPECT_TRUE(caps.independentForwardProgress != 0); EXPECT_TRUE(caps.independentForwardProgress != 0);
} else { } else {
EXPECT_FALSE(caps.independentForwardProgress != 0); EXPECT_FALSE(caps.independentForwardProgress != 0);
@ -355,7 +357,13 @@ TEST(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsC
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0])); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo(); const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups"))); auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily);
auto subGroupsSupported = hwHelper.allowsIndependentForwardProgress();
if (subGroupsSupported) {
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"))));
}
} }
TEST(DeviceGetCapsTest, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrSubgroupsExtension) { TEST(DeviceGetCapsTest, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrSubgroupsExtension) {

View File

@ -77,7 +77,10 @@ TEST_F(PlatformTest, PlatformgetAsCompilerEnabledExtensionsString) {
compilerExtensions = pPlatform->peekCompilerExtensions(); compilerExtensions = pPlatform->peekCompilerExtensions();
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl"))); EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl")));
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily);
auto subGroupsSupported = hwHelper.allowsIndependentForwardProgress();
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos && subGroupsSupported) {
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups"))); EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
} }
} }