Refactor MemoryPropertiesFlags

Rename:
- MemoryPropertiesFlags to MemoryProperties
- MemoryPropertiesParser to MemoryPropertiesParserHelper
- getMemoryPropertiesFlags to getFlags
- getMemoryPropertiesFlagsIntel to getFlagsIntel
- functions involved with MemoryPropertiesFlags

Related-To: NEO-4143
Change-Id: I4eec67bba95dd5354d0df43c31e6ca724909138e
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-04-22 14:37:30 +02:00
committed by sys_ocldev
parent 9cdd0574c1
commit b0ed3b2ab1
73 changed files with 433 additions and 434 deletions

View File

@ -661,7 +661,7 @@ cl_mem CL_API_CALL clCreateBuffer(cl_context context,
return nullptr;
}
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MemoryProperties memoryProperties = MemoryPropertiesParser::createMemoryProperties(flags, 0, 0);
if (isFieldValid(flags, MemObjHelper::validFlagsForBuffer)) {
Buffer::validateInputAndCreateBuffer(*pContext, memoryProperties, flags, 0, size, hostPtr, retVal, buffer);
} else {
@ -697,12 +697,12 @@ cl_mem CL_API_CALL clCreateBufferWithPropertiesINTEL(cl_context context,
return nullptr;
}
MemoryPropertiesFlags memoryProperties;
MemoryProperties memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
cl_mem_alloc_flags_intel allocflags = 0;
if (MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
MemoryPropertiesParser::MemoryPropertiesParser::ObjType::BUFFER, *pContext)) {
if (MemoryPropertiesParserHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
MemoryPropertiesParserHelper::MemoryPropertiesParserHelper::ObjType::BUFFER, *pContext)) {
Buffer::validateInputAndCreateBuffer(*pContext, memoryProperties, flags, flagsIntel, size, hostPtr, retVal, buffer);
} else {
retVal = CL_INVALID_VALUE;
@ -740,8 +740,8 @@ cl_mem CL_API_CALL clCreateSubBuffer(cl_mem buffer,
break;
}
cl_mem_flags parentFlags = parentBuffer->getMemoryPropertiesFlags();
cl_mem_flags_intel parentFlagsIntel = parentBuffer->getMemoryPropertiesFlagsIntel();
cl_mem_flags parentFlags = parentBuffer->getFlags();
cl_mem_flags_intel parentFlagsIntel = parentBuffer->getFlagsIntel();
if (parentBuffer->isSubBuffer() == true) {
retVal = CL_INVALID_MEM_OBJECT;
@ -845,7 +845,7 @@ cl_mem CL_API_CALL clCreateImage(cl_context context,
retVal = validateObjects(WithCastToInternal(context, &pContext));
if (retVal == CL_SUCCESS) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MemoryProperties memoryProperties = MemoryPropertiesParser::createMemoryProperties(flags, 0, 0);
if (isFieldValid(flags, MemObjHelper::validFlagsForImage)) {
image = Image::validateAndCreateImage(pContext, memoryProperties, flags, 0, imageFormat, imageDesc, hostPtr, retVal);
} else {
@ -881,15 +881,15 @@ cl_mem CL_API_CALL clCreateImageWithPropertiesINTEL(cl_context context,
cl_mem image = nullptr;
Context *pContext = nullptr;
MemoryPropertiesFlags memoryProperties;
MemoryProperties memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
cl_mem_alloc_flags_intel allocflags = 0;
retVal = validateObjects(WithCastToInternal(context, &pContext));
if (retVal == CL_SUCCESS) {
if (MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
MemoryPropertiesParser::MemoryPropertiesParser::ObjType::IMAGE, *pContext)) {
if (MemoryPropertiesParserHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
MemoryPropertiesParserHelper::MemoryPropertiesParserHelper::ObjType::IMAGE, *pContext)) {
image = Image::validateAndCreateImage(pContext, memoryProperties, flags, flagsIntel, imageFormat, imageDesc, hostPtr, retVal);
} else {
retVal = CL_INVALID_VALUE;
@ -936,7 +936,7 @@ cl_mem CL_API_CALL clCreateImage2D(cl_context context,
retVal = validateObjects(WithCastToInternal(context, &pContext));
if (retVal == CL_SUCCESS) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MemoryProperties memoryProperties = MemoryPropertiesParser::createMemoryProperties(flags, 0, 0);
image2D = Image::validateAndCreateImage(pContext, memoryProperties, flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
}
@ -987,7 +987,7 @@ cl_mem CL_API_CALL clCreateImage3D(cl_context context,
retVal = validateObjects(WithCastToInternal(context, &pContext));
if (retVal == CL_SUCCESS) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MemoryProperties memoryProperties = MemoryPropertiesParser::createMemoryProperties(flags, 0, 0);
image3D = Image::validateAndCreateImage(pContext, memoryProperties, flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
}
@ -1154,7 +1154,7 @@ cl_int CL_API_CALL clGetImageParamsINTEL(cl_context context,
}
if (CL_SUCCESS == retVal) {
surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(memFlags, imageFormat, pContext->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
retVal = Image::validate(pContext, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(memFlags, 0, 0), surfaceFormat, imageDesc, nullptr);
retVal = Image::validate(pContext, MemoryPropertiesParser::createMemoryProperties(memFlags, 0, 0), surfaceFormat, imageDesc, nullptr);
}
if (CL_SUCCESS == retVal) {
retVal = Image::getImageParams(pContext, memFlags, surfaceFormat, imageDesc, imageRowPitch, imageSlicePitch);
@ -3502,9 +3502,9 @@ void *clHostMemAllocINTEL(
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
cl_mem_alloc_flags_intel allocflags = 0;
if (!MemoryPropertiesParser::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN,
*neoContext)) {
if (!MemoryPropertiesParserHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParserHelper::MemoryPropertiesParserHelper::ObjType::UNKNOWN,
*neoContext)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}
@ -3540,9 +3540,9 @@ void *clDeviceMemAllocINTEL(
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
cl_mem_alloc_flags_intel allocflags = 0;
if (!MemoryPropertiesParser::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN,
*neoContext)) {
if (!MemoryPropertiesParserHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParserHelper::MemoryPropertiesParserHelper::ObjType::UNKNOWN,
*neoContext)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}
@ -3581,9 +3581,9 @@ void *clSharedMemAllocINTEL(
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
cl_mem_alloc_flags_intel allocflags = 0;
if (!MemoryPropertiesParser::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN,
*neoContext)) {
if (!MemoryPropertiesParserHelper::parseMemoryProperties(properties, unifiedMemoryProperties.allocationFlags, flags, flagsIntel,
allocflags, MemoryPropertiesParserHelper::MemoryPropertiesParserHelper::ObjType::UNKNOWN,
*neoContext)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}