Files
compute-runtime/runtime/mem_obj/mem_obj_helper.cpp
Mateusz Jablonski 8ec072d39c Simplify Memory Manager API [3/4]
- remove method allocateGraphicsMemory(size_t size)
- pass allocation type in allocation properties
- set allocation type in allocateGraphicsMemoryInPreferredPool

Change-Id: Ia9296d0ab2f711b7d78aff615cb56b3a246b60ec
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-12-17 10:42:16 +01:00

45 lines
1.2 KiB
C++

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/mem_obj/mem_obj_helper.h"
namespace OCLRT {
bool MemObjHelper::parseMemoryProperties(const cl_mem_properties_intel *properties, MemoryProperties &propertiesStruct) {
if (properties == nullptr) {
return true;
}
for (int i = 0; properties[i] != 0; i += 2) {
switch (properties[i]) {
case CL_MEM_FLAGS:
propertiesStruct.flags |= static_cast<cl_mem_flags>(properties[i + 1]);
break;
case CL_MEM_FLAGS_INTEL:
propertiesStruct.flags_intel |= static_cast<cl_mem_flags_intel>(properties[i + 1]);
break;
default:
return false;
}
}
return true;
}
bool MemObjHelper::validateExtraMemoryProperties(const MemoryProperties &properties) {
return true;
}
AllocationProperties MemObjHelper::getAllocationProperties(cl_mem_flags_intel flags, bool allocateMemory, size_t size, GraphicsAllocation::AllocationType type) {
return AllocationProperties(allocateMemory, size, type);
}
DevicesBitfield MemObjHelper::getDevicesBitfield(const MemoryProperties &properties) {
return DevicesBitfield(0);
}
} // namespace OCLRT