mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Make CPU copy for read buffer when host ptr is write combined on DG2
With this commit on DG2 32bit driver will check if passed host ptr for clEnqueueReadBuffer is write combined memory. If check will be true copy will be make on CPU. Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cdfe2ce8ad
commit
213dc2fe24
@@ -93,6 +93,7 @@ set(NEO_CORE_OS_INTERFACE_WDDM
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm_defs.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm/wddm_residency_logger.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_${DRIVER_MODEL}.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm/um_km_data_translator.cpp
|
||||
|
||||
@@ -886,7 +886,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
|
||||
}
|
||||
|
||||
// dummy read
|
||||
//cacheable = *localVariablePointer;
|
||||
// cacheable = *localVariablePointer;
|
||||
|
||||
_mm_lfence();
|
||||
timestamp0 = __rdtsc();
|
||||
@@ -904,7 +904,7 @@ bool WddmMemoryManager::isCpuCopyRequired(const void *ptr) {
|
||||
fastestLocalRead = localVariableReadDelta;
|
||||
}
|
||||
// dummy read
|
||||
//cacheable = *volatileInputPtr;
|
||||
// cacheable = *volatileInputPtr;
|
||||
|
||||
_mm_lfence();
|
||||
timestamp0 = __rdtsc();
|
||||
|
||||
@@ -71,6 +71,7 @@ class WddmMemoryManager : public MemoryManager {
|
||||
void *reserveCpuAddressRange(size_t size, uint32_t rootDeviceIndex) override;
|
||||
void releaseReservedCpuAddressRange(void *reserved, size_t size, uint32_t rootDeviceIndex) override;
|
||||
bool isCpuCopyRequired(const void *ptr) override;
|
||||
bool isWCMemory(const void *ptr) override;
|
||||
|
||||
AddressRange reserveGpuAddress(size_t size, uint32_t rootDeviceIndex) override { return AddressRange{0, 0}; };
|
||||
void freeGpuAddress(AddressRange addressRange, uint32_t rootDeviceIndex) override{};
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
||||
|
||||
namespace NEO {
|
||||
bool WddmMemoryManager::isWCMemory(const void *ptr) {
|
||||
return false;
|
||||
}
|
||||
} // namespace NEO
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
||||
|
||||
#include <winnt.h>
|
||||
|
||||
namespace NEO {
|
||||
constexpr uint32_t pageWriteCombine = 0x400;
|
||||
|
||||
bool WddmMemoryManager::isWCMemory(const void *ptr) {
|
||||
MEMORY_BASIC_INFORMATION info;
|
||||
VirtualQuery(ptr, &info, sizeof(info));
|
||||
return info.AllocationProtect & pageWriteCombine;
|
||||
}
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user