Map/unmap enqueue fixes [3/n]: Map params inconsistency

- Introducing MapInfo struct which will be used as container for multiple
  map operations
- Unified mapped offset and size for Buffers and Images
- Fixed incorrect map params for CPU and GPU path
- Missing API level checks


Change-Id: Ib4077c9e2c0c333b131ffd5ccbc4a1404920eb5b
This commit is contained in:
Dunajski, Bartosz
2018-02-13 13:20:34 +01:00
committed by sys_ocldev
parent a95e7c67a3
commit e0ca78ccea
15 changed files with 320 additions and 163 deletions

View File

@ -72,7 +72,7 @@ TEST_F(clEnqueueMapImageTests, returnsSuccess) {
EXPECT_NE(nullptr, image);
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
clEnqueueMapImage(
@ -93,6 +93,37 @@ TEST_F(clEnqueueMapImageTests, returnsSuccess) {
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(clEnqueueMapImageTests, givenAnyZeroRegionParamWhenMapImageCalledThenReturnError) {
auto image = clCreateImage(pContext, CL_MEM_READ_WRITE, &imageFormat, &imageDesc, nullptr, &retVal);
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, image);
const size_t origin[3] = {0, 0, 0};
std::array<size_t, 3> region = {{0, 1, 1}};
auto ptr = clEnqueueMapImage(pCommandQueue, image, CL_TRUE, CL_MAP_READ, origin, &region[0], nullptr, nullptr, 0, nullptr, nullptr, &retVal);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
EXPECT_EQ(nullptr, ptr);
region = {{1, 0, 1}};
ptr = clEnqueueMapImage(pCommandQueue, image, CL_TRUE, CL_MAP_READ, origin, &region[0], nullptr, nullptr, 0, nullptr, nullptr, &retVal);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
EXPECT_EQ(nullptr, ptr);
region = {{1, 1, 0}};
ptr = clEnqueueMapImage(pCommandQueue, image, CL_TRUE, CL_MAP_READ, origin, &region[0], nullptr, nullptr, 0, nullptr, nullptr, &retVal);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
EXPECT_EQ(nullptr, ptr);
region = {{0, 0, 0}};
ptr = clEnqueueMapImage(pCommandQueue, image, CL_TRUE, CL_MAP_READ, origin, &region[0], nullptr, nullptr, 0, nullptr, nullptr, &retVal);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
EXPECT_EQ(nullptr, ptr);
retVal = clReleaseMemObject(image);
EXPECT_EQ(CL_SUCCESS, retVal);
}
struct clEnqueueMapImageYUVTests : public api_fixture,
public ::testing::Test {
@ -135,7 +166,7 @@ TEST_F(clEnqueueMapImageYUVTests, returnSuccess) {
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, image);
const size_t origin[] = {2, 2, 0};
const size_t region[] = {2, 2, 0};
const size_t region[] = {2, 2, 1};
clEnqueueMapImage(
pCommandQueue,
image,

View File

@ -570,3 +570,52 @@ TEST_F(EnqueueMapBufferTest, GivenZeroCopyBufferWhenMapBufferWithoutEventsThenCo
clReleaseMemObject(buffer);
}
TEST_F(EnqueueMapBufferTest, givenBufferWithoutUseHostPtrFlagWhenMappedOnCpuThenSetAllMapParams) {
std::unique_ptr<Buffer> buffer(Buffer::create(BufferDefaults::context, CL_MEM_READ_WRITE, 10, nullptr, retVal));
EXPECT_NE(nullptr, buffer);
EXPECT_TRUE(buffer->mappingOnCpuAllowed());
size_t mapSize = 3;
size_t mapOffset = 2;
auto mappedPtr = clEnqueueMapBuffer(pCmdQ, buffer.get(), CL_FALSE, CL_MAP_READ, mapOffset, mapSize, 0, nullptr, nullptr, &retVal);
EXPECT_NE(nullptr, mappedPtr);
EXPECT_EQ(mapOffset, buffer->getMappedOffset()[0]);
EXPECT_EQ(0u, buffer->getMappedOffset()[1]);
EXPECT_EQ(0u, buffer->getMappedOffset()[2]);
EXPECT_EQ(mapSize, buffer->getMappedSize()[0]);
EXPECT_EQ(0u, buffer->getMappedSize()[1]);
EXPECT_EQ(0u, buffer->getMappedSize()[2]);
auto expectedPtr = ptrOffset(buffer->getCpuAddressForMapping(), mapOffset);
EXPECT_EQ(mappedPtr, expectedPtr);
}
TEST_F(EnqueueMapBufferTest, givenBufferWithUseHostPtrFlagWhenMappedOnCpuThenSetAllMapParams) {
uint8_t hostPtr[10] = {};
std::unique_ptr<Buffer> buffer(Buffer::create(BufferDefaults::context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, 10, hostPtr, retVal));
EXPECT_NE(nullptr, buffer);
EXPECT_TRUE(buffer->mappingOnCpuAllowed());
size_t mapSize = 3;
size_t mapOffset = 2;
auto mappedPtr = clEnqueueMapBuffer(pCmdQ, buffer.get(), CL_FALSE, CL_MAP_READ, mapOffset, mapSize, 0, nullptr, nullptr, &retVal);
EXPECT_NE(nullptr, mappedPtr);
EXPECT_EQ(mapOffset, buffer->getMappedOffset()[0]);
EXPECT_EQ(0u, buffer->getMappedOffset()[1]);
EXPECT_EQ(0u, buffer->getMappedOffset()[2]);
EXPECT_EQ(mapSize, buffer->getMappedSize()[0]);
EXPECT_EQ(0u, buffer->getMappedSize()[1]);
EXPECT_EQ(0u, buffer->getMappedSize()[2]);
auto expectedPtr = ptrOffset(buffer->getCpuAddressForMapping(), mapOffset);
EXPECT_EQ(mappedPtr, expectedPtr);
}

View File

@ -74,7 +74,7 @@ TEST_F(EnqueueMapImageTest, reuseMappedPtrForTiledImg) {
}
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
auto ptr1 = pCmdQ->enqueueMapImage(
image, true, mapFlags, origin,
@ -112,7 +112,7 @@ TEST_F(EnqueueMapImageTest, givenAllocatedMapPtrAndMapWithDifferentOriginIsCalle
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(ptr1, ptr2);
EXPECT_NE(nullptr, img->getAllocatedMappedPtr());
EXPECT_NE(nullptr, img->getAllocatedMapPtr());
size_t mapOffset = img->getSurfaceFormatInfo().ImageElementSizeInBytes * origin2[0] +
img->getHostPtrRowPitch() * origin2[1];
@ -122,9 +122,9 @@ TEST_F(EnqueueMapImageTest, givenAllocatedMapPtrAndMapWithDifferentOriginIsCalle
template <typename GfxFamily>
struct mockedImage : public ImageHw<GfxFamily> {
using ImageHw<GfxFamily>::ImageHw;
void setAllocatedMappedPtr(void *allocatedMappedPtr) override {
void setAllocatedMapPtr(void *allocatedMapPtr) override {
ownershipTaken = this->hasOwnership();
MemObj::setAllocatedMappedPtr(allocatedMappedPtr);
MemObj::setAllocatedMapPtr(allocatedMapPtr);
}
bool ownershipTaken = false;
};
@ -154,7 +154,7 @@ HWTEST_F(EnqueueMapImageTest, givenTiledImageWhenMapImageIsCalledThenStorageIsSe
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
pCmdQ->enqueueMapImage(
&mockImage, true, mapFlags, origin,
@ -166,7 +166,7 @@ HWTEST_F(EnqueueMapImageTest, givenTiledImageWhenMapImageIsCalledThenStorageIsSe
TEST_F(EnqueueMapImageTest, checkPointer) {
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
auto ptr = pCmdQ->enqueueMapImage(
@ -198,7 +198,7 @@ TEST_F(EnqueueMapImageTest, checkPointer) {
TEST_F(EnqueueMapImageTest, checkRetVal) {
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
auto ptr = pCmdQ->enqueueMapImage(
@ -232,7 +232,7 @@ TEST_F(EnqueueMapImageTest, MapImageWaitEvent) {
uint32_t tagHW = 0;
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
size_t GWS = 1;
@ -305,7 +305,7 @@ HWTEST_F(EnqueueMapImageTest, MapImageEventProperties) {
cl_event eventReturned = nullptr;
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
uint32_t forceTaskCount = 100;
@ -351,7 +351,7 @@ HWTEST_F(EnqueueMapImageTest, givenZeroCopyImageWhenItIsMappedAndReturnsEventThe
cl_event eventReturned = nullptr;
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {1, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
uint32_t forceTaskCount = 100;
@ -403,7 +403,7 @@ HWTEST_F(EnqueueMapImageTest, givenZeroCopyImageWhenItIsMappedAndReturnsEventThe
TEST_F(EnqueueMapImageTest, GivenNonZeroCopyImageWhenMappedWithOffsetThenCorrectPointerIsReturned) {
auto mapFlags = CL_MAP_WRITE;
const size_t origin[3] = {1, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
@ -461,7 +461,7 @@ HWTEST_F(EnqueueMapImageTest, givenSharingHandlerWhenMapAndUnmapOnNonTiledImageI
pCmdQ->taskLevel = 1;
size_t origin[] = {0, 0, 0};
size_t region[] = {1, 0, 0};
size_t region[] = {1, 1, 1};
void *data = clEnqueueMapImage(pCmdQ, image, CL_TRUE, CL_MAP_READ, origin, region, nullptr, nullptr, 0, NULL, NULL, &retVal);
EXPECT_NE(nullptr, data);
EXPECT_EQ(CL_SUCCESS, retVal);
@ -475,10 +475,58 @@ HWTEST_F(EnqueueMapImageTest, givenSharingHandlerWhenMapAndUnmapOnNonTiledImageI
delete image;
}
HWTEST_F(EnqueueMapImageTest, givenImageWithouUsetHostPtrFlagWhenMappedOnCpuThenSetAllMapProperties) {
std::unique_ptr<Image> image(ImageHelper<Image1dDefaults>::create(context));
ASSERT_NE(nullptr, image);
EXPECT_TRUE(image->mappingOnCpuAllowed());
size_t origin[] = {2, 1, 1};
size_t region[] = {2, 1, 1};
void *mappedPtr = clEnqueueMapImage(pCmdQ, image.get(), CL_TRUE, CL_MAP_READ, origin, region, nullptr, nullptr, 0, NULL, NULL, &retVal);
EXPECT_NE(nullptr, mappedPtr);
EXPECT_EQ(origin[0], image->getMappedOffset()[0]);
EXPECT_EQ(origin[1], image->getMappedOffset()[1]);
EXPECT_EQ(origin[2], image->getMappedOffset()[2]);
EXPECT_EQ(region[0], image->getMappedSize()[0]);
EXPECT_EQ(region[1], image->getMappedSize()[1]);
EXPECT_EQ(region[2], image->getMappedSize()[2]);
auto offset = image->calculateOffset(image->getImageDesc().image_row_pitch, image->getImageDesc().image_slice_pitch, origin);
auto expectedPtr = ptrOffset(image->getCpuAddressForMapping(), offset);
EXPECT_EQ(mappedPtr, expectedPtr);
}
HWTEST_F(EnqueueMapImageTest, givenImageWithUseHostPtrFlagWhenMappedOnCpuThenSetAllMapProperties) {
std::unique_ptr<Image> image(ImageHelper<ImageUseHostPtr<Image1dDefaults>>::create(context));
ASSERT_NE(nullptr, image);
EXPECT_TRUE(image->mappingOnCpuAllowed());
size_t origin[] = {2, 1, 1};
size_t region[] = {2, 1, 1};
void *mappedPtr = clEnqueueMapImage(pCmdQ, image.get(), CL_TRUE, CL_MAP_READ, origin, region, nullptr, nullptr, 0, NULL, NULL, &retVal);
EXPECT_NE(nullptr, mappedPtr);
EXPECT_EQ(origin[0], image->getMappedOffset()[0]);
EXPECT_EQ(origin[1], image->getMappedOffset()[1]);
EXPECT_EQ(origin[2], image->getMappedOffset()[2]);
EXPECT_EQ(region[0], image->getMappedSize()[0]);
EXPECT_EQ(region[1], image->getMappedSize()[1]);
EXPECT_EQ(region[2], image->getMappedSize()[2]);
auto offset = image->calculateOffset(image->getImageDesc().image_row_pitch, image->getImageDesc().image_slice_pitch, origin);
auto expectedPtr = ptrOffset(image->getCpuAddressForMapping(), offset);
EXPECT_EQ(mappedPtr, expectedPtr);
}
TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingMapWith2DImageIsEnqueuedAndEventAsynchrounouslyCompletedThenEnqueueFinishesWithoutStall) {
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;
@ -517,7 +565,7 @@ TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingMapWith2DImageIs
TEST_F(EnqueueMapImageTest, givenBlockedCommandQueueWhenBlockingMapWith1DImageIsEnqueuedAndEventAsynchrounouslyCompletedThenEnqueueFinishesWithoutStall) {
auto mapFlags = CL_MAP_READ;
const size_t origin[3] = {0, 0, 0};
const size_t region[3] = {0, 0, 0};
const size_t region[3] = {1, 1, 1};
size_t imageRowPitch = 0;
size_t imageSlicePitch = 0;

View File

@ -70,8 +70,10 @@ class ImageUnmapTest : public ::testing::Test {
HWTEST_F(ImageUnmapTest, givenImageWhenUnmapMemObjIsCalledThenEnqueueNonBlockingMapImage) {
std::unique_ptr<MyMockCommandQueue<FamilyType>> commandQueue(new MyMockCommandQueue<FamilyType>(&context));
void *ptr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize);
image->setAllocatedMappedPtr(ptr);
image->setMappedPtr(ptr);
size_t origin[3] = {0, 0, 0};
size_t region[3] = {1, 1, 1};
image->setAllocatedMapPtr(ptr);
image->setMapInfo(ptr, region, origin);
commandQueue->enqueueUnmapMemObject(image.get(), ptr, 0, nullptr, nullptr);
EXPECT_EQ(ptr, commandQueue->passedPtr);
EXPECT_EQ((cl_bool)CL_FALSE, commandQueue->passedBlockingWrite);
@ -119,10 +121,10 @@ TEST_F(ImageUnmapTest, givenImageWhenEnqueueMapImageIsCalledTwiceThenAllocatedMe
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<CommandQueue> commandQueue(CommandQueue::create(&context, device.get(), nullptr, retVal));
commandQueue->enqueueMapImage(image.get(), CL_FALSE, 0, origin, region, nullptr, nullptr, 0, nullptr, nullptr, retVal);
EXPECT_NE(nullptr, image->getAllocatedMappedPtr());
void *ptr = image->getAllocatedMappedPtr();
EXPECT_NE(nullptr, image->getAllocatedMapPtr());
void *ptr = image->getAllocatedMapPtr();
EXPECT_EQ(alignUp(ptr, MemoryConstants::pageSize), ptr);
commandQueue->enqueueMapImage(image.get(), CL_FALSE, 0, origin, region, nullptr, nullptr, 0, nullptr, nullptr, retVal);
EXPECT_EQ(ptr, image->getAllocatedMappedPtr());
EXPECT_EQ(ptr, image->getAllocatedMapPtr());
commandQueue->enqueueUnmapMemObject(image.get(), ptr, 0, nullptr, nullptr);
}

View File

@ -991,3 +991,17 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
EXPECT_FALSE(myMemoryManager->capturedImgInfo.preferRenderCompression);
}
TEST(ImageTest, givenImageWhenAskedForPtrOffsetThenReturnCorrectValue) {
MockContext ctx;
std::unique_ptr<Image> image(ImageHelper<Image3dDefaults>::create(&ctx));
size_t origin[3] = {4, 5, 6};
size_t rowPitch = 7;
size_t slicePitch = 8;
auto retOffset = image->calculateOffset(rowPitch, slicePitch, origin);
size_t expectedOffset = image->getSurfaceFormatInfo().ImageElementSizeInBytes * origin[0] + rowPitch * origin[1] + slicePitch * origin[2];
EXPECT_EQ(expectedOffset, retOffset);
}

View File

@ -161,7 +161,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled
if (hasAllocatedMappedPtr) {
auto allocatedPtr = alignedMalloc(size, MemoryConstants::pageSize);
memObj->setAllocatedMappedPtr(allocatedPtr);
memObj->setAllocatedMapPtr(allocatedPtr);
}
auto mockCsr = new ::testing::NiceMock<MyCsr<FamilyType>>(device->getHardwareInfo());
@ -189,13 +189,15 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled
if (!hasAllocatedMappedPtr) {
delete memObj;
allocation = memoryManager->allocateGraphicsMemory(size, MemoryConstants::pageSize);
size_t origin[3] = {0, 0, 0};
size_t region[3] = {1, 1, 1};
memObj = new MemObj(&context, CL_MEM_OBJECT_BUFFER,
CL_MEM_READ_WRITE,
size,
storage, nullptr, allocation, true, false, false);
memObj->setMappedPtr(storage);
memObj->setMapInfo(storage, region, origin);
} else {
memObj->setAllocatedMappedPtr(storage);
memObj->setAllocatedMapPtr(storage);
}
makeMemObjUsed();

View File

@ -22,6 +22,7 @@
#include "runtime/mem_obj/mem_obj.h"
#include "runtime/device/device.h"
#include "runtime/helpers/properties_helper.h"
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_deferred_deleter.h"
#include "unit_tests/mocks/mock_graphics_allocation.h"
@ -59,8 +60,12 @@ TEST(MemObj, GivenMemObjWhenInititalizedFromHostPtrThenInitializeFields) {
EXPECT_EQ(size, memObj.getSize());
EXPECT_EQ(static_cast<cl_mem_flags>(CL_MEM_USE_HOST_PTR), memObj.getFlags());
EXPECT_EQ(nullptr, memObj.getMappedPtr());
EXPECT_EQ(0u, memObj.getMappedSize());
EXPECT_EQ(0u, memObj.getMappedOffset());
EXPECT_EQ(0u, memObj.getMappedSize()[0]);
EXPECT_EQ(0u, memObj.getMappedSize()[1]);
EXPECT_EQ(0u, memObj.getMappedSize()[2]);
EXPECT_EQ(0u, memObj.getMappedOffset()[0]);
EXPECT_EQ(0u, memObj.getMappedOffset()[1]);
EXPECT_EQ(0u, memObj.getMappedOffset()[2]);
}
TEST(MemObj, givenMemObjectWhenAskedForTransferToHostPtrThenDoNothing) {
@ -104,12 +109,33 @@ TEST(MemObj, givenMemObjWhenAllocatedMappedPtrIsSetThenGetMappedPtrIsDifferentTh
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, CL_MEM_USE_HOST_PTR,
1, nullptr, nullptr, nullptr, true, false, false);
EXPECT_EQ(nullptr, memObj.getAllocatedMappedPtr());
EXPECT_EQ(nullptr, memObj.getAllocatedMapPtr());
EXPECT_EQ(nullptr, memObj.getMappedPtr());
memObj.setAllocatedMappedPtr(mockPtr);
EXPECT_EQ(mockPtr, memObj.getAllocatedMappedPtr());
memObj.setAllocatedMapPtr(mockPtr);
EXPECT_EQ(mockPtr, memObj.getAllocatedMapPtr());
EXPECT_NE(mockPtr, memObj.getMappedPtr());
memObj.setAllocatedMappedPtr(nullptr);
memObj.setAllocatedMapPtr(nullptr);
}
TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostPtr) {
uint8_t hostPtr = 0;
MockContext context;
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, CL_MEM_USE_HOST_PTR,
1, nullptr, &hostPtr, nullptr, true, false, false);
EXPECT_EQ(&hostPtr, memObj.getBasePtrForMap());
}
TEST(MemObj, givenHostPtrWithoutUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnAllocatedPtr) {
uint8_t hostPtr = 0;
MockContext context;
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, CL_MEM_COPY_HOST_PTR,
1, nullptr, &hostPtr, nullptr, true, false, false);
EXPECT_NE(&hostPtr, memObj.getBasePtrForMap());
EXPECT_EQ(memObj.getAllocatedMapPtr(), memObj.getBasePtrForMap());
}
TEST(MemObj, givenMemObjWhenReleaseAllocatedPtrIsCalledTwiceThenItDoesntCrash) {
@ -120,11 +146,11 @@ TEST(MemObj, givenMemObjWhenReleaseAllocatedPtrIsCalledTwiceThenItDoesntCrash) {
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, CL_MEM_USE_HOST_PTR,
1, nullptr, nullptr, nullptr, true, false, false);
memObj.setAllocatedMappedPtr(allocatedPtr);
memObj.releaseAllocatedMappedPtr();
EXPECT_EQ(nullptr, memObj.getAllocatedMappedPtr());
memObj.releaseAllocatedMappedPtr();
EXPECT_EQ(nullptr, memObj.getAllocatedMappedPtr());
memObj.setAllocatedMapPtr(allocatedPtr);
memObj.releaseAllocatedMapPtr();
EXPECT_EQ(nullptr, memObj.getAllocatedMapPtr());
memObj.releaseAllocatedMapPtr();
EXPECT_EQ(nullptr, memObj.getAllocatedMapPtr());
}
TEST(MemObj, givenNotReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThenAllocationIsAddedToMemoryManagerAllocationList) {