Revert "Implement ze_device_memory_properties_t.maxClockRate"

This reverts commit c3b63bd8a2.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2021-04-17 09:46:34 +02:00
committed by Compute-Runtime-Automation
parent 61c08c052f
commit b5545c2a50
11 changed files with 60 additions and 37 deletions

View File

@@ -254,7 +254,29 @@ ze_result_t DeviceImp::getP2PProperties(ze_device_handle_t hPeerDevice,
}
ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_properties_t *pMemProperties) {
return getMemoryPropertiesImp(pCount, pMemProperties);
if (*pCount == 0) {
*pCount = 1;
return ZE_RESULT_SUCCESS;
}
if (*pCount > 1) {
*pCount = 1;
}
if (nullptr == pMemProperties) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
std::string memoryName;
getDeviceMemoryName(memoryName);
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, memoryName.c_str());
pMemProperties->maxClockRate = deviceInfo.maxClockFrequency;
pMemProperties->maxBusWidth = deviceInfo.addressBits;
pMemProperties->totalSize = deviceInfo.globalMemSize;
return ZE_RESULT_SUCCESS;
}
ze_result_t DeviceImp::getMemoryAccessProperties(ze_device_memory_access_properties_t *pMemAccessProperties) {

View File

@@ -86,7 +86,7 @@ struct DeviceImp : public Device {
ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) override;
ze_result_t mapOrdinalForAvailableEngineGroup(uint32_t *ordinal) override;
NEO::Device *getActiveDevice() const;
ze_result_t getMemoryPropertiesImp(uint32_t *pCount, ze_device_memory_properties_t *pMemProperties);
void getDeviceMemoryName(std::string &memoryName);
NEO::Device *neoDevice = nullptr;
bool isSubdevice = false;

View File

@@ -25,8 +25,7 @@ bool DeviceImp::isMultiDeviceCapable() const {
void DeviceImp::processAdditionalKernelProperties(NEO::HwHelper &hwHelper, ze_device_module_properties_t *pKernelProperties) {
}
ze_result_t DeviceImp::getMemoryPropertiesImp(uint32_t *pCount, ze_device_memory_properties_t *pMemProperties) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
void DeviceImp::getDeviceMemoryName(std::string &memoryName) {
memoryName = "DDR";
}
} // namespace L0

View File

@@ -24,7 +24,8 @@ HWTEST2_F(DeviceFixtureGen12LP, GivenTargetGen12LPaWhenGettingMemoryPropertiesTh
ze_device_memory_properties_t memProperties = {};
uint32_t pCount = 1u;
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, device->getMemoryProperties(&pCount, &memProperties));
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getMemoryProperties(&pCount, &memProperties));
EXPECT_EQ(0, strcmp(memProperties.name, "DDR"));
}
using DeviceQueueGroupTest = Test<DeviceFixture>;

View File

@@ -5,8 +5,6 @@
*
*/
#include "shared/source/os_interface/hw_info_config.h"
#include "test.h"
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
@@ -30,13 +28,6 @@ HWTEST2_F(DevicePropertyTest, givenReturnedDevicePropertiesThenExpectedPropertie
EXPECT_EQ(ZE_DEVICE_PROPERTY_FLAG_INTEGRATED, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
}
using DeviceHwConfigForMaxClkRateTest = Test<DeviceFixture>;
HWTEST2_F(DeviceHwConfigForMaxClkRateTest, givenValidHwConfidWhenCheckingMaxClkRateForGen9ThenZeroMaxClkRateReturned, IsGen9) {
auto hwInfo = *NEO::defaultHwInfo;
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_EQ(0u, hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo));
}
using DeviceQueueGroupTest = Test<DeviceFixture>;
HWTEST2_F(DeviceQueueGroupTest, givenCommandQueuePropertiesCallThenCorrectNumberOfGroupsIsReturned, IsGen9) {

View File

@@ -660,12 +660,41 @@ TEST_F(GlobalTimestampTest, whenGetGlobalTimestampCalledAndGetCpuTimeIsFalseRetu
}
using DeviceGetMemoryTests = DeviceTest;
using PlatformsNotSupported = IsAtMostProduct<IGFX_DG1>;
HWTEST2_F(DeviceGetMemoryTests, whenCallingGetMemoryPropertiesForUnsuportedPlatformsThenErrorIsReturned, PlatformsNotSupported) {
TEST_F(DeviceGetMemoryTests, whenCallingGetMemoryPropertiesWithCountZeroThenOneIsReturned) {
uint32_t count = 0;
ze_result_t res = device->getMemoryProperties(&count, nullptr);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, res);
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
EXPECT_EQ(1u, count);
}
TEST_F(DeviceGetMemoryTests, whenCallingGetMemoryPropertiesWithNullPtrThenInvalidArgumentIsReturned) {
uint32_t count = 0;
ze_result_t res = device->getMemoryProperties(&count, nullptr);
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
EXPECT_EQ(1u, count);
count++;
res = device->getMemoryProperties(&count, nullptr);
EXPECT_EQ(res, ZE_RESULT_ERROR_INVALID_ARGUMENT);
EXPECT_EQ(1u, count);
}
TEST_F(DeviceGetMemoryTests, whenCallingGetMemoryPropertiesWithNonNullPtrThenPropertiesAreReturned) {
uint32_t count = 0;
ze_result_t res = device->getMemoryProperties(&count, nullptr);
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
EXPECT_EQ(1u, count);
count++;
ze_device_memory_properties_t memProperties = {};
res = device->getMemoryProperties(&count, &memProperties);
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
EXPECT_EQ(1u, count);
EXPECT_EQ(memProperties.maxClockRate, this->neoDevice->getDeviceInfo().maxClockFrequency);
EXPECT_EQ(memProperties.maxBusWidth, this->neoDevice->getDeviceInfo().addressBits);
EXPECT_EQ(memProperties.totalSize, this->neoDevice->getDeviceInfo().globalMemSize);
}
struct DeviceHasNoDoubleFp64Test : public ::testing::Test {