Remove OCL object from MemoryProperties 12/n
Remove MemoryProperties from Buffer and Image classes and replaced it with MemoryPropertiesFlags Related-To: NEO-3132 Change-Id: Ib582cddf759bf501fa7dbbea3257640eb9f431e9 Signed-off-by: Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
parent
a046de5689
commit
5f02a0730b
|
@ -593,7 +593,7 @@ cl_mem CL_API_CALL clCreateBuffer(cl_context context,
|
|||
propertiesStruct.flags = flags;
|
||||
|
||||
if (isFieldValid(propertiesStruct.flags, MemObjHelper::validFlagsForBuffer)) {
|
||||
Buffer::validateInputAndCreateBuffer(context, propertiesStruct, flags, 0, size, hostPtr, retVal, buffer);
|
||||
Buffer::validateInputAndCreateBuffer(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), flags, 0, size, hostPtr, retVal, buffer);
|
||||
} else {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ cl_mem CL_API_CALL clCreateBufferWithPropertiesINTEL(cl_context context,
|
|||
|
||||
MemoryProperties propertiesStruct;
|
||||
if (MemoryPropertiesParser::parseMemoryProperties(properties, propertiesStruct, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::BUFFER)) {
|
||||
Buffer::validateInputAndCreateBuffer(context, propertiesStruct, propertiesStruct.flags, propertiesStruct.flagsIntel, size, hostPtr, retVal, buffer);
|
||||
Buffer::validateInputAndCreateBuffer(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), propertiesStruct.flags, propertiesStruct.flagsIntel, size, hostPtr, retVal, buffer);
|
||||
} else {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ cl_mem CL_API_CALL clCreateImage(cl_context context,
|
|||
if (retVal == CL_SUCCESS) {
|
||||
MemoryProperties propertiesStruct(flags);
|
||||
if (isFieldValid(propertiesStruct.flags, MemObjHelper::validFlagsForImage)) {
|
||||
image = Image::validateAndCreateImage(pContext, propertiesStruct, flags, 0, imageFormat, imageDesc, hostPtr, retVal);
|
||||
image = Image::validateAndCreateImage(pContext, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), flags, 0, imageFormat, imageDesc, hostPtr, retVal);
|
||||
} else {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
}
|
||||
|
@ -804,7 +804,7 @@ cl_mem CL_API_CALL clCreateImageWithPropertiesINTEL(cl_context context,
|
|||
|
||||
if (retVal == CL_SUCCESS) {
|
||||
if (MemoryPropertiesParser::parseMemoryProperties(properties, propertiesStruct, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::IMAGE)) {
|
||||
image = Image::validateAndCreateImage(pContext, propertiesStruct, propertiesStruct.flags, propertiesStruct.flagsIntel, imageFormat, imageDesc, hostPtr, retVal);
|
||||
image = Image::validateAndCreateImage(pContext, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), propertiesStruct.flags, propertiesStruct.flagsIntel, imageFormat, imageDesc, hostPtr, retVal);
|
||||
} else {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
}
|
||||
|
@ -851,7 +851,7 @@ cl_mem CL_API_CALL clCreateImage2D(cl_context context,
|
|||
|
||||
if (retVal == CL_SUCCESS) {
|
||||
MemoryProperties propertiesStruct(flags);
|
||||
image2D = Image::validateAndCreateImage(pContext, propertiesStruct, flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
|
||||
image2D = Image::validateAndCreateImage(pContext, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
|
||||
}
|
||||
|
||||
ErrorCodeHelper err(errcodeRet, retVal);
|
||||
|
@ -902,7 +902,7 @@ cl_mem CL_API_CALL clCreateImage3D(cl_context context,
|
|||
|
||||
if (retVal == CL_SUCCESS) {
|
||||
MemoryProperties propertiesStruct(flags);
|
||||
image3D = Image::validateAndCreateImage(pContext, propertiesStruct, flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
|
||||
image3D = Image::validateAndCreateImage(pContext, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(propertiesStruct), flags, 0, imageFormat, &imageDesc, hostPtr, retVal);
|
||||
}
|
||||
|
||||
ErrorCodeHelper err(errcodeRet, retVal);
|
||||
|
@ -918,6 +918,7 @@ cl_int CL_API_CALL clRetainMemObject(cl_mem memobj) {
|
|||
DBG_LOG_INPUTS("memobj", memobj);
|
||||
|
||||
auto pMemObj = castToObject<MemObj>(memobj);
|
||||
|
||||
if (pMemObj) {
|
||||
pMemObj->retain();
|
||||
retVal = CL_SUCCESS;
|
||||
|
|
|
@ -83,7 +83,7 @@ bool Buffer::isValidSubBufferOffset(size_t offset) {
|
|||
}
|
||||
|
||||
void Buffer::validateInputAndCreateBuffer(cl_context &context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
|
@ -96,14 +96,14 @@ void Buffer::validateInputAndCreateBuffer(cl_context &context,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!MemObjHelper::validateMemoryPropertiesForBuffer(MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties), flags, flagsIntel)) {
|
||||
if (!MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel)) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
return;
|
||||
}
|
||||
|
||||
auto pDevice = pContext->getDevice(0);
|
||||
bool allowCreateBuffersWithUnrestrictedSize = isValueSet(properties.flags, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL) ||
|
||||
isValueSet(properties.flagsIntel, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL);
|
||||
bool allowCreateBuffersWithUnrestrictedSize = isValueSet(flags, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL) ||
|
||||
isValueSet(flagsIntel, CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL);
|
||||
|
||||
if (size == 0 || (size > pDevice->getHardwareCapabilities().maxMemAllocSize && !allowCreateBuffersWithUnrestrictedSize)) {
|
||||
retVal = CL_INVALID_BUFFER_SIZE;
|
||||
|
@ -111,14 +111,14 @@ void Buffer::validateInputAndCreateBuffer(cl_context &context,
|
|||
}
|
||||
|
||||
/* Check the host ptr and data */
|
||||
bool expectHostPtr = (properties.flags & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) != 0;
|
||||
bool expectHostPtr = (flags & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR)) != 0;
|
||||
if ((hostPtr == nullptr) == expectHostPtr) {
|
||||
retVal = CL_INVALID_HOST_PTR;
|
||||
return;
|
||||
}
|
||||
|
||||
// create the buffer
|
||||
buffer = create(pContext, properties, size, hostPtr, retVal);
|
||||
buffer = create(pContext, memoryProperties, flags, flagsIntel, size, hostPtr, retVal);
|
||||
}
|
||||
|
||||
Buffer *Buffer::create(Context *context,
|
||||
|
@ -126,13 +126,13 @@ Buffer *Buffer::create(Context *context,
|
|||
size_t size,
|
||||
void *hostPtr,
|
||||
cl_int &errcodeRet) {
|
||||
MemoryProperties properties;
|
||||
properties.flags = flags;
|
||||
return create(context, properties, size, hostPtr, errcodeRet);
|
||||
return create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, size, hostPtr, errcodeRet);
|
||||
}
|
||||
|
||||
Buffer *Buffer::create(Context *context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
void *hostPtr,
|
||||
cl_int &errcodeRet) {
|
||||
|
@ -150,7 +150,6 @@ Buffer *Buffer::create(Context *context,
|
|||
MemoryManager *memoryManager = context->getMemoryManager();
|
||||
UNRECOVERABLE_IF(!memoryManager);
|
||||
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationType(
|
||||
memoryProperties,
|
||||
*context,
|
||||
|
@ -170,7 +169,7 @@ Buffer *Buffer::create(Context *context,
|
|||
}
|
||||
|
||||
if (allocationType == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) {
|
||||
if (properties.flags & CL_MEM_USE_HOST_PTR) {
|
||||
if (memoryProperties.flags.useHostPtr) {
|
||||
if (alignementSatisfied) {
|
||||
allocateMemory = false;
|
||||
zeroCopyAllowed = true;
|
||||
|
@ -181,7 +180,7 @@ Buffer *Buffer::create(Context *context,
|
|||
}
|
||||
}
|
||||
|
||||
if (properties.flags & CL_MEM_USE_HOST_PTR) {
|
||||
if (memoryProperties.flags.useHostPtr) {
|
||||
if (DebugManager.flags.DisableZeroCopyForUseHostPtr.get()) {
|
||||
zeroCopyAllowed = false;
|
||||
allocateMemory = true;
|
||||
|
@ -225,7 +224,6 @@ Buffer *Buffer::create(Context *context,
|
|||
}
|
||||
|
||||
if (!memory) {
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(memoryProperties, allocateMemory, size, allocationType, context->areMultiStorageAllocationsPreferred());
|
||||
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties, hostPtr);
|
||||
}
|
||||
|
@ -235,11 +233,10 @@ Buffer *Buffer::create(Context *context,
|
|||
}
|
||||
|
||||
//if allocation failed for CL_MEM_USE_HOST_PTR case retry with non zero copy path
|
||||
if ((properties.flags & CL_MEM_USE_HOST_PTR) && !memory && Buffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)) {
|
||||
if (memoryProperties.flags.useHostPtr && !memory && Buffer::isReadOnlyMemoryPermittedByFlags(memoryProperties)) {
|
||||
allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||
zeroCopyAllowed = false;
|
||||
copyMemoryFromHostPtr = true;
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
AllocationProperties allocProperties = MemoryPropertiesParser::getAllocationProperties(memoryProperties, true, size, allocationType, context->areMultiStorageAllocationsPreferred());
|
||||
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
|
||||
}
|
||||
|
@ -261,15 +258,17 @@ Buffer *Buffer::create(Context *context,
|
|||
}
|
||||
|
||||
memory->setAllocationType(allocationType);
|
||||
memory->setMemObjectsAllocationWithWritableFlags(!(properties.flags & (CL_MEM_READ_ONLY | CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS)));
|
||||
memory->setMemObjectsAllocationWithWritableFlags(!(memoryProperties.flags.readOnly || memoryProperties.flags.hostReadOnly || memoryProperties.flags.hostNoAccess));
|
||||
|
||||
DBG_LOG(LogMemoryObject, __FUNCTION__, "hostPtr:", hostPtr, "size:", size, "memoryStorage:", memory->getUnderlyingBuffer(), "GPU address:", std::hex, memory->getGpuAddress());
|
||||
|
||||
pBuffer = createBufferHw(context,
|
||||
properties,
|
||||
memoryProperties,
|
||||
flags,
|
||||
flagsIntel,
|
||||
size,
|
||||
memory->getUnderlyingBuffer(),
|
||||
(properties.flags & CL_MEM_USE_HOST_PTR) ? hostPtr : nullptr,
|
||||
(memoryProperties.flags.useHostPtr) ? hostPtr : nullptr,
|
||||
memory,
|
||||
zeroCopyAllowed,
|
||||
isHostPtrSVM,
|
||||
|
@ -281,7 +280,7 @@ Buffer *Buffer::create(Context *context,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (properties.flags & CL_MEM_USE_HOST_PTR) {
|
||||
if (memoryProperties.flags.useHostPtr) {
|
||||
if (!zeroCopyAllowed && !isHostPtrSVM) {
|
||||
AllocationProperties properties{false, size, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false};
|
||||
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
|
||||
|
@ -322,7 +321,7 @@ Buffer *Buffer::create(Context *context,
|
|||
|
||||
Buffer *Buffer::createSharedBuffer(Context *context, cl_mem_flags flags, SharingHandler *sharingHandler,
|
||||
GraphicsAllocation *graphicsAllocation) {
|
||||
auto sharedBuffer = createBufferHw(context, flags, graphicsAllocation->getUnderlyingBufferSize(), nullptr, nullptr, graphicsAllocation, false, false, false);
|
||||
auto sharedBuffer = createBufferHw(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, graphicsAllocation->getUnderlyingBufferSize(), nullptr, nullptr, graphicsAllocation, false, false, false);
|
||||
|
||||
sharedBuffer->setSharingHandler(sharingHandler);
|
||||
return sharedBuffer;
|
||||
|
@ -498,7 +497,9 @@ bool Buffer::isReadWriteOnCpuAllowed(cl_bool blocking, cl_uint numEventsInWaitLi
|
|||
}
|
||||
|
||||
Buffer *Buffer::createBufferHw(Context *context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
void *memoryStorage,
|
||||
void *hostPtr,
|
||||
|
@ -511,8 +512,7 @@ Buffer *Buffer::createBufferHw(Context *context,
|
|||
|
||||
auto funcCreate = bufferFactory[hwInfo.platform.eRenderCoreFamily].createBufferFunction;
|
||||
DEBUG_BREAK_IF(nullptr == funcCreate);
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
auto pBuffer = funcCreate(context, memoryProperties, properties.flags, properties.flagsIntel, size, memoryStorage, hostPtr, gfxAllocation,
|
||||
auto pBuffer = funcCreate(context, memoryProperties, flags, flagsIntel, size, memoryStorage, hostPtr, gfxAllocation,
|
||||
zeroCopy, isHostPtrSVM, isImageRedescribed);
|
||||
DEBUG_BREAK_IF(nullptr == pBuffer);
|
||||
if (pBuffer) {
|
||||
|
|
|
@ -49,7 +49,7 @@ class Buffer : public MemObj {
|
|||
~Buffer() override;
|
||||
|
||||
static void validateInputAndCreateBuffer(cl_context &context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
|
@ -64,7 +64,9 @@ class Buffer : public MemObj {
|
|||
cl_int &errcodeRet);
|
||||
|
||||
static Buffer *create(Context *context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags properties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
void *hostPtr,
|
||||
cl_int &errcodeRet);
|
||||
|
@ -75,7 +77,9 @@ class Buffer : public MemObj {
|
|||
GraphicsAllocation *graphicsAllocation);
|
||||
|
||||
static Buffer *createBufferHw(Context *context,
|
||||
MemoryProperties properties,
|
||||
MemoryPropertiesFlags memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
size_t size,
|
||||
void *memoryStorage,
|
||||
void *hostPtr,
|
||||
|
|
|
@ -111,7 +111,9 @@ void Image::transferData(void *dest, size_t destRowPitch, size_t destSlicePitch,
|
|||
Image::~Image() = default;
|
||||
|
||||
Image *Image::create(Context *context,
|
||||
const MemoryProperties &properties,
|
||||
const MemoryPropertiesFlags &memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
const SurfaceFormatInfo *surfaceFormat,
|
||||
const cl_image_desc *imageDesc,
|
||||
const void *hostPtr,
|
||||
|
@ -136,7 +138,7 @@ Image *Image::create(Context *context,
|
|||
ImageInfo imgInfo = {0};
|
||||
void *hostPtrToSet = nullptr;
|
||||
|
||||
if (isValueSet(properties.flags, CL_MEM_USE_HOST_PTR)) {
|
||||
if (memoryProperties.flags.useHostPtr) {
|
||||
hostPtrToSet = const_cast<void *>(hostPtr);
|
||||
}
|
||||
|
||||
|
@ -185,7 +187,6 @@ Image *Image::create(Context *context,
|
|||
|
||||
auto hostPtrRowPitch = imageDesc->image_row_pitch ? imageDesc->image_row_pitch : imageWidth * surfaceFormat->ImageElementSizeInBytes;
|
||||
auto hostPtrSlicePitch = imageDesc->image_slice_pitch ? imageDesc->image_slice_pitch : hostPtrRowPitch * imageHeight;
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
imgInfo.linearStorage = !hwHelper.tilingAllowed(context->isSharedContext, *imageDesc, memoryProperties.flags.forceLinearStorage);
|
||||
imgInfo.preferRenderCompression = MemObjHelper::isSuitableForRenderCompression(!imgInfo.linearStorage, memoryProperties,
|
||||
*context, true);
|
||||
|
@ -257,10 +258,9 @@ Image *Image::create(Context *context,
|
|||
memory->getDefaultGmm()->queryImageParams(imgInfo);
|
||||
} else {
|
||||
errcodeRet = CL_OUT_OF_HOST_MEMORY;
|
||||
if (isValueSet(properties.flags, CL_MEM_USE_HOST_PTR)) {
|
||||
if (memoryProperties.flags.useHostPtr) {
|
||||
|
||||
if (!context->isSharedContext) {
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(imgInfo, false, memoryProperties);
|
||||
|
||||
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties, hostPtr);
|
||||
|
@ -285,7 +285,6 @@ Image *Image::create(Context *context,
|
|||
mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr);
|
||||
}
|
||||
} else {
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(imgInfo, true, memoryProperties);
|
||||
memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
|
||||
|
||||
|
@ -294,7 +293,7 @@ Image *Image::create(Context *context,
|
|||
}
|
||||
}
|
||||
}
|
||||
transferNeeded |= isValueSet(properties.flags, static_cast<cl_bitfield>(CL_MEM_COPY_HOST_PTR));
|
||||
transferNeeded |= memoryProperties.flags.copyHostPtr;
|
||||
|
||||
if (!memory) {
|
||||
break;
|
||||
|
@ -304,9 +303,9 @@ Image *Image::create(Context *context,
|
|||
memory->setAllocationType(GraphicsAllocation::AllocationType::IMAGE);
|
||||
}
|
||||
|
||||
memory->setMemObjectsAllocationWithWritableFlags(!isValueSet(properties.flags, CL_MEM_READ_ONLY) &&
|
||||
!isValueSet(properties.flags, CL_MEM_HOST_READ_ONLY) &&
|
||||
!isValueSet(properties.flags, CL_MEM_HOST_NO_ACCESS));
|
||||
memory->setMemObjectsAllocationWithWritableFlags(!memoryProperties.flags.readOnly &&
|
||||
!memoryProperties.flags.hostReadOnly &&
|
||||
!memoryProperties.flags.hostNoAccess);
|
||||
|
||||
DBG_LOG(LogMemoryObject, __FUNCTION__, "hostPtr:", hostPtr, "size:", memory->getUnderlyingBufferSize(), "memoryStorage:", memory->getUnderlyingBuffer(), "GPU address:", std::hex, memory->getGpuAddress());
|
||||
|
||||
|
@ -322,7 +321,7 @@ Image *Image::create(Context *context,
|
|||
parentImage->incRefInternal();
|
||||
}
|
||||
|
||||
image = createImageHw(context, properties, imgInfo.size, hostPtrToSet, surfaceFormat->OCLImageFormat,
|
||||
image = createImageHw(context, memoryProperties, flags, flagsIntel, imgInfo.size, hostPtrToSet, surfaceFormat->OCLImageFormat,
|
||||
imageDescriptor, zeroCopy, memory, false, 0, 0, surfaceFormat);
|
||||
|
||||
if (context->isProvidingPerformanceHints() && HwHelper::renderCompressedImagesSupported(context->getDevice(0)->getHardwareInfo())) {
|
||||
|
@ -402,7 +401,7 @@ Image *Image::create(Context *context,
|
|||
return image;
|
||||
}
|
||||
|
||||
Image *Image::createImageHw(Context *context, const MemoryProperties &properties, size_t size, void *hostPtr,
|
||||
Image *Image::createImageHw(Context *context, const MemoryPropertiesFlags &memoryProperties, cl_mem_flags flags, cl_mem_flags_intel flagsIntel, size_t size, void *hostPtr,
|
||||
const cl_image_format &imageFormat, const cl_image_desc &imageDesc,
|
||||
bool zeroCopy, GraphicsAllocation *graphicsAllocation,
|
||||
bool isObjectRedescribed, uint32_t baseMipLevel, uint32_t mipCount,
|
||||
|
@ -412,8 +411,7 @@ Image *Image::createImageHw(Context *context, const MemoryProperties &properties
|
|||
|
||||
auto funcCreate = imageFactory[hwInfo.platform.eRenderCoreFamily].createImageFunction;
|
||||
DEBUG_BREAK_IF(nullptr == funcCreate);
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
auto image = funcCreate(context, memoryProperties, properties.flags, properties.flagsIntel, size, hostPtr, imageFormat, imageDesc,
|
||||
auto image = funcCreate(context, memoryProperties, flags, flagsIntel, size, hostPtr, imageFormat, imageDesc,
|
||||
zeroCopy, graphicsAllocation, isObjectRedescribed, baseMipLevel, mipCount, surfaceFormatInfo, nullptr);
|
||||
DEBUG_BREAK_IF(nullptr == image);
|
||||
image->createFunction = funcCreate;
|
||||
|
@ -423,7 +421,7 @@ Image *Image::createImageHw(Context *context, const MemoryProperties &properties
|
|||
Image *Image::createSharedImage(Context *context, SharingHandler *sharingHandler, McsSurfaceInfo &mcsSurfaceInfo,
|
||||
GraphicsAllocation *graphicsAllocation, GraphicsAllocation *mcsAllocation,
|
||||
cl_mem_flags flags, ImageInfo &imgInfo, uint32_t cubeFaceIndex, uint32_t baseMipLevel, uint32_t mipCount) {
|
||||
auto sharedImage = createImageHw(context, flags, graphicsAllocation->getUnderlyingBufferSize(),
|
||||
auto sharedImage = createImageHw(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, graphicsAllocation->getUnderlyingBufferSize(),
|
||||
nullptr, imgInfo.surfaceFormat->OCLImageFormat, *imgInfo.imgDesc, false, graphicsAllocation, false, baseMipLevel, mipCount, imgInfo.surfaceFormat);
|
||||
sharedImage->setSharingHandler(sharingHandler);
|
||||
sharedImage->setMcsAllocation(mcsAllocation);
|
||||
|
@ -973,7 +971,9 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) {
|
|||
// Create NV12 UV Plane image
|
||||
std::unique_ptr<Image> imageYPlane(Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -995,7 +995,9 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) {
|
|||
// Create NV12 UV Plane image
|
||||
std::unique_ptr<Image> imageUVPlane(Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -1037,7 +1039,7 @@ bool Image::isDepthFormat(const cl_image_format &imageFormat) {
|
|||
}
|
||||
|
||||
Image *Image::validateAndCreateImage(Context *context,
|
||||
const MemoryProperties &properties,
|
||||
const MemoryPropertiesFlags &memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
const cl_image_format *imageFormat,
|
||||
|
@ -1045,13 +1047,13 @@ Image *Image::validateAndCreateImage(Context *context,
|
|||
const void *hostPtr,
|
||||
cl_int &errcodeRet) {
|
||||
|
||||
if (!MemObjHelper::validateMemoryPropertiesForImage(MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties), flags, flagsIntel, imageDesc->mem_object)) {
|
||||
if (!MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, imageDesc->mem_object)) {
|
||||
errcodeRet = CL_INVALID_VALUE;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool isHostPtrUsed = (hostPtr != nullptr);
|
||||
bool areHostPtrFlagsUsed = isValueSet(properties.flags, CL_MEM_COPY_HOST_PTR) || isValueSet(properties.flags, CL_MEM_USE_HOST_PTR);
|
||||
bool areHostPtrFlagsUsed = memoryProperties.flags.copyHostPtr || memoryProperties.flags.useHostPtr;
|
||||
if (isHostPtrUsed != areHostPtrFlagsUsed) {
|
||||
errcodeRet = CL_INVALID_HOST_PTR;
|
||||
return nullptr;
|
||||
|
@ -1062,15 +1064,14 @@ Image *Image::validateAndCreateImage(Context *context,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
const auto surfaceFormat = Image::getSurfaceFormatFromTable(properties.flags, imageFormat);
|
||||
const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat);
|
||||
|
||||
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties);
|
||||
errcodeRet = Image::validate(context, memoryProperties, surfaceFormat, imageDesc, hostPtr);
|
||||
if (errcodeRet != CL_SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return Image::create(context, properties, surfaceFormat, imageDesc, hostPtr, errcodeRet);
|
||||
return Image::create(context, memoryProperties, flags, flagsIntel, surfaceFormat, imageDesc, hostPtr, errcodeRet);
|
||||
}
|
||||
|
||||
bool Image::isValidSingleChannelFormat(const cl_image_format *imageFormat) {
|
||||
|
|
|
@ -52,14 +52,16 @@ class Image : public MemObj {
|
|||
~Image() override;
|
||||
|
||||
static Image *create(Context *context,
|
||||
const MemoryProperties &properties,
|
||||
const MemoryPropertiesFlags &memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
const SurfaceFormatInfo *surfaceFormat,
|
||||
const cl_image_desc *imageDesc,
|
||||
const void *hostPtr,
|
||||
cl_int &errcodeRet);
|
||||
|
||||
static Image *validateAndCreateImage(Context *context,
|
||||
const MemoryProperties &properties,
|
||||
const MemoryPropertiesFlags &memoryProperties,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel,
|
||||
const cl_image_format *imageFormat,
|
||||
|
@ -67,7 +69,8 @@ class Image : public MemObj {
|
|||
const void *hostPtr,
|
||||
cl_int &errcodeRet);
|
||||
|
||||
static Image *createImageHw(Context *context, const MemoryProperties &properties, size_t size, void *hostPtr,
|
||||
static Image *createImageHw(Context *context, const MemoryPropertiesFlags &memoryProperties, cl_mem_flags flags,
|
||||
cl_mem_flags_intel flagsIntel, size_t size, void *hostPtr,
|
||||
const cl_image_format &imageFormat, const cl_image_desc &imageDesc,
|
||||
bool zeroCopy, GraphicsAllocation *graphicsAllocation,
|
||||
bool isObjectRedescribed, uint32_t baseMipLevel, uint32_t mipCount, const SurfaceFormatInfo *surfaceFormatInfo = nullptr);
|
||||
|
|
|
@ -86,7 +86,9 @@ HWTEST_P(AUBCopyImage, simple) {
|
|||
auto retVal = CL_INVALID_VALUE;
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
srcMemory,
|
||||
|
@ -95,7 +97,9 @@ HWTEST_P(AUBCopyImage, simple) {
|
|||
|
||||
dstImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
dstMemory,
|
||||
|
|
|
@ -175,7 +175,9 @@ HWTEST_P(AubFillImage, simple) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
image.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -125,7 +125,9 @@ HWTEST_P(AUBMapImage, MapUpdateUnmapVerify) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
srcMemory,
|
||||
|
|
|
@ -124,7 +124,9 @@ HWTEST_F(AUBReadBuffer, reserveCanonicalGpuAddress) {
|
|||
MemoryPool::MemoryNull);
|
||||
|
||||
std::unique_ptr<Buffer> srcBuffer(Buffer::createBufferHw(&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({CL_MEM_USE_HOST_PTR}),
|
||||
CL_MEM_USE_HOST_PTR,
|
||||
0,
|
||||
sizeof(srcMemory),
|
||||
srcAlocation->getUnderlyingBuffer(),
|
||||
srcMemory,
|
||||
|
|
|
@ -143,7 +143,9 @@ HWTEST_P(AUBReadImage, simpleUnalignedMemory) {
|
|||
auto retVal = CL_INVALID_VALUE;
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
srcMemory,
|
||||
|
|
|
@ -81,7 +81,9 @@ struct AUBImageUnaligned
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
imageMemory,
|
||||
|
@ -174,7 +176,9 @@ struct AUBImageUnaligned
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
imageMemory,
|
||||
|
|
|
@ -72,7 +72,9 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces
|
|||
auto retVal = CL_INVALID_VALUE;
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -137,7 +137,9 @@ HWTEST_P(AUBWriteImage, simpleUnalignedMemory) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
dstImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -57,6 +57,8 @@ GEN11TEST_F(GEN11AUBParentKernelFixture, EnqueueParentKernel) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
|
||||
Image *image = Image::create(
|
||||
pContext,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&desc,
|
||||
|
|
|
@ -57,6 +57,8 @@ GEN12LPTEST_F(GEN12LPAUBParentKernelFixture, EnqueueParentKernel) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
|
||||
Image *image = Image::create(
|
||||
pContext,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&desc,
|
||||
|
|
|
@ -57,6 +57,8 @@ GEN8TEST_F(GEN8AUBParentKernelFixture, EnqueueParentKernel) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
pContext,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&desc,
|
||||
|
|
|
@ -55,6 +55,8 @@ GEN9TEST_F(AUBParentKernelFixture, EnqueueParentKernel) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
|
||||
Image *image = Image::create(
|
||||
pContext,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&desc,
|
||||
|
|
|
@ -332,7 +332,9 @@ SKLTEST_F(AUBRunKernelIntegrateTest, deviceSideVme) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto srcImage = Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
srcMemory,
|
||||
|
@ -341,7 +343,9 @@ SKLTEST_F(AUBRunKernelIntegrateTest, deviceSideVme) {
|
|||
|
||||
auto refImage = Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
refMemory,
|
||||
|
|
|
@ -111,7 +111,9 @@ HWTEST_P(AUBCreateImageArray, CheckArrayImages) {
|
|||
|
||||
image.reset(Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr.get(),
|
||||
|
@ -228,7 +230,8 @@ HWTEST_P(AUBCreateImageHostPtr, imageWithDoubledRowPitchThatIsCreatedWithCopyHos
|
|||
data += passedRowPitch;
|
||||
}
|
||||
|
||||
image.reset(Image::create(context, flags, surfaceFormat, &imageDesc, pHostPtr, retVal));
|
||||
image.reset(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, pHostPtr, retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(image->getImageDesc().image_row_pitch, imgInfo.rowPitch);
|
||||
EXPECT_EQ(image->getHostPtrRowPitch(), (size_t)passedRowPitch);
|
||||
|
@ -300,7 +303,9 @@ HWTEST_P(AUBCreateImageHostPtr, imageWithRowPitchCreatedWithUseHostPtrFlagCopied
|
|||
}
|
||||
image.reset(Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
pUseHostPtr,
|
||||
|
@ -395,8 +400,8 @@ HWTEST_F(AUBCreateImage, image3DCreatedWithDoubledSlicePitchWhenQueriedForDataRe
|
|||
}
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
image.reset(Image::create(context, flags, surfaceFormat,
|
||||
&imageDesc, host_ptr, retVal));
|
||||
image.reset(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, host_ptr, retVal));
|
||||
|
||||
depthToCopy = imageDesc.image_depth;
|
||||
auto imageStorage = (uint8_t *)image->getCpuAddress();
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "core/helpers/aligned_memory.h"
|
||||
#include "runtime/command_queue/command_queue_hw.h"
|
||||
#include "runtime/command_stream/command_stream_receiver_hw.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
|
@ -213,7 +214,7 @@ HWTEST_F(EnqueueThreading, enqueueCopyBufferToImage) {
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, dstImage.get());
|
||||
|
||||
size_t dstOrigin[3] = {1024u, 1, 0};
|
||||
|
@ -237,9 +238,9 @@ HWTEST_F(EnqueueThreading, enqueueCopyImage) {
|
|||
imageDesc.image_width = 1024u;
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> srcImage(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> srcImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
std::unique_ptr<Image> dstImage(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
|
||||
size_t srcOrigin[3] = {1024u, 1, 0};
|
||||
|
@ -265,7 +266,7 @@ HWTEST_F(EnqueueThreading, enqueueCopyImageToBuffer) {
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> srcImage(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> srcImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
|
||||
std::unique_ptr<Buffer> dstBuffer(Buffer::create(context, CL_MEM_READ_WRITE, 1024u, nullptr, retVal));
|
||||
|
@ -304,7 +305,7 @@ HWTEST_F(EnqueueThreading, enqueueFillImage) {
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> image(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
size_t origin[3] = {1024u, 1, 0};
|
||||
|
@ -350,7 +351,7 @@ HWTEST_F(EnqueueThreading, enqueueReadImage) {
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> image(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
void *ptr = ::alignedMalloc(1024u, 4096);
|
||||
|
@ -400,7 +401,7 @@ HWTEST_F(EnqueueThreading, enqueueWriteImage) {
|
|||
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> image(Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
void *ptr = ::alignedMalloc(1024u, 4096);
|
||||
|
|
|
@ -115,7 +115,7 @@ struct MultipleMapImageTest : public DeviceFixture, public ::testing::Test {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, &Traits::imageFormat);
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto img = Image::create(context, Traits::flags, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal);
|
||||
auto img = Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({Traits::flags}), Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal);
|
||||
auto mockImage = static_cast<MockImage<FamilyType> *>(img);
|
||||
|
||||
return std::unique_ptr<MockImage<FamilyType>>(mockImage);
|
||||
|
|
|
@ -471,7 +471,7 @@ TEST_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenProperPe
|
|||
cl_context_properties validProperties[3] = {CL_CONTEXT_SHOW_DIAGNOSTICS_INTEL, CL_CONTEXT_DIAGNOSTICS_LEVEL_ALL_INTEL, 0};
|
||||
auto context = std::unique_ptr<MockContext>(Context::create<NEO::MockContext>(validProperties, DeviceVector(&deviceId, 1), callbackFunction, static_cast<void *>(userData), retVal));
|
||||
context->isSharedContext = false;
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), properties, size, static_cast<void *>(NULL), retVal));
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(properties), (1 << 21), 0, size, static_cast<void *>(NULL), retVal));
|
||||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
|
||||
auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size) &&
|
||||
HwHelper::renderCompressedBuffersSupported(hwInfo);
|
||||
|
@ -504,10 +504,10 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
|
|||
memoryProperties, *context,
|
||||
HwHelper::get(hwInfo.platform.eRenderCoreFamily).obtainRenderBufferCompressionPreference(hwInfo, size)) &&
|
||||
!is32bit && !context->isSharedContext &&
|
||||
(!isValueSet(properties.flags, CL_MEM_USE_HOST_PTR) || context->getMemoryManager()->isLocalMemorySupported()) &&
|
||||
!isValueSet(properties.flags, CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL);
|
||||
(!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported()) &&
|
||||
!memoryProperties.flags.forceSharedPhysicalMemory;
|
||||
|
||||
buffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), properties, size, static_cast<void *>(NULL), retVal));
|
||||
buffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), memoryProperties, CL_MEM_READ_WRITE, 0, size, static_cast<void *>(NULL), retVal));
|
||||
}
|
||||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_NOT_COMPRESSED], buffer.get());
|
||||
|
||||
|
@ -562,7 +562,9 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -619,7 +621,9 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -678,7 +682,9 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
|
@ -75,7 +76,9 @@ struct ImageHelper {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
NEO::MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({Traits::flags}),
|
||||
Traits::flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
imgDesc,
|
||||
Traits::hostPtr,
|
||||
|
|
|
@ -36,7 +36,7 @@ struct AppendSurfaceStateParamsTest : public ::testing::Test {
|
|||
void createImage() {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
EXPECT_NE(nullptr, surfaceFormat);
|
||||
image.reset(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
image.reset(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
}
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "core/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/kernel_arg_fixture.h"
|
||||
|
@ -69,7 +70,7 @@ TEST_F(KernelImageArgTest, givenImageWithNumSamplesWhenSetArgIsCalledThenPatchNu
|
|||
imgDesc.image_height = 5;
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
auto sampleImg = Image::create(context.get(), 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
auto sampleImg = Image::create(context.get(), {}, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
cl_mem memObj = sampleImg;
|
||||
|
@ -91,7 +92,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndReadOnlyArgWhenCheckC
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->kernelArgInfo[0].accessQualifier = CL_KERNEL_ARG_ACCESS_READ_ONLY;
|
||||
cl_mem memObj = img.get();
|
||||
retVal = pKernel->checkCorrectImageAccessQualifier(0, sizeof(memObj), &memObj);
|
||||
|
@ -130,7 +131,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndWriteOnlyArgWhenCheckC
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->kernelArgInfo[0].accessQualifier = CL_KERNEL_ARG_ACCESS_WRITE_ONLY;
|
||||
cl_mem memObj = img.get();
|
||||
retVal = pKernel->checkCorrectImageAccessQualifier(0, sizeof(memObj), &memObj);
|
||||
|
@ -150,7 +151,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndReadOnlyArgWhenCheckCo
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->kernelArgInfo[0].accessQualifier = CL_KERNEL_ARG_ACCESS_READ_ONLY;
|
||||
cl_mem memObj = img.get();
|
||||
retVal = pKernel->checkCorrectImageAccessQualifier(0, sizeof(memObj), &memObj);
|
||||
|
@ -166,7 +167,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndWriteOnlyArgWhenCheck
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->kernelArgInfo[0].accessQualifier = CL_KERNEL_ARG_ACCESS_WRITE_ONLY;
|
||||
cl_mem memObj = img.get();
|
||||
retVal = pKernel->checkCorrectImageAccessQualifier(0, sizeof(memObj), &memObj);
|
||||
|
@ -183,7 +184,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo
|
|||
imgDesc.image_height = 5;
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
auto img = Image::create(context.get(), 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
auto img = Image::create(context.get(), {}, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
img->setMcsAllocation(mcsAlloc);
|
||||
|
@ -211,7 +212,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSettedArgWhenUnSetCalledThenArgIsUnset
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
cl_mem memObj = img.get();
|
||||
|
||||
retVal = pKernel->setArg(0, sizeof(memObj), &memObj);
|
||||
|
@ -248,7 +249,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSharedImageWhenSetArgCalledThenUsingSh
|
|||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), flags, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
cl_mem memObj = img.get();
|
||||
|
||||
MockSharingHandler *mockSharingHandler = new MockSharingHandler;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/helpers/flush_stamp.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/kernel/kernel.h"
|
||||
|
@ -2050,7 +2051,8 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) {
|
|||
|
||||
cl_int retVal;
|
||||
MockContext context;
|
||||
std::unique_ptr<NEO::Image> imageNV12(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<NEO::Image> imageNV12(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(imageNV12->getMediaPlaneType(), 0u);
|
||||
|
||||
//create Y plane
|
||||
|
@ -2063,7 +2065,8 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) {
|
|||
imageDesc.image_depth = 0;
|
||||
imageDesc.mem_object = imageNV12.get();
|
||||
|
||||
std::unique_ptr<NEO::Image> imageY(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<NEO::Image> imageY(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(imageY->getMediaPlaneType(), 0u);
|
||||
|
||||
auto pKernelInfo = std::make_unique<KernelInfo>();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
@ -62,7 +63,9 @@ typedef CreateImageFormatTest<CL_MEM_READ_WRITE> ReadWriteFormatTest;
|
|||
TEST_P(ReadWriteFormatTest, returnsSuccess) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -85,7 +88,9 @@ typedef CreateImageFormatTest<CL_MEM_READ_ONLY> ReadOnlyFormatTest;
|
|||
TEST_P(ReadOnlyFormatTest, returnsSuccess) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -106,7 +111,9 @@ typedef CreateImageFormatTest<CL_MEM_WRITE_ONLY> WriteOnlyFormatTest;
|
|||
TEST_P(WriteOnlyFormatTest, returnsSuccess) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "test.h"
|
||||
|
@ -76,7 +77,9 @@ HWTEST_P(CreateImage1DType, validTypes) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -56,7 +56,7 @@ class Image2dFromBufferTest : public DeviceFixture, public ::testing::Test {
|
|||
Image *createImage() {
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = (SurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(&context, flags, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
cl_image_desc imageDesc;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
@ -56,7 +57,7 @@ class CreateImage2DTest : public DeviceFixture,
|
|||
}
|
||||
Image *createImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
cl_image_desc imageDesc;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "core/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
@ -61,7 +62,7 @@ class CreateImage3DTest : public DeviceFixture,
|
|||
HWTEST_F(CreateImage3DTest, validTypes) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
auto image = Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, image);
|
||||
|
@ -94,6 +95,8 @@ HWTEST_F(CreateImage3DTest, calculate3dImageQpitchTiledAndLinear) {
|
|||
|
||||
auto image = Image::create(
|
||||
context,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
|
@ -116,6 +119,8 @@ HWTEST_F(CreateImage3DTest, calculate3dImageQpitchTiledAndLinear) {
|
|||
|
||||
image = Image::create(
|
||||
context,
|
||||
{},
|
||||
0,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "core/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
@ -75,7 +76,9 @@ HWTEST_P(CreateImageArraySize, arrayTypes) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -114,7 +117,9 @@ HWTEST_P(CreateImageNonArraySize, NonArrayTypes) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "core/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "test.h"
|
||||
|
@ -60,7 +61,7 @@ class ImageFromSubBufferTest : public DeviceFixture, public ::testing::Test {
|
|||
Image *createImage() {
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = (SurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(&context, flags, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
cl_image_desc imageDesc;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "core/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/helpers/surface_formats.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "runtime/memory_manager/os_agnostic_memory_manager.h"
|
||||
|
@ -51,7 +52,9 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
image.reset(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -189,7 +192,9 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
|
|||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto bigImage = std::unique_ptr<Image>(Image::create(&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -42,7 +42,8 @@ class CreateImageTest : public DeviceFixture,
|
|||
}
|
||||
Image *createImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(context, flags, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -117,7 +118,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -140,7 +143,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -163,7 +168,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -186,7 +193,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -209,7 +218,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -232,7 +243,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -255,7 +268,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -278,7 +293,9 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
|
|||
|
||||
image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -327,7 +344,9 @@ TEST(TestCreateImage, UseSharedContextToCreateImage) {
|
|||
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -386,7 +405,9 @@ TEST(TestCreateImageUseHostPtr, CheckMemoryAllocationForDifferenHostPtrAlignment
|
|||
for (int i = 0; i < 4; i++) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr[i],
|
||||
|
@ -422,7 +443,9 @@ TEST(TestCreateImageUseHostPtr, givenZeroCopyImageValuesWhenUsingHostPtrThenZero
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
hostPtr,
|
||||
|
@ -524,7 +547,9 @@ struct CreateImageHostPtr
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(
|
||||
context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
pHostPtr,
|
||||
|
@ -944,7 +969,8 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR
|
|||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::tiledImagesSupported, image->isTiledAllocation());
|
||||
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
|
||||
|
@ -957,7 +983,8 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr
|
|||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_FALSE(image->isTiledAllocation());
|
||||
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
|
||||
|
@ -1161,7 +1188,9 @@ TEST(ImageTest, givenClMemForceLinearStorageSetWhenCreateImageThenDisallowTiling
|
|||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
@ -1367,7 +1396,7 @@ TEST(ImageTest, givenClMemCopyHostPointerPassedToImageCreateWhenAllocationIsNotI
|
|||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
|
||||
std::unique_ptr<Image> image(Image::create(&ctx, flags, surfaceFormat, &imageDesc, memory, retVal));
|
||||
std::unique_ptr<Image> image(Image::create(&ctx, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, surfaceFormat, &imageDesc, memory, retVal));
|
||||
EXPECT_NE(nullptr, image);
|
||||
|
||||
auto taskCountSent = device->getGpgpuCommandStreamReceiver().peekLatestFlushedTaskCount();
|
||||
|
|
|
@ -72,7 +72,9 @@ HWTEST_P(CreateTiledImageTest, isTiledImageIsSetForTiledImages) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -669,7 +669,7 @@ TEST(validateAndCreateImage, givenInvalidImageFormatWhenValidateAndCreateImageIs
|
|||
Image *image;
|
||||
imageFormat.image_channel_order = 0;
|
||||
imageFormat.image_channel_data_type = 0;
|
||||
image = Image::validateAndCreateImage(&context, 0, 0, 0, &imageFormat, &Image1dDefaults::imageDesc, nullptr, retVal);
|
||||
image = Image::validateAndCreateImage(&context, {}, 0, 0, &imageFormat, &Image1dDefaults::imageDesc, nullptr, retVal);
|
||||
EXPECT_EQ(nullptr, image);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ TEST(validateAndCreateImage, givenNotSupportedImageFormatWhenValidateAndCreateIm
|
|||
cl_int retVal = CL_SUCCESS;
|
||||
Image *image;
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
image = Image::validateAndCreateImage(&context, CL_MEM_READ_WRITE, flags, 0, &imageFormat, &Image1dDefaults::imageDesc, nullptr, retVal);
|
||||
image = Image::validateAndCreateImage(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}), flags, 0, &imageFormat, &Image1dDefaults::imageDesc, nullptr, retVal);
|
||||
EXPECT_EQ(nullptr, image);
|
||||
EXPECT_EQ(CL_IMAGE_FORMAT_NOT_SUPPORTED, retVal);
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ TEST(validateAndCreateImage, givenValidImageParamsWhenValidateAndCreateImageIsCa
|
|||
std::unique_ptr<Image> image = nullptr;
|
||||
image.reset(Image::validateAndCreateImage(
|
||||
&context,
|
||||
flags,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
&imageFormat,
|
||||
|
|
|
@ -76,7 +76,8 @@ class Nv12ImageTest : public testing::Test {
|
|||
|
||||
Image *createImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
return Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
@ -390,7 +391,8 @@ HWTEST_F(Nv12ImageTest, checkIfPlanesAreWritten) {
|
|||
// Create Parent NV12 image
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY | CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto imageNV12 = Image::create(contextWithMockCmdQ, flags, surfaceFormat, &imageDesc, hostPtr, retVal);
|
||||
auto imageNV12 = Image::create(contextWithMockCmdQ, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal);
|
||||
|
||||
EXPECT_EQ(imageNV12->isTiledAllocation() ? 2u : 0u, cmdQ->EnqueueWriteImageCounter);
|
||||
|
||||
|
|
|
@ -72,7 +72,9 @@ TEST_P(PackedYuvImageTest, isPackedYuvImageReturnsTrue) {
|
|||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
&imageDesc,
|
||||
nullptr,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "runtime/command_stream/device_command_stream.h"
|
||||
#include "runtime/command_stream/preemption.h"
|
||||
#include "runtime/event/event.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/helpers/timestamp_packet.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
|
@ -1135,7 +1136,8 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
|
||||
|
@ -1182,7 +1184,8 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
EXPECT_EQ(static_cast<uint32_t>(imageDesc.num_mip_levels), dstImage->peekMipCount());
|
||||
|
@ -1222,7 +1225,8 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAn
|
|||
InjectedFunction method = [&](size_t failureIndex) {
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
if (MemoryManagement::nonfailingAllocation == failureIndex) {
|
||||
EXPECT_NE(nullptr, dstImage.get());
|
||||
} else {
|
||||
|
@ -1264,7 +1268,8 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
|
||||
|
@ -1309,7 +1314,8 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThe
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
|
||||
|
@ -1341,7 +1347,8 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZer
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
|
||||
|
@ -1385,7 +1392,8 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNon
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
EXPECT_EQ(static_cast<uint32_t>(imageDesc.num_mip_levels), dstImage->peekMipCount());
|
||||
|
@ -1429,7 +1437,8 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreated
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
|
||||
ASSERT_NE(nullptr, imageGraphicsAllocation);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "runtime/gmm_helper/gmm.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/helpers/array_count.h"
|
||||
#include "runtime/helpers/memory_properties_flags_helpers.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "runtime/mem_obj/mem_obj_helper.h"
|
||||
|
@ -599,7 +600,8 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCount
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
|
||||
|
@ -627,7 +629,8 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCountNo
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
EXPECT_EQ(static_cast<int>(imageDesc.num_mip_levels), dstImage->peekMipCount());
|
||||
|
@ -661,7 +664,8 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
|
||||
|
@ -689,7 +693,8 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountZ
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, data, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
|
||||
|
@ -716,7 +721,8 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN
|
|||
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, flags, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags({flags}),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
EXPECT_EQ(static_cast<int>(imageDesc.num_mip_levels), dstImage->peekMipCount());
|
||||
|
|
Loading…
Reference in New Issue