Skip to content

Commit 4fd3ac6

Browse files
Add device memory name
Signed-off-by: Jitendra Sharma <[email protected]>
1 parent 516a905 commit 4fd3ac6

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

level_zero/core/source/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ set(L0_RUNTIME_SOURCES
3232
${CMAKE_CURRENT_SOURCE_DIR}/context/context_imp.h
3333
${CMAKE_CURRENT_SOURCE_DIR}/context/context.h
3434
${CMAKE_CURRENT_SOURCE_DIR}/debugger/debug_manager.cpp
35-
${CMAKE_CURRENT_SOURCE_DIR}/device${BRANCH_DIR_SUFFIX}/active_device.cpp
36-
${CMAKE_CURRENT_SOURCE_DIR}/device${BRANCH_DIR_SUFFIX}/additional_kernel_properties.cpp
35+
${CMAKE_CURRENT_SOURCE_DIR}/device${BRANCH_DIR_SUFFIX}/device_imp_helper.cpp
3736
${CMAKE_CURRENT_SOURCE_DIR}/device/device.h
3837
${CMAKE_CURRENT_SOURCE_DIR}/device/device_imp.cpp
3938
${CMAKE_CURRENT_SOURCE_DIR}/device/device_imp.h

level_zero/core/source/device/additional_kernel_properties.cpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

level_zero/core/source/device/device_imp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
264264

265265
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
266266

267+
std::string memoryName;
268+
getDeviceMemoryName(memoryName);
269+
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, memoryName.c_str());
267270
pMemProperties->maxClockRate = deviceInfo.maxClockFrequency;
268271
pMemProperties->maxBusWidth = deviceInfo.addressBits;
269272
pMemProperties->totalSize = deviceInfo.globalMemSize;

level_zero/core/source/device/device_imp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ struct DeviceImp : public Device {
8484
ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) override;
8585
ze_result_t mapOrdinalForAvailableEngineGroup(uint32_t *ordinal) override;
8686
NEO::Device *getActiveDevice() const;
87+
void getDeviceMemoryName(std::string &memoryName);
8788

8889
NEO::Device *neoDevice = nullptr;
8990
bool isSubdevice = false;

level_zero/core/source/device/active_device.cpp renamed to level_zero/core/source/device/device_imp_helper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ bool DeviceImp::isMultiDeviceCapable() const {
2222
return neoDevice->getNumAvailableDevices() > 1u;
2323
}
2424

25+
void DeviceImp::processAdditionalKernelProperties(NEO::HwHelper &hwHelper, ze_device_module_properties_t *pKernelProperties) {
26+
}
27+
28+
void DeviceImp::getDeviceMemoryName(std::string &memoryName) {
29+
memoryName = "DDR";
30+
}
2531
} // namespace L0

level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -18,6 +18,16 @@ using ::testing::_;
1818
using ::testing::AnyNumber;
1919
using ::testing::Return;
2020

21+
using DeviceFixtureGen12LP = Test<DeviceFixture>;
22+
23+
HWTEST2_F(DeviceFixtureGen12LP, GivenTargetGen12LPaWhenGettingMemoryPropertiesThenMemoryNameComesAsDDR, IsGen12LP) {
24+
ze_device_memory_properties_t memProperties = {};
25+
uint32_t pCount = 1u;
26+
27+
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getMemoryProperties(&pCount, &memProperties));
28+
EXPECT_EQ(0, strcmp(memProperties.name, "DDR"));
29+
}
30+
2131
using DeviceQueueGroupTest = Test<DeviceFixture>;
2232

2333
HWTEST2_F(DeviceQueueGroupTest,

0 commit comments

Comments
 (0)