mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
Move core part of MemoryPropertiesHelpers to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
afa45bd9e7
commit
48f01f28f5
@@ -87,7 +87,7 @@ HWTEST_P(AUBCopyImage, WhenCopyingThenExpectationsMet) {
|
||||
auto retVal = CL_INVALID_VALUE;
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -98,7 +98,7 @@ HWTEST_P(AUBCopyImage, WhenCopyingThenExpectationsMet) {
|
||||
|
||||
dstImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -185,7 +185,7 @@ HWTEST_P(AubFillImage, WhenFillingThenExpectationsMet) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
image.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -987,7 +987,7 @@ HWTEST2_F(AUBBindlessKernel, DISABLED_givenBindlessCopyImageKernelWhenEnqueuedTh
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, device->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
contextCl,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &contextCl->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &contextCl->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -127,7 +127,7 @@ HWTEST_P(AUBMapImage, WhenMappingAndUnmappingThenExpectationsAreMet) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -124,7 +124,7 @@ HWTEST_F(AUBReadBuffer, GivenReserveCanonicalGpuAddressWhenReadingBufferThenExpe
|
||||
MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
|
||||
std::unique_ptr<Buffer> srcBuffer(Buffer::createBufferHw(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_USE_HOST_PTR,
|
||||
0,
|
||||
sizeof(srcMemory),
|
||||
|
||||
@@ -145,7 +145,7 @@ HWTEST_P(AUBReadImage, GivenUnalignedMemoryWhenReadingImageThenExpectationsAreMe
|
||||
auto retVal = CL_INVALID_VALUE;
|
||||
srcImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -83,7 +83,7 @@ struct AUBImageUnaligned
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -178,7 +178,7 @@ struct AUBImageUnaligned
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -74,7 +74,7 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces
|
||||
auto retVal = CL_INVALID_VALUE;
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -139,7 +139,7 @@ HWTEST_P(AUBWriteImage, GivenUnalignedMemoryWhenWritingImageThenExpectationsAreM
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
dstImage.reset(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -56,7 +56,7 @@ GEN11TEST_F(GEN11AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectatio
|
||||
desc.image_slice_pitch = 0;
|
||||
// clang-format on
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
Image *image = Image::create(
|
||||
pContext,
|
||||
|
||||
@@ -56,7 +56,7 @@ GEN8TEST_F(GEN8AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectations
|
||||
desc.image_row_pitch = 0;
|
||||
desc.image_slice_pitch = 0;
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
pContext,
|
||||
|
||||
@@ -54,7 +54,7 @@ GEN9TEST_F(AUBParentKernelFixture, WhenEnqueuingParentKernelThenExpectationsMet)
|
||||
desc.image_slice_pitch = 0;
|
||||
// clang-format on
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
Image *image = Image::create(
|
||||
pContext,
|
||||
|
||||
@@ -323,7 +323,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, GivenDeviceSideVmeThenExpectationsMet) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto srcImage = Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -334,7 +334,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, GivenDeviceSideVmeThenExpectationsMet) {
|
||||
|
||||
auto refImage = Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -102,7 +102,7 @@ HWTEST_F(AUBCreateImageArray, Given1DImageArrayThenExpectationsMet) {
|
||||
|
||||
image.reset(Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -180,7 +180,7 @@ HWTEST_F(AUBCreateImageArray, Given2DImageArrayThenExpectationsMet) {
|
||||
|
||||
image.reset(Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -305,7 +305,7 @@ HWTEST_P(CopyHostPtrTest, GivenImageWithDoubledRowPitchWhenCreatedWithCopyHostPt
|
||||
data += passedRowPitch;
|
||||
}
|
||||
|
||||
image.reset(Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
image.reset(Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, pHostPtr, retVal));
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(image->getImageDesc().image_row_pitch, imgInfo.rowPitch);
|
||||
@@ -375,7 +375,7 @@ HWTEST_P(UseHostPtrTest, GivenImageWithRowPitchWhenCreatedWithUseHostPtrFlagThen
|
||||
}
|
||||
image.reset(Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -472,7 +472,7 @@ HWTEST_F(AUBCreateImage, GivenImage3DCreatedWithDoubledSlicePitchWhenQueriedForD
|
||||
}
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
image.reset(Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
image.reset(Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, host_ptr, retVal));
|
||||
|
||||
depthToCopy = imageDesc.image_depth;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
|
||||
#include "opencl/source/event/user_event.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/test/unit_test/command_queue/command_enqueue_fixture.h"
|
||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -930,7 +930,7 @@ TEST_F(EnqueueMapImageTest, givenImage1DArrayWhenEnqueueMapImageIsCalledThenRetu
|
||||
public:
|
||||
MockImage(Context *context, cl_mem_flags flags, GraphicsAllocation *allocation, const ClSurfaceFormatInfo &surfaceFormat,
|
||||
const cl_image_format &imageFormat, const cl_image_desc &imageDesc)
|
||||
: Image(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0,
|
||||
: Image(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), flags, 0,
|
||||
0, nullptr, nullptr,
|
||||
imageFormat, imageDesc,
|
||||
true,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
@@ -232,7 +232,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyBufferToImageThenKernelHasOwner
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, dstImage.get());
|
||||
|
||||
@@ -259,11 +259,11 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageThenKernelHasOwnership) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> srcImage(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
|
||||
@@ -292,7 +292,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageToBufferThenKernelHasOwner
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> srcImage(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, srcImage.get());
|
||||
|
||||
@@ -334,7 +334,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingFillImageThenKernelHasOwnership) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> image(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
@@ -383,7 +383,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingReadImageThenKernelHasOwnership) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
@@ -436,7 +436,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingWriteImageThenKernelHasOwnership) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> image(
|
||||
Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image.get());
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ struct MultipleMapImageTest : public ClDeviceFixture, public ::testing::Test {
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto img = Image::create(
|
||||
context, MemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
context, ClMemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal);
|
||||
auto mockImage = static_cast<MockImage<FamilyType> *>(img);
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
|
||||
|
||||
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(aubCsr->getRootDeviceIndex(), imgInfo, true, memoryProperties, *hwInfo, osContext.getDeviceBitfield(), true);
|
||||
|
||||
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_helper_tests.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_gmm.h"
|
||||
|
||||
@@ -664,7 +664,7 @@ TEST_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenProperPe
|
||||
auto context = std::unique_ptr<MockContext>(Context::create<NEO::MockContext>(validProperties, ClDeviceVector(&deviceId, 1), callbackFunction, static_cast<void *>(userData), retVal));
|
||||
context->isSharedContext = false;
|
||||
auto buffer = std::unique_ptr<Buffer>(
|
||||
Buffer::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Buffer::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
0, 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).isBufferSizeSuitableForRenderCompression(size, hwInfo) &&
|
||||
@@ -684,7 +684,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
||||
cl_device_id deviceId = device.get();
|
||||
MemoryProperties memoryProperties =
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
|
||||
size_t size = 0u;
|
||||
|
||||
@@ -756,7 +756,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -815,7 +815,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -876,7 +876,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
context.get(),
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -87,7 +87,7 @@ struct ImageHelper {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
NEO::MemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
NEO::ClMemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Traits::flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -40,7 +40,7 @@ struct AppendSurfaceStateParamsTest : public ::testing::Test {
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
EXPECT_NE(nullptr, surfaceFormat);
|
||||
image.reset(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ class MockBuffer : public MockBufferStorage, public Buffer {
|
||||
|
||||
public:
|
||||
MockBuffer() : MockBufferStorage(),
|
||||
Buffer(nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
Buffer(nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data, GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) {
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -24,61 +24,61 @@ TEST(MemoryProperties, givenValidPropertiesWhenCreateMemoryPropertiesThenTrueIsR
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
MemoryProperties properties;
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.readWrite);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_WRITE_ONLY, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_WRITE_ONLY, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.writeOnly);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_ONLY, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_ONLY, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.readOnly);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.useHostPtr);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_ALLOC_HOST_PTR, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_ALLOC_HOST_PTR, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.allocHostPtr);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.copyHostPtr);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_WRITE_ONLY, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_WRITE_ONLY, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.hostWriteOnly);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_READ_ONLY, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_READ_ONLY, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.hostReadOnly);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_NO_ACCESS, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_HOST_NO_ACCESS, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.hostNoAccess);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_KERNEL_READ_AND_WRITE, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_KERNEL_READ_AND_WRITE, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.kernelReadAndWrite);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.accessFlagsUnrestricted);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_NO_ACCESS_INTEL, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_NO_ACCESS_INTEL, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.noAccess);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_RESOURCE, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.locallyUncachedResource);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.locallyUncachedInSurfaceState);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_FORCE_HOST_MEMORY_INTEL, 0, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_FORCE_HOST_MEMORY_INTEL, 0, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.forceHostMemory);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_WRITE_COMBINED_INTEL, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_WRITE_COMBINED_INTEL, pDevice);
|
||||
EXPECT_TRUE(properties.allocFlags.allocWriteCombined);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL, pDevice);
|
||||
EXPECT_TRUE(properties.allocFlags.usmInitialPlacementGpu);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL, pDevice);
|
||||
EXPECT_TRUE(properties.allocFlags.usmInitialPlacementCpu);
|
||||
|
||||
properties = MemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_48BIT_RESOURCE_INTEL, 0, pDevice);
|
||||
properties = ClMemoryPropertiesHelper::createMemoryProperties(0, CL_MEM_48BIT_RESOURCE_INTEL, 0, pDevice);
|
||||
EXPECT_TRUE(properties.flags.resource48Bit);
|
||||
}
|
||||
|
||||
@@ -91,22 +91,22 @@ TEST(MemoryProperties, givenClMemForceLinearStorageFlagWhenCreateMemoryPropertie
|
||||
|
||||
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_FALSE(memoryProperties.flags.forceLinearStorage);
|
||||
}
|
||||
|
||||
@@ -119,22 +119,22 @@ TEST(MemoryProperties, givenClAllowUnrestrictedSizeFlagWhenCreateMemoryPropertie
|
||||
|
||||
flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
|
||||
|
||||
flags |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
|
||||
flagsIntel |= CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.allowUnrestrictedSize);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_FALSE(memoryProperties.flags.allowUnrestrictedSize);
|
||||
}
|
||||
|
||||
@@ -147,19 +147,19 @@ struct MemoryPropertiesHelperTests : ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenNullPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) {
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(nullptr, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenEmptyPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) {
|
||||
cl_mem_properties_intel properties[] = {0};
|
||||
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesThenTrueIsReturned) {
|
||||
@@ -173,8 +173,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert
|
||||
CL_MEM_ALLOC_WRITE_COMBINED_INTEL, CL_MEM_ALLOC_DEFAULT_INTEL,
|
||||
0};
|
||||
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesForBufferThenTrueIsReturned) {
|
||||
@@ -185,8 +185,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert
|
||||
MemObjHelper::validFlagsForBufferIntel,
|
||||
0};
|
||||
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropertiesForImageThenTrueIsReturned) {
|
||||
@@ -197,8 +197,8 @@ TEST_F(MemoryPropertiesHelperTests, givenValidPropertiesWhenParsingMemoryPropert
|
||||
MemObjHelper::validFlagsForImageIntel,
|
||||
0};
|
||||
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesThenFalseIsReturned) {
|
||||
@@ -206,12 +206,12 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope
|
||||
(1 << 30), CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR,
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
|
||||
@@ -222,8 +222,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope
|
||||
MemObjHelper::validFlagsForBufferIntel,
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
|
||||
@@ -234,8 +234,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryProperties
|
||||
MemObjHelper::validFlagsForImageIntel,
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForImageThenFalseIsReturned) {
|
||||
@@ -246,8 +246,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope
|
||||
(1 << 30),
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::IMAGE, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
|
||||
@@ -258,8 +258,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidPropertiesWhenParsingMemoryPrope
|
||||
MemObjHelper::validFlagsForImageIntel,
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
|
||||
@@ -270,8 +270,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsWhenParsingMemoryProperties
|
||||
MemObjHelper::validFlagsForBufferIntel,
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPropertiesForBufferThenFalseIsReturned) {
|
||||
@@ -282,8 +282,8 @@ TEST_F(MemoryPropertiesHelperTests, givenInvalidFlagsIntelWhenParsingMemoryPrope
|
||||
(1 << 30),
|
||||
0};
|
||||
|
||||
EXPECT_FALSE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
EXPECT_FALSE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::BUFFER, context));
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) {
|
||||
@@ -330,20 +330,20 @@ TEST_F(MemoryPropertiesHelperTests, givenMemFlagsWithFlagsAndPropertiesWhenParsi
|
||||
cl_mem_properties_intel properties[] = {
|
||||
CL_MEM_FLAGS, testInput.flagsProperties,
|
||||
0};
|
||||
EXPECT_TRUE(MemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_TRUE(ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
|
||||
MemoryPropertiesHelper::ObjType::UNKNOWN, context));
|
||||
EXPECT_EQ(testInput.expectedResult, flags);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MemoryPropertiesHelperTests, WhenAdjustingDeviceBitfieldThenCorrectBitfieldIsReturned) {
|
||||
UltClDeviceFactory deviceFactory{2, 4};
|
||||
auto memoryPropertiesRootDevice0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[0]->getDevice());
|
||||
auto memoryPropertiesRootDevice0Tile0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[0]->getDevice());
|
||||
auto memoryPropertiesRootDevice0Tile1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[1]->getDevice());
|
||||
auto memoryPropertiesRootDevice1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[1]->getDevice());
|
||||
auto memoryPropertiesRootDevice1Tile0 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[4]->getDevice());
|
||||
auto memoryPropertiesRootDevice1Tile1 = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[5]->getDevice());
|
||||
auto memoryPropertiesRootDevice0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[0]->getDevice());
|
||||
auto memoryPropertiesRootDevice0Tile0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[0]->getDevice());
|
||||
auto memoryPropertiesRootDevice0Tile1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[1]->getDevice());
|
||||
auto memoryPropertiesRootDevice1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.rootDevices[1]->getDevice());
|
||||
auto memoryPropertiesRootDevice1Tile0 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[4]->getDevice());
|
||||
auto memoryPropertiesRootDevice1Tile1 = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &deviceFactory.subDevices[5]->getDevice());
|
||||
|
||||
DeviceBitfield devicesInContextBitfield0001{0b1};
|
||||
DeviceBitfield devicesInContextBitfield0101{0b101};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
#include "opencl/test/unit_test/fixtures/kernel_arg_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_allocation_properties.h"
|
||||
@@ -99,7 +99,7 @@ TEST_F(KernelImageArgTest, givenImageWithNumSamplesWhenSetArgIsCalledThenPatchNu
|
||||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto sampleImg = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -125,7 +125,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndReadOnlyArgWhenCheckC
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->setAccessQualifier(0, KernelArgMetadata::AccessReadOnly);
|
||||
cl_mem memObj = img.get();
|
||||
@@ -175,7 +175,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndWriteOnlyArgWhenCheckC
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessWriteOnly);
|
||||
cl_mem memObj = img.get();
|
||||
@@ -198,7 +198,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndReadOnlyArgWhenCheckCo
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessReadOnly);
|
||||
cl_mem memObj = img.get();
|
||||
@@ -217,7 +217,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndWriteOnlyArgWhenCheck
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
pKernelInfo->setAccessQualifier(0, NEO::KernelArgMetadata::AccessWriteOnly);
|
||||
cl_mem memObj = img.get();
|
||||
@@ -234,7 +234,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo
|
||||
imgDesc.image_width = 5;
|
||||
imgDesc.image_height = 5;
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto img = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -266,7 +266,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSettedArgWhenUnSetCalledThenArgIsUnset
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
cl_mem memObj = img.get();
|
||||
|
||||
@@ -306,7 +306,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSharedImageWhenSetArgCalledThenUsingSh
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> img(
|
||||
Image::create(context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
|
||||
cl_mem memObj = img.get();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -2125,7 +2125,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor
|
||||
cl_int retVal;
|
||||
MockContext context;
|
||||
std::unique_ptr<NEO::Image> imageNV12(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(imageNV12->getMediaPlaneType(), 0u);
|
||||
|
||||
@@ -2141,7 +2141,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor
|
||||
imageDesc.mem_object = imageNV12.get();
|
||||
|
||||
std::unique_ptr<NEO::Image> imageY(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(imageY->getMediaPlaneType(), 0u);
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ TEST(Buffer, givenReadOnlySetOfInputFlagsWhenPassedToisReadOnlyMemoryPermittedBy
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
cl_mem_flags flags = CL_MEM_HOST_NO_ACCESS | CL_MEM_READ_ONLY;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
|
||||
|
||||
flags = CL_MEM_HOST_READ_ONLY | CL_MEM_READ_ONLY;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
EXPECT_TRUE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ TEST_P(BufferReadOnlyTest, givenNonReadOnlySetOfInputFlagsWhenPassedToisReadOnly
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
cl_mem_flags flags = GetParam() | CL_MEM_USE_HOST_PTR;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
EXPECT_FALSE(MockBuffer::isReadOnlyMemoryPermittedByFlags(memoryProperties));
|
||||
}
|
||||
static cl_mem_flags nonReadOnlyFlags[] = {
|
||||
@@ -423,7 +423,7 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrRende
|
||||
|
||||
TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true);
|
||||
@@ -432,7 +432,7 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB
|
||||
|
||||
TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true);
|
||||
@@ -441,7 +441,7 @@ TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocatio
|
||||
|
||||
TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = true;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true);
|
||||
@@ -450,7 +450,7 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy
|
||||
|
||||
TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = true;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true);
|
||||
@@ -460,7 +460,7 @@ TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTy
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true);
|
||||
@@ -470,7 +470,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, true, true);
|
||||
@@ -480,7 +480,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried
|
||||
TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true);
|
||||
@@ -490,7 +490,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true);
|
||||
@@ -500,7 +500,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffers
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, true, true);
|
||||
@@ -510,7 +510,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE
|
||||
TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemoryIsEnabledThenBufferHostMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_FORCE_HOST_MEMORY_INTEL;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, true, true);
|
||||
@@ -520,7 +520,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory
|
||||
TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, true, false, true);
|
||||
@@ -529,7 +529,7 @@ TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocatio
|
||||
|
||||
TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(memoryProperties, context, false, false, true);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -448,7 +448,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterBufferTests, givenBufferAllocationWitho
|
||||
cl_float srcMemory[] = {1.0f, 2.0f, 3.0f, 4.0f};
|
||||
std::unique_ptr<Buffer> buffer(Buffer::createBufferHw(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
0,
|
||||
0,
|
||||
sizeof(srcMemory),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -64,7 +64,7 @@ typedef CreateImageFormatTest<CL_MEM_READ_WRITE> ReadWriteFormatTest;
|
||||
TEST_P(ReadWriteFormatTest, GivenValidFormatWhenCreatingImageThenImageIsCreated) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -89,7 +89,7 @@ typedef CreateImageFormatTest<CL_MEM_READ_ONLY> ReadOnlyFormatTest;
|
||||
TEST_P(ReadOnlyFormatTest, GivenValidReadOnlyFormatWhenCreatingImageThenImageIsCreated) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -112,7 +112,7 @@ typedef CreateImageFormatTest<CL_MEM_WRITE_ONLY> WriteOnlyFormatTest;
|
||||
TEST_P(WriteOnlyFormatTest, GivenValidWriteOnlyFormatWhenCreatingImageThenImageIsCreated) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
@@ -75,7 +75,7 @@ TEST_F(ImageInLocalMemoryTest, givenImageWithoutHostPtrWhenLocalMemoryIsEnabledT
|
||||
.WillRepeatedly(::testing::Invoke(gmockMemoryManager, &GMockMemoryManagerFailFirstAllocation::baseAllocateGraphicsMemoryInDevicePool));
|
||||
|
||||
std::unique_ptr<Image> image(Image::create(
|
||||
context.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, memory, retVal));
|
||||
|
||||
ASSERT_NE(nullptr, image);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -75,7 +75,7 @@ HWTEST_P(CreateImage1DType, GivenValidTypeWhenCreatingImageThenImageParamsAreCor
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device_info_map.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/platform/extensions.h"
|
||||
@@ -61,7 +61,7 @@ class Image2dFromBufferTest : public ::testing::Test {
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
@@ -94,7 +94,7 @@ TEST_F(Image2dFromBufferTest, givenBufferWhenCreateImage2dArrayFromBufferThenIma
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidRowPitchWhenCreateImage2dFromBufferThe
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, ptr);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ TEST_F(Image2dFromBufferTest, GivenInvalidHostPtrAlignmentWhenCreatingImageThenI
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
|
||||
@@ -157,7 +157,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidFlagsWhenValidateIsCalledThenReturnErr
|
||||
for (auto flag : flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flag, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flag, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flag, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, reinterpret_cast<void *>(0x12345));
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel8BitColorsNoRowPitchSpecifiedAndToo
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel16BitColorsNoRowPitchSpecifiedAndTo
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsNoRowPitchSpecifiedAndTo
|
||||
|
||||
const auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel16BitColorsNoRowPitchSpecifiedAndT
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
@@ -245,7 +245,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpeci
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, NULL);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -57,7 +57,7 @@ class CreateImage2DTest : public ClDeviceFixture,
|
||||
Image *createImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -62,7 +62,7 @@ HWTEST_F(CreateImage3DTest, WhenCreatingImageThenPropertiesAreSetCorrectly) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
auto image = Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -93,7 +93,7 @@ HWTEST_F(CreateImage3DTest, GivenTiledOrForcedLinearWhenCreatingImageThenPropert
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat);
|
||||
MockGmm::queryImgParams(context->getDevice(0)->getGmmClientContext(), imgInfo);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice());
|
||||
|
||||
auto image = Image::create(
|
||||
context,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -75,7 +75,7 @@ HWTEST_P(CreateImageArraySize, GivenArrayTypeWhenCreatingImageThenImageCreatedWi
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -116,7 +116,7 @@ HWTEST_P(CreateImageNonArraySize, GivenNonArrayTypeWhenCreatingImageThenImageCre
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -63,7 +63,7 @@ class ImageFromSubBufferTest : public ClDeviceFixture, public ::testing::Test {
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
|
||||
}
|
||||
cl_image_format imageFormat;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -54,7 +54,7 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
image.reset(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -196,7 +196,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto bigImage = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -52,7 +52,7 @@ class CreateImageTest : public ClDeviceFixture,
|
||||
Image *createImageWithFlags(cl_mem_flags flags, Context *context) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithZeroRowPitchAndZeroSlicePitchWhenGett
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -180,7 +180,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -231,7 +231,7 @@ TEST(TestSliceAndRowPitch, Given2dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -282,7 +282,7 @@ TEST(TestSliceAndRowPitch, Given1dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -333,7 +333,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -384,7 +384,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithZeroRowPitchAndNonZeroSlicePitchWhenG
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -435,7 +435,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchWh
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -486,7 +486,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchGr
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -537,7 +537,7 @@ TEST(TestCreateImage, GivenSharedContextWhenImageIsCreatedThenRowAndSliceAreCorr
|
||||
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -599,7 +599,7 @@ TEST(TestCreateImageUseHostPtr, GivenDifferenHostPtrAlignmentsWhenCheckingMemory
|
||||
for (int i = 0; i < 4; i++) {
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -639,7 +639,7 @@ TEST(TestCreateImageUseHostPtr, givenZeroCopyImageValuesWhenUsingHostPtrThenZero
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -751,7 +751,7 @@ struct CreateImageHostPtr
|
||||
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(
|
||||
context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -1171,7 +1171,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
mockContext.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::tiledImagesSupported, image->isTiledAllocation());
|
||||
@@ -1186,7 +1186,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
mockContext.get(), MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_FALSE(image->isTiledAllocation());
|
||||
@@ -1419,7 +1419,7 @@ TEST(ImageTest, givenClMemForceLinearStorageSetWhenCreateImageThenDisallowTiling
|
||||
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
@@ -1467,7 +1467,7 @@ TEST(ImageTest, givenClMemCopyHostPointerPassedToImageCreateWhenAllocationIsNotI
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
|
||||
std::unique_ptr<Image> image(
|
||||
Image::create(&ctx, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&ctx, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, memory, retVal));
|
||||
EXPECT_NE(nullptr, image);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -91,7 +91,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -125,7 +125,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenDebugFlagForMultiTileS
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -171,7 +171,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeUnrestricti
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -204,7 +204,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeDefaultWhen
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -239,7 +239,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenContextTypeSpecialized
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -292,7 +292,7 @@ HWCMDTEST_P(IGFX_XE_HP_CORE, MultiGpuGlobalAtomicsImageTest, givenAppendSurfaceS
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
memFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
memFlags, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
@@ -392,7 +392,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenCompressionWhenAppendi
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
auto surfaceState = FamilyType::cmdInitRenderSurfaceState;
|
||||
@@ -432,7 +432,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterImageTests, givenImageFromBufferWhenSet
|
||||
buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = std::unique_ptr<Image>(Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
|
||||
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ HWTEST_P(CreateTiledImageTest, GivenImageTypeWhenCheckingIsTiledThenTrueReturned
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
|
||||
#include "opencl/source/api/api.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/libult/ult_command_stream_receiver.h"
|
||||
@@ -46,7 +46,7 @@ class MemObjDestructionTest : public ::testing::TestWithParam<bool> {
|
||||
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), size});
|
||||
memObj = new MemObj(context.get(), CL_MEM_OBJECT_BUFFER,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &device->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &device->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, size,
|
||||
nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false);
|
||||
csr = device->getDefaultEngine().commandStreamReceiver;
|
||||
@@ -227,7 +227,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,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
CL_MEM_READ_WRITE, 0, size,
|
||||
storage, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false);
|
||||
memObj->addMappedPtr(storage, 1, mapFlags, region, origin, 0);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/fixtures/image_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -39,22 +39,22 @@ TEST(MemObjHelper, givenClMemForceLinearStorageFlagWhenCheckForLinearStorageForc
|
||||
|
||||
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
flagsIntel |= CL_MEM_FORCE_LINEAR_STORAGE_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_TRUE(memoryProperties.flags.forceLinearStorage);
|
||||
|
||||
flags = 0;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
EXPECT_FALSE(memoryProperties.flags.forceLinearStorage);
|
||||
}
|
||||
|
||||
@@ -63,61 +63,61 @@ TEST(MemObjHelper, givenValidPropertiesWhenValidatingMemoryPropertiesThenTrueIsR
|
||||
cl_mem_flags_intel flagsIntel = 0;
|
||||
UltClDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = &deviceFactory.rootDevices[0]->getDevice();
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
MockContext context{deviceFactory.rootDevices[0]};
|
||||
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_NO_ACCESS_INTEL;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = CL_MEM_NO_ACCESS_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = CL_MEM_NO_ACCESS_INTEL;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR | CL_MEM_HOST_WRITE_ONLY;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = 0;
|
||||
flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = 0;
|
||||
flagsIntel = CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, flagsIntel, nullptr, context));
|
||||
|
||||
flags = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = 0;
|
||||
flagsIntel = 0;
|
||||
EXPECT_TRUE(MemObjHelper::validateMemoryPropertiesForBuffer(memoryProperties, flags, flagsIntel, context));
|
||||
@@ -133,7 +133,7 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
cl_mem_flags_intel flagsIntel = 0;
|
||||
UltClDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = &deviceFactory.rootDevices[0]->getDevice();
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
|
||||
MockContext context{deviceFactory.rootDevices[0]};
|
||||
auto image = clUniquePtr(Image1dHelper<>::create(&context));
|
||||
@@ -143,13 +143,13 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
|
||||
for (auto hostPtrFlag : hostPtrFlags) {
|
||||
flags = hostPtrFlag;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags = hostPtrFlag;
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get(), context));
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context));
|
||||
|
||||
flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, pDevice);
|
||||
flags |= CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL;
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, image.get(), context));
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context));
|
||||
@@ -159,6 +159,6 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
TEST(MemObjHelper, givenContextWithMultipleRootDevicesWhenIsSuitableForRenderCompressionIsCalledThenFalseIsReturned) {
|
||||
MockDefaultContext context;
|
||||
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice());
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/properties_helper.h"
|
||||
#include "opencl/source/mem_obj/mem_obj.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
@@ -67,7 +67,7 @@ TEST(MemObj, GivenMemObjWhenInititalizedFromHostPtrThenInitializeFields) {
|
||||
char buffer[size];
|
||||
MockContext context;
|
||||
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false);
|
||||
|
||||
@@ -83,7 +83,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferToHostPtrThenDoNothing) {
|
||||
uint8_t expectedHostPtr[size] = {};
|
||||
MockContext context;
|
||||
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr));
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
size, hostPtr, hostPtr, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false);
|
||||
|
||||
@@ -103,7 +103,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) {
|
||||
uint8_t expectedBufferPtr[size] = {};
|
||||
MockContext context;
|
||||
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(hostPtr, sizeof(hostPtr));
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_PIPE, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
size, hostPtr, hostPtr, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false);
|
||||
|
||||
@@ -120,7 +120,7 @@ TEST(MemObj, givenMemObjectWhenAskedForTransferFromHostPtrThenDoNothing) {
|
||||
TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostPtr) {
|
||||
uint8_t hostPtr = 0;
|
||||
MockContext context;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, &hostPtr, 0, true, false, false);
|
||||
|
||||
@@ -130,7 +130,7 @@ TEST(MemObj, givenHostPtrAndUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnHostP
|
||||
TEST(MemObj, givenHostPtrWithoutUseHostPtrFlagWhenAskingForBaseMapPtrThenReturnAllocatedPtr) {
|
||||
uint8_t hostPtr = 0;
|
||||
MockContext context;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
1, nullptr, &hostPtr, 0, true, false, false);
|
||||
|
||||
@@ -142,7 +142,7 @@ TEST(MemObj, givenMemObjWhenReleaseAllocatedPtrIsCalledTwiceThenItDoesntCrash) {
|
||||
void *allocatedPtr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize);
|
||||
|
||||
MockContext context;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -162,7 +162,7 @@ TEST(MemObj, givenNotReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThe
|
||||
auto defaultEngine = context.getDevice(0)->getDefaultEngine();
|
||||
allocation->updateTaskCount(2, defaultEngine.osContext->getContextId());
|
||||
*(defaultEngine.commandStreamReceiver->getTagAddress()) = 1;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
auto &allocationList = defaultEngine.commandStreamReceiver->getTemporaryAllocations();
|
||||
@@ -181,7 +181,7 @@ TEST(MemObj, givenReadyGraphicsAllocationWhenMemObjDestroysAllocationAsyncThenAl
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
allocation->updateTaskCount(1, device->getDefaultEngine().osContext->getContextId());
|
||||
*device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 1;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -199,7 +199,7 @@ TEST(MemObj, givenNotUsedGraphicsAllocationWhenMemObjDestroysAllocationAsyncThen
|
||||
context.memoryManager = &memoryManager;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -217,7 +217,7 @@ TEST(MemObj, givenMemoryManagerWithoutDeviceWhenMemObjDestroysAllocationAsyncThe
|
||||
context.memoryManager = &memoryManager;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -233,7 +233,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageWithProperCommandWhenCheckIfMemTra
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
|
||||
context.memoryManager = &memoryManager;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
void *ptr = memObj.getCpuAddressForMemoryTransfer();
|
||||
@@ -261,7 +261,7 @@ TEST(MemObj, givenMemObjAndPointerToObjStorageBadCommandWhenCheckIfMemTransferRe
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
|
||||
context.memoryManager = &memoryManager;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
void *ptr = memObj.getCpuAddressForMemoryTransfer();
|
||||
@@ -274,7 +274,7 @@ TEST(MemObj, givenMemObjAndPointerToDiffrentStorageAndProperCommandWhenCheckIfMe
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
|
||||
context.memoryManager = &memoryManager;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
void *ptr = (void *)0x1234;
|
||||
@@ -286,7 +286,7 @@ TEST(MemObj, givenSharingHandlerWhenAskedForCpuMappingThenReturnFalse) {
|
||||
MockContext context;
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false);
|
||||
memObj.setSharingHandler(new SharingHandler());
|
||||
@@ -299,7 +299,7 @@ TEST(MemObj, givenTiledObjectWhenAskedForCpuMappingThenReturnFalse) {
|
||||
bool isTiledAllocation() const override { return true; }
|
||||
};
|
||||
MockContext context;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MyMemObj memObj(nullptr, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
MemoryConstants::pageSize, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -314,7 +314,7 @@ TEST(MemObj, givenRenderCompressedGmmWhenAskingForMappingOnCpuThenDisallow) {
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
allocation->setDefaultGmm(new Gmm(context.getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false));
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), false, false, false);
|
||||
|
||||
@@ -331,7 +331,7 @@ TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) {
|
||||
context.memoryManager = &memoryManager;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0,
|
||||
64, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false);
|
||||
|
||||
@@ -348,7 +348,7 @@ TEST(MemObj, givenNonCpuAccessibleMemoryWhenAskingForMappingOnCpuThenDisallow) {
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
allocation->setDefaultGmm(new Gmm(context.getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false));
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), false, false, false);
|
||||
|
||||
@@ -398,7 +398,7 @@ TEST(MemObj, givenSharedMemObjectWithNullGfxAllocationWhenSettingGfxAllocationTh
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
context.memoryManager = &memoryManager;
|
||||
MockGraphicsAllocation *gfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, 0, true, false, false);
|
||||
memObj.setSharingHandler(new MySharingHandler(&memObj));
|
||||
@@ -415,7 +415,7 @@ TEST(MemObj, givenSharedMemObjectAndGfxAllocationWhenGraphicsAllocationIsRemoved
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
context.memoryManager = &memoryManager;
|
||||
MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(graphicsAllocation), true, false, false);
|
||||
memObj.setSharingHandler(new MySharingHandler(&memObj));
|
||||
@@ -432,7 +432,7 @@ TEST(MemObj, givenSharedMemObjectAndZeroReuseCountWhenChangingGfxAllocationThenO
|
||||
context.memoryManager = &memoryManager;
|
||||
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false);
|
||||
memObj.setSharingHandler(new MySharingHandler(&memObj));
|
||||
@@ -451,7 +451,7 @@ TEST(MemObj, givenSharedMemObjectAndNonZeroReuseCountWhenChangingGfxAllocationTh
|
||||
context.memoryManager = &memoryManager;
|
||||
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false);
|
||||
memObj.setSharingHandler(new MySharingHandler(&memObj));
|
||||
@@ -470,7 +470,7 @@ TEST(MemObj, givenNotSharedMemObjectWhenChangingGfxAllocationThenOldAllocationIs
|
||||
context.memoryManager = &memoryManager;
|
||||
MockGraphicsAllocation *oldGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
MockGraphicsAllocation *newGfxAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_USE_HOST_PTR, 0,
|
||||
1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(oldGfxAllocation), true, false, false);
|
||||
|
||||
@@ -488,7 +488,7 @@ TEST(MemObj, givenGraphicsAllocationWhenCallingIsAllocDumpableThenItReturnsTheCo
|
||||
|
||||
TEST(MemObj, givenMemObjNotUsingHostPtrWhenGettingBasePtrTwiceThenReturnSameMapPtr) {
|
||||
MockContext context;
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice());
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, nullptr, nullptr, 0, true, false, false);
|
||||
|
||||
@@ -505,7 +505,7 @@ using MemObjMultiRootDeviceTests = MultiRootDeviceFixture;
|
||||
TEST_F(MemObjMultiRootDeviceTests, WhenMemObjMapIsCreatedThenAllocationHasCorrectRootDeviceIndex) {
|
||||
auto allocation = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device1->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false));
|
||||
@@ -528,7 +528,7 @@ TEST_F(MemObjMultiRootDeviceTests, WhenMemObjIsCreatedWithMultiGraphicsAllocatio
|
||||
multiGraphicsAllocation.addAllocation(allocation0);
|
||||
multiGraphicsAllocation.addAllocation(allocation1);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, nullptr, nullptr, multiGraphicsAllocation, true, false, false));
|
||||
@@ -549,7 +549,7 @@ TEST_F(MemObjMultiRootDeviceTests, WhenMemObjMapAreCreatedThenAllAllocationAreDe
|
||||
multiGraphicsAllocation.addAllocation(allocation0);
|
||||
multiGraphicsAllocation.addAllocation(allocation1);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(1)->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(1)->getDevice());
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, nullptr, nullptr, multiGraphicsAllocation, true, false, false));
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shared/test/common/helpers/kernel_binary_helper.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device_get_cap.inl"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
@@ -75,14 +75,14 @@ class Nv12ImageTest : public testing::Test {
|
||||
void validateImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, nullptr);
|
||||
}
|
||||
|
||||
Image *createImageWithFlags(cl_mem_flags flags) {
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
return Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ TEST_F(Nv12ImageTest, given2DImageWhenPassedToValidateImageTraitsThenValidateRet
|
||||
imageDesc.image_depth = 0;
|
||||
|
||||
retVal = Image::validateImageTraits(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&imageFormat, &imageDesc, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ TEST_F(Nv12ImageTest, given1DImageWhenPassedAsParentImageThenValidateImageTraits
|
||||
imageDesc.image_depth = 0;
|
||||
|
||||
retVal = Image::validateImageTraits(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&imageFormat, &imageDesc, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ TEST_F(Nv12ImageTest, givenBufferWhenPassedAsNV12ParentImageThenValidateImageTra
|
||||
imageDesc.image_depth = 0; // Plane of NV12 image
|
||||
|
||||
retVal = Image::validateImageTraits(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&imageFormat, &imageDesc, nullptr);
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ HWTEST_F(Nv12ImageTest, WhenCreatingParentImageThenPlanesAreWritten) {
|
||||
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, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> imageNV12{Image::create(contextWithMockCmdQ,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal)};
|
||||
|
||||
EXPECT_EQ(imageNV12->isTiledAllocation() ? 2u : 0u, cmdQ->EnqueueWriteImageCounter);
|
||||
@@ -494,7 +494,7 @@ TEST_F(Nv12ImageTest, GivenInvalidImageHeightWhenValidatingPlanarYuvThenInvalidI
|
||||
pClDevice->getCap<CL_DEVICE_PLANAR_YUV_MAX_HEIGHT_INTEL>(reinterpret_cast<const void *&>(maxHeight), srcSize, retSize);
|
||||
|
||||
imageDesc.image_height = *maxHeight + 12;
|
||||
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()),
|
||||
retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()),
|
||||
&imageDesc, nullptr);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal);
|
||||
@@ -512,20 +512,20 @@ TEST_F(Nv12ImageTest, GivenInvalidImageWidthWhenValidatingPlanarYuvThenInvalidIm
|
||||
pClDevice->getCap<CL_DEVICE_PLANAR_YUV_MAX_WIDTH_INTEL>(reinterpret_cast<const void *&>(maxWidth), srcSize, retSize);
|
||||
|
||||
imageDesc.image_width = *maxWidth + 12;
|
||||
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()),
|
||||
retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &pClDevice->getDevice()),
|
||||
&imageDesc, nullptr);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_IMAGE_SIZE, retVal);
|
||||
}
|
||||
|
||||
TEST_F(Nv12ImageTest, GivenValidImageHeightWhenValidatingPlanarYuvThenSuccessIsReturned) {
|
||||
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&imageDesc, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(Nv12ImageTest, GivenValidImageWidthWhenValidatingPlanarYuvThenSuccessIsReturned) {
|
||||
retVal = Image::validatePlanarYUV(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
retVal = Image::validatePlanarYUV(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&imageDesc, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
#include "opencl/source/helpers/validators.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
@@ -57,7 +57,7 @@ class PackedYuvImageTest : public testing::Test,
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
retVal = Image::validate(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
surfaceFormat, &imageDesc, nullptr);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ TEST_P(PackedYuvImageTest, GivenValidPackedYuvImageFormatAndDescriptorWhenCreati
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto image = Image::create(
|
||||
&context,
|
||||
MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags,
|
||||
0,
|
||||
surfaceFormat,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -58,7 +58,7 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT
|
||||
HardwareInfo hwInfo(*defaultHwInfo);
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto allocationProperties = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, true);
|
||||
EXPECT_TRUE(allocationProperties.flags.allocateMemory);
|
||||
|
||||
@@ -70,13 +70,13 @@ TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCall
|
||||
cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice);
|
||||
auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(
|
||||
0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true);
|
||||
EXPECT_TRUE(allocationFlags.flags.uncacheable);
|
||||
|
||||
flagsIntel = 0;
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, pDevice);
|
||||
auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties(
|
||||
0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, true);
|
||||
EXPECT_FALSE(allocationFlags2.flags.uncacheable);
|
||||
@@ -86,7 +86,7 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle
|
||||
cl_mem_flags flags = CL_MEM_READ_ONLY;
|
||||
UltDeviceFactory deviceFactory{1, 2};
|
||||
auto pDevice = deviceFactory.rootDevices[0];
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice);
|
||||
|
||||
auto allocationFlags =
|
||||
MemoryPropertiesHelper::getAllocationProperties(
|
||||
@@ -94,7 +94,7 @@ TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalle
|
||||
EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForRead);
|
||||
EXPECT_FALSE(allocationFlags.flags.flushL3RequiredForWrite);
|
||||
|
||||
memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
|
||||
auto allocationFlags2 = MemoryPropertiesHelper::getAllocationProperties(
|
||||
0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, pDevice->getHardwareInfo(), {}, false);
|
||||
EXPECT_TRUE(allocationFlags2.flags.flushL3RequiredForRead);
|
||||
@@ -417,7 +417,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityWhenAskedForFlagsThenL3NeedsTo
|
||||
UltClDeviceFactory deviceFactory{1, 2};
|
||||
auto pClDevice = deviceFactory.rootDevices[0];
|
||||
auto context = std::make_unique<MockContext>(pClDevice);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &pClDevice->getDevice());
|
||||
auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo, {}, context->isSingleDeviceContext());
|
||||
EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForRead);
|
||||
EXPECT_TRUE(allocationFlags.flags.flushL3RequiredForWrite);
|
||||
@@ -428,7 +428,7 @@ TEST(MemoryAllocationTest, givenMultiTileVisiblityAndUncachedWhenAskedForFlagsTh
|
||||
auto pClDevice = deviceFactory.rootDevices[0];
|
||||
auto context = std::make_unique<MockContext>(pClDevice);
|
||||
cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE;
|
||||
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, &pClDevice->getDevice());
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, flagsIntel, 0, &pClDevice->getDevice());
|
||||
HardwareInfo hwInfo(*defaultHwInfo);
|
||||
|
||||
auto allocationFlags = MemoryPropertiesHelper::getAllocationProperties(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_allocation_properties.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_gmm.h"
|
||||
@@ -1031,7 +1032,7 @@ TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyT
|
||||
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(mockRootDeviceIndex, imgInfo, true, memoryProperties, localPlatformDevice, mockDeviceBitfield, true);
|
||||
allocProperties.allocationType = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
@@ -40,14 +40,14 @@ class MockBuffer : public MockBufferStorage, public Buffer {
|
||||
using MockBufferStorage::device;
|
||||
MockBuffer(GraphicsAllocation &alloc)
|
||||
: MockBufferStorage(), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, alloc.getUnderlyingBufferSize(), alloc.getUnderlyingBuffer(), alloc.getUnderlyingBuffer(),
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(&alloc), true, false, false),
|
||||
externalAlloc(&alloc) {
|
||||
}
|
||||
MockBuffer()
|
||||
: MockBufferStorage(), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data), &data, &data,
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) {
|
||||
}
|
||||
@@ -69,13 +69,13 @@ class AlignedBuffer : public MockBufferStorage, public Buffer {
|
||||
using MockBufferStorage::device;
|
||||
|
||||
AlignedBuffer() : MockBufferStorage(false), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64),
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), true, false, false) {
|
||||
}
|
||||
AlignedBuffer(GraphicsAllocation *gfxAllocation)
|
||||
: MockBufferStorage(), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 64), alignUp(&data, 64),
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(gfxAllocation), true, false, false) {
|
||||
}
|
||||
@@ -89,13 +89,13 @@ class UnalignedBuffer : public MockBufferStorage, public Buffer {
|
||||
using MockBufferStorage::device;
|
||||
|
||||
UnalignedBuffer() : MockBufferStorage(true), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4),
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(&mockGfxAllocation), false, false, false) {
|
||||
}
|
||||
UnalignedBuffer(GraphicsAllocation *gfxAllocation)
|
||||
: MockBufferStorage(true), Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(data) / 2, alignUp(&data, 4), alignUp(&data, 4),
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(gfxAllocation), false, false, false) {
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/mock_host_ptr_manager.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/common/mocks/mock_host_ptr_manager.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
|
||||
@@ -733,7 +733,7 @@ class DrmMockBuffer : public MockBufferStorage, public Buffer {
|
||||
|
||||
DrmMockBuffer(char *data, size_t size, DrmAllocation *alloc)
|
||||
: Buffer(
|
||||
nullptr, MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
nullptr, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, MockBufferStorage::device.get()),
|
||||
CL_MEM_USE_HOST_PTR, 0, size, data, data,
|
||||
GraphicsAllocationHelper::toMultiGraphicsAllocation(alloc), true, false, false),
|
||||
data(data),
|
||||
@@ -1286,4 +1286,4 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocInMemoryOperationsInt
|
||||
|
||||
mm->freeGraphicsMemory(allocation);
|
||||
mm->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "shared/test/common/test_macros/matchers.h"
|
||||
|
||||
#include "opencl/source/event/event.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/mocks/linux/mock_drm_allocation.h"
|
||||
@@ -1590,7 +1590,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1638,7 +1638,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1679,7 +1679,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAn
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
if (MemoryManagement::nonfailingAllocation == failureIndex) {
|
||||
EXPECT_NE(nullptr, dstImage.get());
|
||||
@@ -1751,7 +1751,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1797,7 +1797,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThe
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1832,7 +1832,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZer
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1880,7 +1880,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNon
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1927,7 +1927,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreated
|
||||
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(Image::create(
|
||||
&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation(rootDeviceIndex);
|
||||
ASSERT_NE(nullptr, imageGraphicsAllocation);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
@@ -840,7 +840,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCount
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -871,7 +871,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCountNo
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -909,7 +909,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, data, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -939,7 +939,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
std::unique_ptr<Image> dstImage(
|
||||
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, dstImage);
|
||||
@@ -1499,7 +1499,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter
|
||||
EXPECT_EQ(0, deleter->drainCalled);
|
||||
EXPECT_EQ(0u, wddm->createAllocationResult.called);
|
||||
deleter->expectDrainBlockingValue(true);
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true);
|
||||
|
||||
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
||||
@@ -1520,7 +1520,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter
|
||||
EXPECT_EQ(0u, wddm->createAllocationResult.called);
|
||||
EXPECT_EQ(0u, wddm->mapGpuVirtualAddressResult.called);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true);
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
||||
@@ -1540,7 +1540,7 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithoutAsyncDele
|
||||
wddm->createAllocationStatus = STATUS_GRAPHICS_NO_VIDEO_MEMORY;
|
||||
EXPECT_EQ(0u, wddm->createAllocationResult.called);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, deviceFactory.rootDevices[0]);
|
||||
AllocationProperties allocProperties = MemObjHelper::getAllocationPropertiesWithImageInfo(0, imgInfo, true, memoryProperties, *hwInfo, mockDeviceBitfield, true);
|
||||
|
||||
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj.h"
|
||||
#include "opencl/source/sharings/sharing.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
@@ -42,7 +42,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireIncrementCounterThenReleaseShouldDecr
|
||||
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(&context, CL_MEM_OBJECT_BUFFER,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false));
|
||||
|
||||
struct MockSharingHandler : SharingHandler {
|
||||
@@ -66,7 +66,7 @@ TEST(sharingHandler, givenMemObjWhenAcquireTwoTimesThenReleaseShouldBeCalledTwoT
|
||||
MockGraphicsAllocation *mockAllocation = new MockGraphicsAllocation(buffer, sizeof(buffer));
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(&context, CL_MEM_OBJECT_BUFFER,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_USE_HOST_PTR, 0, sizeof(buffer), buffer, buffer, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockAllocation), true, false, false));
|
||||
|
||||
struct MockSharingHandler : SharingHandler {
|
||||
@@ -109,7 +109,7 @@ TEST(sharingHandler, givenSharingHandlerWhenAcquiringThenReturnErrorCode) {
|
||||
MockContext context;
|
||||
MockGraphicsAllocation *graphicsAllocation = new MockGraphicsAllocation(nullptr, 0);
|
||||
MemObj memObj(&context, CL_MEM_OBJECT_BUFFER,
|
||||
MemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_USE_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
CL_MEM_USE_HOST_PTR, 0, 1, nullptr, nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(graphicsAllocation), true, false, false);
|
||||
|
||||
auto result = sharingHandler.acquire(&memObj, graphicsAllocation->getRootDeviceIndex());
|
||||
|
||||
Reference in New Issue
Block a user