Skip to content

Commit 6a4ed40

Browse files
Correct Host Mem Capabilities values
Related-To: NEO-5054 Signed-off-by: Filip Hazubski <[email protected]>
1 parent ceca8ab commit 6a4ed40

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

level_zero/core/source/device/device_imp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "shared/source/helpers/string.h"
2222
#include "shared/source/kernel/grf_config.h"
2323
#include "shared/source/memory_manager/memory_manager.h"
24+
#include "shared/source/os_interface/hw_info_config.h"
2425
#include "shared/source/os_interface/os_interface.h"
2526
#include "shared/source/os_interface/os_time.h"
2627
#include "shared/source/source_level_debugger/source_level_debugger.h"
@@ -275,8 +276,10 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
275276
}
276277

277278
ze_result_t DeviceImp::getMemoryAccessProperties(ze_device_memory_access_properties_t *pMemAccessProperties) {
279+
auto &hwInfo = this->getHwInfo();
280+
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
278281
pMemAccessProperties->hostAllocCapabilities =
279-
ZE_MEMORY_ACCESS_CAP_FLAG_RW | ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC;
282+
static_cast<ze_memory_access_cap_flags_t>(hwInfoConfig.getHostMemCapabilities(&hwInfo));
280283
pMemAccessProperties->deviceAllocCapabilities =
281284
ZE_MEMORY_ACCESS_CAP_FLAG_RW | ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC;
282285
pMemAccessProperties->sharedSingleDeviceAllocCapabilities =

shared/source/os_interface/hw_info_config.inl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ uint64_t HwInfoConfigHw<gfxProduct>::getSingleDeviceSharedMemCapabilities() {
6363
return (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS);
6464
}
6565

66-
template <PRODUCT_FAMILY gfxProduct>
67-
uint64_t HwInfoConfigHw<gfxProduct>::getHostMemCapabilitiesValue() {
68-
return (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS);
69-
}
70-
7166
template <PRODUCT_FAMILY gfxProduct>
7267
bool HwInfoConfigHw<gfxProduct>::getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) {
7368
return true;

shared/source/os_interface/hw_info_config_bdw_plus.inl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2020 Intel Corporation
2+
* Copyright (C) 2019-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -8,6 +8,12 @@
88
#include "shared/source/os_interface/hw_info_config.h"
99

1010
namespace NEO {
11+
12+
template <PRODUCT_FAMILY gfxProduct>
13+
uint64_t HwInfoConfigHw<gfxProduct>::getHostMemCapabilitiesValue() {
14+
return (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS);
15+
}
16+
1117
template <PRODUCT_FAMILY gfxProduct>
1218
uint64_t HwInfoConfigHw<gfxProduct>::getCrossDeviceSharedMemCapabilities() {
1319
return 0;

shared/source/unified_memory/usm_memory_support.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8+
#pragma once
9+
810
#include <cstdint>
911

1012
constexpr uint64_t UNIFIED_SHARED_MEMORY_ACCESS = 1 << 0;

0 commit comments

Comments
 (0)