mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
sys_ocldev

parent
0c9c55cd17
commit
c5f3fe5987
@ -55,7 +55,7 @@ struct DeviceGetCapsTest : public ::testing::Test {
|
||||
EXPECT_EQ(CL_MAKE_VERSION(1u, 1u, 0u), (++openclCWithVersionIterator)->version);
|
||||
EXPECT_EQ(CL_MAKE_VERSION(1u, 2u, 0u), (++openclCWithVersionIterator)->version);
|
||||
|
||||
if (clDevice.areOcl21FeaturesEnabled()) {
|
||||
if (clDevice.isOcl21Conformant()) {
|
||||
EXPECT_EQ(CL_MAKE_VERSION(2u, 0u, 0u), (++openclCWithVersionIterator)->version);
|
||||
}
|
||||
if (clDevice.getEnabledClVersion() == 30) {
|
||||
@ -251,6 +251,10 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
|
||||
if (device->getHardwareInfo().capabilityTable.supportsOcl21Features == false && is64bit) {
|
||||
EXPECT_TRUE(sharedCaps.force32BitAddressess);
|
||||
}
|
||||
|
||||
if (caps.numericClVersion == 21) {
|
||||
EXPECT_TRUE(device->isOcl21Conformant());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceGetCapsTest, givenDeviceWhenAskingForSubGroupSizesThenReturnCorrectValues) {
|
||||
|
@ -47,6 +47,27 @@ TEST_F(DeviceTest, WhenDeviceIsCreatedThenEnabledClVersionMatchesHardwareInfo) {
|
||||
EXPECT_EQ(version, version2);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, WhenDeviceIsCheckedForOcl21ConformanceThenCorrectValueIsReturned) {
|
||||
auto hwInfo = pClDevice->getHardwareInfo();
|
||||
for (auto supportsOcl21Features : ::testing::Bool()) {
|
||||
hwInfo.capabilityTable.supportsOcl21Features = supportsOcl21Features;
|
||||
for (auto supportsIfp : ::testing::Bool()) {
|
||||
hwInfo.capabilityTable.supportsIndependentForwardProgress = supportsIfp;
|
||||
for (auto supportsDeviceEnqueue : ::testing::Bool()) {
|
||||
hwInfo.capabilityTable.supportsDeviceEnqueue = supportsDeviceEnqueue;
|
||||
for (auto supportsPipes : ::testing::Bool()) {
|
||||
hwInfo.capabilityTable.supportsPipes = supportsPipes;
|
||||
|
||||
auto pClDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
||||
|
||||
auto expectedOcl21Conformance = (supportsOcl21Features && supportsIfp && supportsDeviceEnqueue && supportsPipes);
|
||||
EXPECT_EQ(expectedOcl21Conformance, pClDevice->isOcl21Conformant());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, givenDeviceWhenEngineIsCreatedThenSetInitialValueForTag) {
|
||||
for (auto &engine : pDevice->engines) {
|
||||
auto tagAddress = engine.commandStreamReceiver->getTagAddress();
|
||||
|
Reference in New Issue
Block a user