Connect UnifiedMemoryProperties with MemoryPropertiesFlags

-Add support to SvmAllocationData
-Refactor parseMemoryProperties
-Add allocation flags

Related-To: NEO-4011
Change-Id: I3728d2319aeef983dbcc3f8702da9a303a4e2b9c
Signed-off-by: Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Gibala
2019-12-05 10:32:42 +01:00
committed by sys_ocldev
parent ac0471adc5
commit 5ac1d1258c
59 changed files with 318 additions and 267 deletions

View File

@@ -86,7 +86,7 @@ HWTEST_P(AUBCopyImage, simple) {
auto retVal = CL_INVALID_VALUE;
srcImage.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -97,7 +97,7 @@ HWTEST_P(AUBCopyImage, simple) {
dstImage.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -180,7 +180,7 @@ HWTEST_P(AubFillImage, simple) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -126,7 +126,7 @@ HWTEST_P(AUBMapImage, MapUpdateUnmapVerify) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
srcImage.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -124,7 +124,7 @@ HWTEST_F(AUBReadBuffer, reserveCanonicalGpuAddress) {
MemoryPool::MemoryNull);
std::unique_ptr<Buffer> srcBuffer(Buffer::createBufferHw(&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0),
CL_MEM_USE_HOST_PTR,
0,
sizeof(srcMemory),

View File

@@ -144,7 +144,7 @@ HWTEST_P(AUBReadImage, simpleUnalignedMemory) {
auto retVal = CL_INVALID_VALUE;
srcImage.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -81,7 +81,7 @@ struct AUBImageUnaligned
auto image = std::unique_ptr<Image>(Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -176,7 +176,7 @@ struct AUBImageUnaligned
auto image = std::unique_ptr<Image>(Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -72,7 +72,7 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces
auto retVal = CL_INVALID_VALUE;
std::unique_ptr<Image> image(Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -138,7 +138,7 @@ HWTEST_P(AUBWriteImage, simpleUnalignedMemory) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
dstImage.reset(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -332,7 +332,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, deviceSideVme) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto srcImage = Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -343,7 +343,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, deviceSideVme) {
auto refImage = Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -111,7 +111,7 @@ HWTEST_P(AUBCreateImageArray, CheckArrayImages) {
image.reset(Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -241,7 +241,7 @@ HWTEST_P(CopyHostPtrTest, imageWithDoubledRowPitchThatIsCreatedWithCopyHostPtrFl
data += passedRowPitch;
}
image.reset(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
image.reset(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, pHostPtr, retVal));
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(image->getImageDesc().image_row_pitch, imgInfo.rowPitch);
@@ -311,7 +311,7 @@ HWTEST_P(UseHostPtrTest, imageWithRowPitchCreatedWithUseHostPtrFlagCopiedActuall
}
image.reset(Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -407,7 +407,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
image.reset(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, host_ptr, retVal));
depthToCopy = imageDesc.image_depth;

View File

@@ -919,7 +919,7 @@ TEST_F(EnqueueMapImageTest, givenImage1DArrayWhenEnqueueMapImageIsCalledThenRetu
class MockImage : public Image {
public:
MockImage(Context *context, cl_mem_flags flags, GraphicsAllocation *allocation, const SurfaceFormatInfo &surfaceFormat,
const cl_image_format &imageFormat, const cl_image_desc &imageDesc) : Image(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0,
const cl_image_format &imageFormat, const cl_image_desc &imageDesc) : Image(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0,
0, nullptr,
imageFormat, imageDesc,
true,

View File

@@ -214,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> dstImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, dstImage.get());
size_t dstOrigin[3] = {1024u, 1, 0};
@@ -238,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> srcImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, srcImage.get());
std::unique_ptr<Image> dstImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> dstImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, srcImage.get());
size_t srcOrigin[3] = {1024u, 1, 0};
@@ -266,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> srcImage(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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));
@@ -305,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, image.get());
size_t origin[3] = {1024u, 1, 0};
@@ -351,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, image.get());
void *ptr = ::alignedMalloc(1024u, 4096);
@@ -401,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
std::unique_ptr<Image> image(Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, image.get());
void *ptr = ::alignedMalloc(1024u, 4096);

View File

@@ -114,7 +114,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(Traits::flags, 0), Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal);
auto img = Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(Traits::flags, 0, 0), Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal);
auto mockImage = static_cast<MockImage<FamilyType> *>(img);
return std::unique_ptr<MockImage<FamilyType>>(mockImage);

View File

@@ -470,7 +470,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags((1 << 21), 0), (1 << 21), 0, size, static_cast<void *>(NULL), retVal));
auto buffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags((1 << 21), 0, 0), (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);
@@ -488,7 +488,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
cl_device_id deviceId = static_cast<cl_device_id>(device.get());
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0);
size_t size = 0u;
@@ -560,7 +560,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -619,7 +619,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -680,7 +680,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -75,7 +75,7 @@ struct ImageHelper {
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat);
auto image = Image::create(
context,
NEO::MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(Traits::flags, 0),
NEO::MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(Traits::flags, 0, 0),
Traits::flags,
0,
surfaceFormat,

View File

@@ -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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
image.reset(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
}
cl_int retVal = CL_SUCCESS;

View File

@@ -275,7 +275,7 @@ TEST(CastToImage, fromMemObj) {
extern std::thread::id tempThreadID;
class MockBuffer : public MockBufferStorage, public Buffer {
public:
MockBuffer() : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, &mockGfxAllocation, true, false, false) {
MockBuffer() : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, &mockGfxAllocation, true, false, false) {
}
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnly) override {

View File

@@ -17,7 +17,9 @@ TEST(MemoryPropertiesParser, givenNullPropertiesWhenParsingMemoryPropertiesThenT
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN));
}
TEST(MemoryPropertiesParser, givenEmptyPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) {
@@ -26,9 +28,11 @@ TEST(MemoryPropertiesParser, givenEmptyPropertiesWhenParsingMemoryPropertiesThen
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN));
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::BUFFER));
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::UNKNOWN));
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::BUFFER));
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) {
@@ -38,12 +42,16 @@ TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesThen
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_NO_ACCESS,
CL_MEM_FLAGS_INTEL,
CL_MEM_LOCALLY_UNCACHED_RESOURCE | CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE,
CL_MEM_ALLOC_FLAGS_INTEL,
CL_MEM_ALLOC_WRITE_COMBINED_INTEL, CL_MEM_ALLOC_DEFAULT_INTEL,
0};
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::UNKNOWN));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::UNKNOWN));
}
TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesForBufferThenTrueIsReturned) {
@@ -57,7 +65,9 @@ TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesForB
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::BUFFER));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::BUFFER));
}
TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesForImageThenTrueIsReturned) {
@@ -71,7 +81,9 @@ TEST(MemoryPropertiesParser, givenValidPropertiesWhenParsingMemoryPropertiesForI
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_TRUE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesThenFalseIsReturned) {
@@ -82,9 +94,11 @@ TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesTh
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::UNKNOWN));
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::BUFFER));
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::UNKNOWN));
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::BUFFER));
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
@@ -98,7 +112,9 @@ TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesFo
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenInvalidFlagsWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
@@ -112,7 +128,9 @@ TEST(MemoryPropertiesParser, givenInvalidFlagsWhenParsingMemoryPropertiesForImag
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
@@ -126,7 +144,9 @@ TEST(MemoryPropertiesParser, givenInvalidFlagsIntelWhenParsingMemoryPropertiesFo
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::IMAGE));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::IMAGE));
}
TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
@@ -140,7 +160,9 @@ TEST(MemoryPropertiesParser, givenInvalidPropertiesWhenParsingMemoryPropertiesFo
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::BUFFER));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::BUFFER));
}
TEST(MemoryPropertiesParser, givenInvalidFlagsWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
@@ -154,7 +176,9 @@ TEST(MemoryPropertiesParser, givenInvalidFlagsWhenParsingMemoryPropertiesForBuff
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::BUFFER));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::BUFFER));
}
TEST(MemoryPropertiesParser, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
@@ -168,7 +192,9 @@ TEST(MemoryPropertiesParser, givenInvalidFlagsIntelWhenParsingMemoryPropertiesFo
MemoryPropertiesFlags memoryProperties;
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, MemoryPropertiesParser::ObjType::BUFFER));
cl_mem_alloc_flags_intel allocflags = 0;
EXPECT_FALSE(MemoryPropertiesParser::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags, MemoryPropertiesParser::ObjType::BUFFER));
}
TEST(MemoryPropertiesParser, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) {

View File

@@ -15,50 +15,56 @@ using namespace NEO;
TEST(MemoryPropertiesFlags, givenValidPropertiesWhenCreateMemoryPropertiesFlagsThenTrueIsReturned) {
MemoryPropertiesFlags properties;
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0);
EXPECT_TRUE(properties.flags.readWrite);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_WRITE_ONLY, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_WRITE_ONLY, 0, 0);
EXPECT_TRUE(properties.flags.writeOnly);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_ONLY, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_ONLY, 0, 0);
EXPECT_TRUE(properties.flags.readOnly);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
EXPECT_TRUE(properties.flags.useHostPtr);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_ALLOC_HOST_PTR, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_ALLOC_HOST_PTR, 0, 0);
EXPECT_TRUE(properties.flags.allocHostPtr);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
EXPECT_TRUE(properties.flags.copyHostPtr);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_WRITE_ONLY, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_WRITE_ONLY, 0, 0);
EXPECT_TRUE(properties.flags.hostWriteOnly);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_READ_ONLY, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_READ_ONLY, 0, 0);
EXPECT_TRUE(properties.flags.hostReadOnly);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_NO_ACCESS, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_HOST_NO_ACCESS, 0, 0);
EXPECT_TRUE(properties.flags.hostNoAccess);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_KERNEL_READ_AND_WRITE, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_KERNEL_READ_AND_WRITE, 0, 0);
EXPECT_TRUE(properties.flags.kernelReadAndWrite);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0, 0);
EXPECT_TRUE(properties.flags.accessFlagsUnrestricted);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_NO_ACCESS_INTEL, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_NO_ACCESS_INTEL, 0, 0);
EXPECT_TRUE(properties.flags.noAccess);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE, 0);
EXPECT_TRUE(properties.flags.locallyUncachedResource);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0);
EXPECT_TRUE(properties.flags.locallyUncachedInSurfaceState);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, 0);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL, 0, 0);
EXPECT_TRUE(properties.flags.forceSharedPhysicalMemory);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, CL_MEM_ALLOC_WRITE_COMBINED_INTEL);
EXPECT_TRUE(properties.allocFlags.allocWriteCombined);
properties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, CL_MEM_ALLOC_DEFAULT_INTEL);
EXPECT_TRUE(properties.allocFlags.allocDefault);
}
TEST(MemoryPropertiesFlags, givenClMemForceLinearStorageFlagWhenCreateMemoryPropertiesFlagsThenReturnProperValue) {
@@ -68,22 +74,22 @@ TEST(MemoryPropertiesFlags, givenClMemForceLinearStorageFlagWhenCreateMemoryProp
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags = 0;
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags = 0;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_FALSE(memoryProperties.flags.forceLinearStorage);
}
@@ -94,21 +100,21 @@ TEST(MemoryPropertiesFlags, givenClAllowUnrestrictedSizeFlagWhenCreateMemoryProp
flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
flags = 0;
flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
flags = 0;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_FALSE(memoryProperties.flags.allowUnrestrictedSize);
}

View File

@@ -92,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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);
@@ -131,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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);
@@ -151,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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);
@@ -167,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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);
@@ -212,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
cl_mem memObj = img.get();
retVal = pKernel->setArg(0, sizeof(memObj), &memObj);
@@ -249,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(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
std::unique_ptr<Image> img(Image::create(context.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
cl_mem memObj = img.get();
MockSharingHandler *mockSharingHandler = new MockSharingHandler;

View File

@@ -2052,7 +2052,7 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) {
cl_int retVal;
MockContext context;
std::unique_ptr<NEO::Image> imageNV12(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<NEO::Image> imageNV12(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(imageNV12->getMediaPlaneType(), 0u);
@@ -2066,7 +2066,7 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) {
imageDesc.image_depth = 0;
imageDesc.mem_object = imageNV12.get();
std::unique_ptr<NEO::Image> imageY(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<NEO::Image> imageY(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(imageY->getMediaPlaneType(), 0u);

View File

@@ -80,11 +80,11 @@ TEST(Buffer, givenReadOnlySetOfInputFlagsWhenPassedToisReadOnlyMemoryPermittedBy
using Buffer::isReadOnlyMemoryPermittedByFlags;
};
cl_mem_flags flags = CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
flags = CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
}
@@ -98,7 +98,7 @@ TEST_P(BufferReadOnlyTest, givenNonReadOnlySetOfInputFlagsWhenPassedToisReadOnly
};
cl_mem_flags flags = GetParam() | CL_MEM_USE_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
EXPECT_FALSE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
}
static cl_mem_flags nonReadOnlyFlags[] = {
@@ -326,7 +326,7 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrRende
}
TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -335,7 +335,7 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB
}
TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -344,7 +344,7 @@ TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocatio
}
TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = true;
@@ -353,7 +353,7 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy
}
TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = true;
@@ -363,7 +363,7 @@ TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTy
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -373,7 +373,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -383,7 +383,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried
TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -393,7 +393,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -403,7 +403,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffers
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -413,7 +413,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE
TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -423,7 +423,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory
TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) {
cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;
@@ -432,7 +432,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocatio
}
TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, 0, 0);
MockContext context;
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
context.isSharedContext = false;

View File

@@ -63,7 +63,7 @@ typedef CreateImageFormatTest<CL_MEM_READ_WRITE> ReadWriteFormatTest;
TEST_P(ReadWriteFormatTest, returnsSuccess) {
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -88,7 +88,7 @@ typedef CreateImageFormatTest<CL_MEM_READ_ONLY> ReadOnlyFormatTest;
TEST_P(ReadOnlyFormatTest, returnsSuccess) {
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -111,7 +111,7 @@ typedef CreateImageFormatTest<CL_MEM_WRITE_ONLY> WriteOnlyFormatTest;
TEST_P(WriteOnlyFormatTest, returnsSuccess) {
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -75,7 +75,7 @@ HWTEST_P(CreateImage1DType, validTypes) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
}
cl_image_format imageFormat;
cl_image_desc imageDesc;
@@ -87,7 +87,7 @@ TEST_F(Image2dFromBufferTest, givenBufferWhenCreateImage2dArrayFromBufferThenIma
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = (SurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal);
}
TEST_F(Image2dFromBufferTest, CalculateRowPitch) {
@@ -102,7 +102,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidRowPitchWhenCreateImage2dFromBufferThe
imageDesc.image_row_pitch = 255;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = (SurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, ptr);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, ptr);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -130,7 +130,7 @@ TEST_F(Image2dFromBufferTest, InvalidHostPtrAlignment) {
ASSERT_NE(nullptr, imageDesc.mem_object);
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = (SurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
clReleaseMemObject(imageDesc.mem_object);
@@ -142,7 +142,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidFlagsWhenValidateIsCalledThenReturnErr
for (auto flag : flags) {
const auto surfaceFormat = Image::getSurfaceFormatFromTable(flag, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flag, 0), surfaceFormat, &imageDesc, reinterpret_cast<void *>(0x12345));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flag, 0, 0), surfaceFormat, &imageDesc, reinterpret_cast<void *>(0x12345));
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
}
@@ -154,7 +154,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel8BitColorsNoRowPitchSpecifiedAndToo
imageFormat.image_channel_order = CL_R;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -165,7 +165,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel16BitColorsNoRowPitchSpecifiedAndTo
imageFormat.image_channel_order = CL_R;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -176,7 +176,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsNoRowPitchSpecifiedAndTo
imageFormat.image_channel_order = CL_RGBA;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -187,7 +187,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel16BitColorsNoRowPitchSpecifiedAndT
imageFormat.image_channel_order = CL_RGBA;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -199,7 +199,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp
imageFormat.image_channel_order = CL_RGBA;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_SUCCESS, retVal);
}
@@ -212,7 +212,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpeci
imageFormat.image_channel_order = CL_RGBA;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}
@@ -225,7 +225,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign
imageFormat.image_channel_order = CL_R;
const auto surfaceFormat = static_cast<const SurfaceFormatInfo *>(Image::getSurfaceFormatFromTable(flags, &imageFormat));
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, NULL);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
}

View File

@@ -55,7 +55,7 @@ class CreateImage2DTest : public DeviceFixture,
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}
cl_image_format imageFormat;
cl_image_desc imageDesc;

View File

@@ -60,7 +60,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
auto image = Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
ASSERT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, image);

View File

@@ -74,7 +74,7 @@ HWTEST_P(CreateImageArraySize, arrayTypes) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -115,7 +115,7 @@ HWTEST_P(CreateImageNonArraySize, NonArrayTypes) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -61,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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
}
cl_image_format imageFormat;
cl_image_desc imageDesc;

View File

@@ -52,7 +52,7 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image.reset(Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -192,7 +192,7 @@ 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, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -42,7 +42,7 @@ class CreateImageTest : public DeviceFixture,
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
return Image::create(context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}
@@ -118,7 +118,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -143,7 +143,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -168,7 +168,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -193,7 +193,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -218,7 +218,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -243,7 +243,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -268,7 +268,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -293,7 +293,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc
image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -344,7 +344,7 @@ TEST(TestCreateImage, UseSharedContextToCreateImage) {
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -405,7 +405,7 @@ TEST(TestCreateImageUseHostPtr, CheckMemoryAllocationForDifferenHostPtrAlignment
for (int i = 0; i < 4; i++) {
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -443,7 +443,7 @@ TEST(TestCreateImageUseHostPtr, givenZeroCopyImageValuesWhenUsingHostPtrThenZero
auto image = std::unique_ptr<Image>(Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -531,7 +531,7 @@ struct CreateImageHostPtr
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(
context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -947,7 +947,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, image);
EXPECT_EQ(UnitTestHelper<FamilyType>::tiledImagesSupported, image->isTiledAllocation());
@@ -961,7 +961,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
auto image = std::unique_ptr<Image>(Image::create(mockContext.get(), MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
ASSERT_NE(nullptr, image);
EXPECT_FALSE(image->isTiledAllocation());
@@ -1166,7 +1166,7 @@ TEST(ImageTest, givenClMemForceLinearStorageSetWhenCreateImageThenDisallowTiling
auto image = std::unique_ptr<Image>(Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,
@@ -1374,7 +1374,7 @@ TEST(ImageTest, givenClMemCopyHostPointerPassedToImageCreateWhenAllocationIsNotI
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(Image::create(&ctx, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, surfaceFormat, &imageDesc, memory, retVal));
std::unique_ptr<Image> image(Image::create(&ctx, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, memory, retVal));
EXPECT_NE(nullptr, image);
auto taskCountSent = device->getGpgpuCommandStreamReceiver().peekLatestFlushedTaskCount();

View File

@@ -72,7 +72,7 @@ HWTEST_P(CreateTiledImageTest, isTiledImageIsSetForTiledImages) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), flags, 0, &imageFormat, &Image1dDefaults::imageDesc, nullptr, retVal);
image = Image::validateAndCreateImage(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), 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,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
&imageFormat,

View File

@@ -39,7 +39,7 @@ class MemObjDestructionTest : public ::testing::TestWithParam<bool> {
allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{size});
memObj = new MemObj(context.get(), CL_MEM_OBJECT_BUFFER,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0), CL_MEM_READ_WRITE, 0,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0), CL_MEM_READ_WRITE, 0,
size,
nullptr, nullptr, allocation, true, false, false);
csr = device->getDefaultEngine().commandStreamReceiver;
@@ -218,7 +218,7 @@ HWTEST_P(MemObjAsyncDestructionTest, givenUsedMemObjWithAsyncDestructionsEnabled
MemObjSizeArray region = {{1, 1, 1}};
cl_map_flags mapFlags = CL_MAP_READ;
memObj = new MemObj(context.get(), CL_MEM_OBJECT_BUFFER,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0), CL_MEM_READ_WRITE, 0,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0), CL_MEM_READ_WRITE, 0,
size,
storage, nullptr, allocation, true, false, false);
memObj->addMappedPtr(storage, 1, mapFlags, region, origin, 0);

View File

@@ -34,82 +34,82 @@ TEST(MemObjHelper, givenClMemForceLinearStorageFlagWhenCheckForLinearStorageForc
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags = 0;
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
flags = 0;
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_FALSE(memoryProperties.flags.forceLinearStorage);
}
TEST(MemObjHelper, givenValidPropertiesWhenValidatingMemoryPropertiesThenTrueIsReturned) {
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = CL_MEM_NO_ACCESS_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = CL_MEM_NO_ACCESS_INTEL;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = 0;
flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = 0;
flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr));
flags = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = 0;
flagsIntel = 0;
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel));
@@ -123,7 +123,7 @@ struct Image1dWithAccessFlagsUnrestricted : public Image1dDefaults {
TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertiesForImageThenFalseIsReturned) {
cl_mem_flags flags = 0;
cl_mem_flags_intel flagsIntel = 0;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
MockContext context;
auto image = clUniquePtr(Image1dHelper<>::create(&context));
@@ -133,13 +133,13 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
for (auto hostPtrFlag : hostPtrFlags) {
flags = hostPtrFlag;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags = hostPtrFlag;
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get()));
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get()));
flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, flagsIntel, 0);
flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL;
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get()));
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get()));

View File

@@ -61,7 +61,7 @@ TEST(MemObj, GivenMemObjWhenInititalizedFromHostPtrThenInitializeFields) {
char buffer[size];
MockContext context;
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
sizeof(buffer), buffer, buffer, mockAllocation, true, false, false);
@@ -77,7 +77,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferToHostPtrThenDoNothing) {
uint8_t expectedHostPtr[size] = {};
MockContext context;
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr));
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
size, hostPtr, hostPtr, mockAllocation, true, false, false);
@@ -97,7 +97,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) {
uint8_t expectedBufferPtr[size] = {};
MockContext context;
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr));
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_PIPE, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
size, hostPtr, hostPtr, mockAllocation, true, false, false);
@@ -114,7 +114,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) {
TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostPtr) {
uint8_t hostPtr = 0;
MockContext context;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, &hostPtr, nullptr, true, false, false);
@@ -124,7 +124,7 @@ TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostP
TEST(MemObj, givenHostPtrWithoutUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnAllocatedPtr) {
uint8_t hostPtr = 0;
MockContext context;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
1, nullptr, &hostPtr, nullptr, true, false, false);
@@ -136,7 +136,7 @@ TEST(MemObj, givenMemObjWhenReleaseAllocatedPtrIsCalledTwiceThenItDoesntCrash) {
void *allocatedPtr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize);
MockContext context;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, nullptr, true, false, false);
@@ -156,7 +156,7 @@ TEST(MemObj, givenNotReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThe
auto defaultEngine = context.getDevice(0)->getDefaultEngine();
allocation->updateTaskCount(2, defaultEngine.osContext->getContextId());
*(defaultEngine.commandStreamReceiver->getTagAddress()) = 1;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
auto &allocationList = defaultEngine.commandStreamReceiver->getTemporaryAllocations();
@@ -175,7 +175,7 @@ TEST(MemObj, givenReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThenAl
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
allocation->updateTaskCount(1, device->getDefaultEngine().osContext->getContextId());
*device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 1;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
@@ -193,7 +193,7 @@ TEST(MemObj, givenNotUsedGraphicsAllocationWhenMemObjDestroysAllocationAsyncThen
context.memoryManager = &memoryManager;
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
@@ -211,7 +211,7 @@ TEST(MemObj, givenMemoryManagerWithoutDeviceWhenMemObjDestroysAllocationAsyncThe
context.memoryManager = &memoryManager;
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
@@ -227,7 +227,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageWithProperCommandWhenCheckIfMemTra
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
context.memoryManager = &memoryManager;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
void *ptr = memObj.getCpuAddressForMemoryTransfer();
@@ -254,7 +254,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageBadCommandWhenCheckIfMemTransferRe
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
context.memoryManager = &memoryManager;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
void *ptr = memObj.getCpuAddressForMemoryTransfer();
@@ -266,7 +266,7 @@ TEST(MemObj, givenMemObjAndPointerToDiffrentStorageAndProperCommandWhenCheckIfMe
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
context.memoryManager = &memoryManager;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
void *ptr = (void *)0x1234;
@@ -278,7 +278,7 @@ TEST(MemObj, givenSharingHandlerWhenAskedForCpuMappingThenReturnFalse) {
MockContext context;
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, allocation, true, false, false);
memObj.setSharingHandler(new SharingHandler());
@@ -290,7 +290,7 @@ TEST(MemObj, givenTiledObjectWhenAskedForCpuMappingThenReturnFalse) {
using MemObj::MemObj;
bool isTiledAllocation() const override { return true; }
};
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MyMemObj memObj(nullptr, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
MemoryConstants::pageSize, nullptr, nullptr, nullptr, true, false, false);
@@ -305,7 +305,7 @@ TEST(MemObj, givenRenderCompressedGmmWhenAskingForMappingOnCpuThenDisallow) {
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
allocation->setDefaultGmm(new Gmm(nullptr, 1, false));
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
1, allocation->getUnderlyingBuffer(), nullptr, allocation, false, false, false);
@@ -322,7 +322,7 @@ TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) {
context.memoryManager = &memoryManager;
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_COPY_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
64, allocation->getUnderlyingBuffer(), nullptr, allocation, true, false, false);
@@ -339,7 +339,7 @@ TEST(MemObj, givenNonCpuAccessibleMemoryWhenAskingForMappingOnCpuThenDisallow) {
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
allocation->setDefaultGmm(new Gmm(nullptr, 1, false));
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
1, allocation->getUnderlyingBuffer(), nullptr, allocation, false, false, false);
@@ -389,7 +389,7 @@ TEST(MemObj, givenSharedMemObjectWithNullGfxAllocationWhenSettingGfxAllocationTh
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
context.memoryManager = &memoryManager;
MockGraphicsAllocation *gfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, nullptr, true, false, false);
memObj.setSharingHandler(new MySharingHandler(&memObj));
@@ -406,7 +406,7 @@ TEST(MemObj, givenSharedMemObjectAndNullGfxAllocationProvidedWhenSettingGfxAlloc
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
context.memoryManager = &memoryManager;
MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, graphicsAllocation, true, false, false);
memObj.setSharingHandler(new MySharingHandler(&memObj));
@@ -423,7 +423,7 @@ TEST(MemObj, givenSharedMemObjectAndZeroReuseCountWhenChangingGfxAllocationThenO
context.memoryManager = &memoryManager;
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, oldGfxAllocation, true, false, false);
memObj.setSharingHandler(new MySharingHandler(&memObj));
@@ -442,7 +442,7 @@ TEST(MemObj, givenSharedMemObjectAndNonZeroReuseCountWhenChangingGfxAllocationTh
context.memoryManager = &memoryManager;
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, oldGfxAllocation, true, false, false);
memObj.setSharingHandler(new MySharingHandler(&memObj));
@@ -461,7 +461,7 @@ TEST(MemObj, givenNotSharedMemObjectWhenChangingGfxAllocationThenOldAllocationIs
context.memoryManager = &memoryManager;
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, oldGfxAllocation, true, false, false);
@@ -479,7 +479,7 @@ TEST(MemObj, givenGraphicsAllocationWhenCallingIsAllocDumpableThenItReturnsTheCo
TEST(MemObj, givenMemObjNotUsingHostPtrWhenGettingBasePtrTwiceReturnSameMapPtr) {
MockContext context;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
1, nullptr, nullptr, nullptr, true, false, false);

View File

@@ -71,12 +71,12 @@ class Nv12ImageTest : public testing::Test {
void validateImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, nullptr);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, nullptr);
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
return Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}
@@ -189,7 +189,7 @@ TEST_F(Nv12ImageTest, given2DImageWhenPassedToValidateImageTraitsThenValidateRet
imageDesc.mem_object = image;
imageDesc.image_depth = 0;
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0), &imageFormat, &imageDesc, nullptr);
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0), &imageFormat, &imageDesc, nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
delete image;
@@ -204,7 +204,7 @@ TEST_F(Nv12ImageTest, given1DImageWhenPassedAsParentImageThenValidateImageTraits
imageDesc.mem_object = image;
imageDesc.image_depth = 0;
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0), &imageFormat, &imageDesc, nullptr);
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0), &imageFormat, &imageDesc, nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
delete image;
@@ -216,7 +216,7 @@ TEST_F(Nv12ImageTest, givenBufferWhenPassedAsNV12ParentImageThenValidateImageTra
imageDesc.mem_object = &Buffer;
imageDesc.image_depth = 0; // Plane of NV12 image
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0), &imageFormat, &imageDesc, nullptr);
retVal = Image::validateImageTraits(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_READ_WRITE, 0, 0), &imageFormat, &imageDesc, nullptr);
EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal);
}
@@ -391,7 +391,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
auto imageNV12 = Image::create(contextWithMockCmdQ, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal);
EXPECT_EQ(imageNV12->isTiledAllocation() ? 2u : 0u, cmdQ->EnqueueWriteImageCounter);
@@ -569,7 +569,7 @@ TEST_F(Nv12ImageTest, invalidPlanarYUVImageHeight) {
pDevice->getCap<CL_DEVICE_PLANAR_YUV_MAX_HEIGHT_INTEL>(reinterpret_cast<const void *&>(maxHeight), srcSize, retSize);
imageDesc.image_height = *maxHeight + 12;
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), &imageDesc, nullptr);
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), &imageDesc, nullptr);
EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal);
}
@@ -586,17 +586,17 @@ TEST_F(Nv12ImageTest, invalidPlanarYUVImageWidth) {
pDevice->getCap<CL_DEVICE_PLANAR_YUV_MAX_WIDTH_INTEL>(reinterpret_cast<const void *&>(maxWidth), srcSize, retSize);
imageDesc.image_width = *maxWidth + 12;
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), &imageDesc, nullptr);
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), &imageDesc, nullptr);
EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal);
}
TEST_F(Nv12ImageTest, validPlanarYUVImageHeight) {
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), &imageDesc, nullptr);
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), &imageDesc, nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(Nv12ImageTest, validPlanarYUVImageWidth) {
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), &imageDesc, nullptr);
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), &imageDesc, nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
}

View File

@@ -54,7 +54,7 @@ class PackedYuvImageTest : public testing::Test,
if (retVal != CL_SUCCESS)
return;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0), surfaceFormat, &imageDesc, nullptr);
retVal = Image::validate(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0), surfaceFormat, &imageDesc, nullptr);
}
cl_int retVal = CL_SUCCESS;
@@ -72,7 +72,7 @@ TEST_P(PackedYuvImageTest, isPackedYuvImageReturnsTrue) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags,
0,
surfaceFormat,

View File

@@ -57,19 +57,19 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT
TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCalledThenUncacheableFlagIsCorrectlySet) {
cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, flagsIntel);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, flagsIntel, 0);
auto allocationFlags = MemoryPropertiesParser::getAllocationProperties(0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false);
EXPECT_TRUE(allocationFlags.flags.uncacheable);
flagsIntel = 0;
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, flagsIntel);
memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, flagsIntel, 0);
auto allocationFlags2 = MemoryPropertiesParser::getAllocationProperties(0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false);
EXPECT_FALSE(allocationFlags2.flags.uncacheable);
}
TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalledThenFlushL3FlagsAreCorrectlySet) {
cl_mem_flags flags = CL_MEM_READ_ONLY;
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0);
MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0);
auto allocationFlags =
MemoryPropertiesParser::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false);

View File

@@ -35,10 +35,10 @@ class MockBuffer : public MockBufferStorage, public Buffer {
using MockBufferStorage::device;
MockBuffer(GraphicsAllocation &alloc)
: MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, alloc.getUnderlyingBufferSize(), alloc.getUnderlyingBuffer(), alloc.getUnderlyingBuffer(), &alloc, true, false, false),
: MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, alloc.getUnderlyingBufferSize(), alloc.getUnderlyingBuffer(), alloc.getUnderlyingBuffer(), &alloc, true, false, false),
externalAlloc(&alloc) {
}
MockBuffer() : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, &mockGfxAllocation, true, false, false) {
MockBuffer() : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, &mockGfxAllocation, true, false, false) {
}
~MockBuffer() override {
if (externalAlloc != nullptr) {
@@ -56,9 +56,9 @@ class MockBuffer : public MockBufferStorage, public Buffer {
class AlignedBuffer : public MockBufferStorage, public Buffer {
public:
using MockBufferStorage::device;
AlignedBuffer() : MockBufferStorage(false), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), &mockGfxAllocation, true, false, false) {
AlignedBuffer() : MockBufferStorage(false), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), &mockGfxAllocation, true, false, false) {
}
AlignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), gfxAllocation, true, false, false) {
AlignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64), gfxAllocation, true, false, false) {
}
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnly) override {
Buffer::setSurfaceState(device.get(), memory, getSize(), getCpuAddress(), &mockGfxAllocation);
@@ -68,9 +68,9 @@ class AlignedBuffer : public MockBufferStorage, public Buffer {
class UnalignedBuffer : public MockBufferStorage, public Buffer {
public:
using MockBufferStorage::device;
UnalignedBuffer() : MockBufferStorage(true), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), &mockGfxAllocation, false, false, false) {
UnalignedBuffer() : MockBufferStorage(true), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), &mockGfxAllocation, false, false, false) {
}
UnalignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(true), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), gfxAllocation, false, false, false) {
UnalignedBuffer(GraphicsAllocation *gfxAllocation) : MockBufferStorage(true), Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4), gfxAllocation, false, false, false) {
}
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnly) override {
Buffer::setSurfaceState(device.get(), memory, getSize(), getCpuAddress(), &mockGfxAllocation);

View File

@@ -1318,7 +1318,7 @@ class DrmMockBuffer : public Buffer {
delete gfxAllocation;
}
DrmMockBuffer(char *data, size_t size, DrmAllocation *alloc) : Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0, size, data, data, alloc, true, false, false),
DrmMockBuffer(char *data, size_t size, DrmAllocation *alloc) : Buffer(nullptr, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0, size, data, data, alloc, true, false, false),
data(data),
gfxAllocation(alloc) {
}

View File

@@ -1161,7 +1161,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1209,7 +1209,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1250,7 +1250,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
if (MemoryManagement::nonfailingAllocation == failureIndex) {
EXPECT_NE(nullptr, dstImage.get());
@@ -1293,7 +1293,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1339,7 +1339,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1372,7 +1372,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1417,7 +1417,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -1462,7 +1462,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation();
ASSERT_NE(nullptr, imageGraphicsAllocation);

View File

@@ -600,7 +600,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -629,7 +629,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -664,7 +664,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -693,7 +693,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);
@@ -721,7 +721,7 @@ 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, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0),
std::unique_ptr<Image> dstImage(Image::create(&context, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, dstImage);

View File

@@ -37,7 +37,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireIncrementCounterThenReleaseShouldDecr
char buffer[64];
MockContext context;
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
std::unique_ptr<MemObj> memObj(new MemObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0,
std::unique_ptr<MemObj> memObj(new MemObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0,
sizeof(buffer), buffer, buffer, mockAllocation, true, false, false));
struct MockSharingHandler : SharingHandler {
@@ -62,7 +62,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireTwoTimesThenReleaseShouldBeCalledTwoT
char buffer[64];
MockContext context;
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
std::unique_ptr<MemObj> memObj(new MemObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0,
std::unique_ptr<MemObj> memObj(new MemObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0,
sizeof(buffer), buffer, buffer, mockAllocation, true, false, false));
struct MockSharingHandler : SharingHandler {
@@ -107,7 +107,7 @@ TEST(sharingHandler, givenSharingHandlerWhenAcquiringThenReturnErrorCode) {
SharingHandler sharingHandler;
MockContext context;
MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0);
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0), CL_MEM_USE_HOST_PTR, 0,
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(CL_MEM_USE_HOST_PTR, 0, 0), CL_MEM_USE_HOST_PTR, 0,
1, nullptr, nullptr, graphicsAllocation, true, false, false);
auto result = sharingHandler.acquire(&memObj);