Revert "Disable cl_khr_subgroups extension"

This reverts commit 332e02ef27.

Change-Id: I913d0a00286f46b9c08913d925e1be08b31c367f
This commit is contained in:
Cetnerowski, Adam 2019-10-16 01:23:46 -07:00 committed by sys_ocldev
parent ecade0a153
commit dbad1d7081
6 changed files with 7 additions and 34 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -77,10 +77,7 @@ TEST_F(PlatformTest, PlatformgetAsCompilerEnabledExtensionsString) {
compilerExtensions = pPlatform->peekCompilerExtensions();
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl")));
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) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
}
}