mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Read MakeAllBuffersResident in release builds
Resolves: NEO-4302 Change-Id: I0ed8ca197235fc31f1b4b02155a8f4684e0601be Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
c8f8b9ad86
commit
ceaface1a9
@@ -23,6 +23,7 @@
|
|||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
#include "shared/source/memory_manager/memory_operations_handler.h"
|
#include "shared/source/memory_manager/memory_operations_handler.h"
|
||||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||||
|
#include "shared/source/utilities/debug_settings_reader_creator.h"
|
||||||
|
|
||||||
#include "opencl/source/cl_device/cl_device.h"
|
#include "opencl/source/cl_device/cl_device.h"
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||||
#include "opencl/source/helpers/validators.h"
|
#include "opencl/source/helpers/validators.h"
|
||||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||||
|
#include "opencl/source/os_interface/ocl_reg_path.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
@@ -357,7 +359,7 @@ Buffer *Buffer::create(Context *context,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugManager.flags.MakeAllBuffersResident.get()) {
|
if (isMakeAllBuffersResidentSet()) {
|
||||||
auto graphicsAllocation = pBuffer->getGraphicsAllocation();
|
auto graphicsAllocation = pBuffer->getGraphicsAllocation();
|
||||||
context->getDevice(0u)->getRootDeviceEnvironment().memoryOperationsInterface->makeResident(ArrayRef<GraphicsAllocation *>(&graphicsAllocation, 1));
|
context->getDevice(0u)->getRootDeviceEnvironment().memoryOperationsInterface->makeResident(ArrayRef<GraphicsAllocation *>(&graphicsAllocation, 1));
|
||||||
}
|
}
|
||||||
@@ -447,6 +449,19 @@ bool Buffer::isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties
|
|||||||
return (properties.flags.hostNoAccess || properties.flags.hostReadOnly) && properties.flags.readOnly;
|
return (properties.flags.hostNoAccess || properties.flags.hostReadOnly) && properties.flags.readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Buffer::isMakeAllBuffersResidentSet() {
|
||||||
|
static std::once_flag isMakeAllBufferResidentObtained;
|
||||||
|
|
||||||
|
std::call_once(isMakeAllBufferResidentObtained, [&]() {
|
||||||
|
auto value = DebugManager.flags.MakeAllBuffersResident.get();
|
||||||
|
auto settingsReader = SettingsReaderCreator::create(oclRegPath);
|
||||||
|
value |= settingsReader->getSetting("MakeAllBuffersResident", false);
|
||||||
|
DebugManager.flags.MakeAllBuffersResident.set(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
return DebugManager.flags.MakeAllBuffersResident.get();
|
||||||
|
}
|
||||||
|
|
||||||
Buffer *Buffer::createSubBuffer(cl_mem_flags flags,
|
Buffer *Buffer::createSubBuffer(cl_mem_flags flags,
|
||||||
cl_mem_flags_intel flagsIntel,
|
cl_mem_flags_intel flagsIntel,
|
||||||
const cl_buffer_region *region,
|
const cl_buffer_region *region,
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class Buffer : public MemObj {
|
|||||||
bool renderCompressedBuffers, bool localMemoryEnabled,
|
bool renderCompressedBuffers, bool localMemoryEnabled,
|
||||||
bool preferCompression);
|
bool preferCompression);
|
||||||
static bool isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties);
|
static bool isReadOnlyMemoryPermittedByFlags(const MemoryProperties &properties);
|
||||||
|
static bool isMakeAllBuffersResidentSet();
|
||||||
|
|
||||||
void transferData(void *dst, void *src, size_t copySize, size_t copyOffset);
|
void transferData(void *dst, void *src, size_t copySize, size_t copyOffset);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user