Add GraphicsAllocation::isLockable method

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-04-13 17:23:36 +00:00
committed by Compute-Runtime-Automation
parent 83a1a52bdc
commit 9026362b76
2 changed files with 48 additions and 1 deletions

View File

@@ -98,7 +98,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
DEBUG_MODULE_AREA,
UNIFIED_SHARED_MEMORY,
WORK_PARTITION_SURFACE,
GPU_TIMESTAMP_DEVICE_BUFFER
GPU_TIMESTAMP_DEVICE_BUFFER,
COUNT
};
~GraphicsAllocation() override;
@@ -229,6 +230,14 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
allocationType == AllocationType::DEBUG_CONTEXT_SAVE_AREA ||
allocationType == AllocationType::DEBUG_MODULE_AREA;
}
static bool isLockable(AllocationType allocationType) {
return isCpuAccessRequired(allocationType) ||
isIsaAllocationType(allocationType) ||
allocationType == AllocationType::BUFFER ||
allocationType == AllocationType::BUFFER_HOST_MEMORY ||
allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER ||
allocationType == AllocationType::SVM_GPU;
}
static bool isIsaAllocationType(GraphicsAllocation::AllocationType type) {
return type == GraphicsAllocation::AllocationType::KERNEL_ISA ||