Add ClDevice::isOcl21Conformant function

Do not report support of OpenCl C 2.0 if device is not OpenCL 2.1 conformant.

Related-To: NEO-4368

Change-Id: I076d539506760953cc28eed39ff5e7585630df51
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-06-23 18:59:36 +02:00
committed by sys_ocldev
parent 0c9c55cd17
commit c5f3fe5987
5 changed files with 34 additions and 2 deletions

View File

@@ -88,6 +88,12 @@ unique_ptr_if_unused<ClDevice> ClDevice::decRefInternal() {
return pParentDevice->decRefInternal();
}
bool ClDevice::isOcl21Conformant() const {
auto &hwInfo = device.getHardwareInfo();
return (hwInfo.capabilityTable.supportsOcl21Features && hwInfo.capabilityTable.supportsDeviceEnqueue &&
hwInfo.capabilityTable.supportsPipes && hwInfo.capabilityTable.supportsIndependentForwardProgress);
}
void ClDevice::allocateSyncBufferHandler() {
TakeOwnershipWrapper<ClDevice> lock(*this);
if (syncBufferHandler.get() == nullptr) {

View File

@@ -57,6 +57,7 @@ class ClDevice : public BaseObject<_cl_device_id> {
unsigned int getEnabledClVersion() const { return enabledClVersion; };
bool areOcl21FeaturesEnabled() const { return ocl21FeaturesEnabled; };
bool isOcl21Conformant() const;
void retainApi();
unique_ptr_if_unused<ClDevice> releaseApi();

View File

@@ -420,7 +420,7 @@ void ClDevice::initializeOpenclCAllVersions() {
openClCVersion.version = CL_MAKE_VERSION(1, 2, 0);
deviceInfo.openclCAllVersions.push_back(openClCVersion);
if (ocl21FeaturesEnabled) {
if (isOcl21Conformant()) {
openClCVersion.version = CL_MAKE_VERSION(2, 0, 0);
deviceInfo.openclCAllVersions.push_back(openClCVersion);
}