mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 12:11:31 +08:00
Revert "fix: set properly resource params when setAllocationType"
This reverts commit 2e0884a301.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8d32a3a3ad
commit
956dd8e17d
@@ -206,8 +206,7 @@ TEST_F(KernelArgBufferTest, given32BitDeviceWhenArgPassedIsNullThenOnly4BytesAre
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnFalse) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer);
|
||||
|
||||
auto val = (cl_mem)&buffer;
|
||||
auto pVal = &val;
|
||||
@@ -224,8 +223,7 @@ TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryI
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToSharedBufferIsCalledThenReturnCorrectValue) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer);
|
||||
|
||||
auto val = (cl_mem)&buffer;
|
||||
auto pVal = &val;
|
||||
@@ -242,8 +240,7 @@ TEST_F(KernelArgBufferTest, givenSharedBufferWhenHasDirectStatelessAccessToShare
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenBufferInHostMemoryWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnCorrectValue) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
auto val = (cl_mem)&buffer;
|
||||
auto pVal = &val;
|
||||
@@ -267,8 +264,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationWhenHasDirectStatelessAccessToHost
|
||||
char data[128];
|
||||
void *ptr = &data;
|
||||
MockGraphicsAllocation gfxAllocation(ptr, 128);
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
gfxAllocation.setAllocationType(AllocationType::buffer, productHelper);
|
||||
gfxAllocation.setAllocationType(AllocationType::buffer);
|
||||
|
||||
for (auto pureStatefulBufferAccess : {false, true}) {
|
||||
pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess);
|
||||
@@ -289,8 +285,7 @@ TEST_F(KernelArgBufferTest, givenGfxAllocationInHostMemoryWhenHasDirectStateless
|
||||
char data[128];
|
||||
void *ptr = &data;
|
||||
MockGraphicsAllocation gfxAllocation(ptr, 128);
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
for (auto pureStatefulBufferAccess : {false, true}) {
|
||||
pKernelInfo->setBufferStateful(0, pureStatefulBufferAccess);
|
||||
@@ -334,9 +329,8 @@ TEST_F(KernelArgBufferTest, givenKernelWithIndirectStatelessAccessWhenHasIndirec
|
||||
|
||||
MockKernel kernelWithIndirectUnifiedMemoryAllocation(pProgram, kernelInfo, *pClDevice);
|
||||
MockGraphicsAllocation gfxAllocation;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
for (const auto type : allocationTypes) {
|
||||
gfxAllocation.setAllocationType(type, productHelper);
|
||||
gfxAllocation.setAllocationType(type);
|
||||
kernelWithIndirectUnifiedMemoryAllocation.setUnifiedMemoryExecInfo(&gfxAllocation);
|
||||
if (type == AllocationType::bufferHostMemory) {
|
||||
EXPECT_TRUE(kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory());
|
||||
@@ -391,8 +385,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo
|
||||
debugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::sharedBuffer);
|
||||
|
||||
auto val = (cl_mem)&buffer;
|
||||
auto pVal = &val;
|
||||
@@ -414,8 +407,7 @@ TEST_F(KernelArgBufferTest, givenSetArgBufferOnKernelWithDirectStatelessAccessTo
|
||||
debugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
auto val = (cl_mem)&buffer;
|
||||
auto pVal = &val;
|
||||
@@ -465,8 +457,7 @@ TEST_F(KernelArgBufferTest, givenSetArgSvmAllocOnKernelWithDirectStatelessAccess
|
||||
char data[128];
|
||||
void *ptr = &data;
|
||||
MockGraphicsAllocation gfxAllocation(ptr, 128);
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
auto retVal = pKernel->setArgSvmAlloc(0, ptr, &gfxAllocation, 0u);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -512,8 +503,7 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithNoIndirectS
|
||||
pKernelInfo->kernelDescriptor.kernelAttributes.hasIndirectStatelessAccess = false;
|
||||
|
||||
MockGraphicsAllocation gfxAllocation;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
gfxAllocation.setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
pKernel->setUnifiedMemoryExecInfo(&gfxAllocation);
|
||||
|
||||
@@ -536,9 +526,9 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta
|
||||
AllocationType::bufferHostMemory};
|
||||
|
||||
MockGraphicsAllocation gfxAllocation;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
|
||||
for (const auto type : allocationTypes) {
|
||||
gfxAllocation.setAllocationType(type, productHelper);
|
||||
gfxAllocation.setAllocationType(type);
|
||||
|
||||
pKernel->setUnifiedMemoryExecInfo(&gfxAllocation);
|
||||
|
||||
@@ -579,9 +569,9 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta
|
||||
auto gmm = std::make_unique<Gmm>(pDevice->getRootDeviceEnvironment().getGmmHelper(), nullptr, 0, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, StorageInfo{}, gmmRequirements);
|
||||
MockGraphicsAllocation gfxAllocation;
|
||||
gfxAllocation.setDefaultGmm(gmm.get());
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
|
||||
for (const auto type : allocationTypes) {
|
||||
gfxAllocation.setAllocationType(type.allocationType, productHelper);
|
||||
gfxAllocation.setAllocationType(type.allocationType);
|
||||
|
||||
pKernel->setUnifiedMemoryExecInfo(&gfxAllocation);
|
||||
gmm->setCompressionEnabled(type.compressed);
|
||||
@@ -626,9 +616,9 @@ TEST_F(KernelArgBufferTest, givenSVMAllocsManagerWithCompressedSVMAllocationsWhe
|
||||
SvmAllocationData allocData(0);
|
||||
allocData.gpuAllocations.addAllocation(&gfxAllocation);
|
||||
allocData.device = &pClDevice->getDevice();
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
|
||||
for (const auto type : allocationTypes) {
|
||||
gfxAllocation.setAllocationType(type.allocationType, productHelper);
|
||||
gfxAllocation.setAllocationType(type.allocationType);
|
||||
|
||||
gmm->setCompressionEnabled(type.compressed);
|
||||
|
||||
@@ -743,8 +733,7 @@ HWTEST_F(KernelArgBufferTestBindless, givenBindlessBuffersWhenPatchBindlessOffse
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenBufferAsHostMemoryWhenSettingKernelArgThenKernelUsesSystemMemory) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::bufferHostMemory);
|
||||
|
||||
auto memVal = (cl_mem)&buffer;
|
||||
auto val = &memVal;
|
||||
@@ -759,8 +748,7 @@ TEST_F(KernelArgBufferTest, givenBufferAsHostMemoryWhenSettingKernelArgThenKerne
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryWhenSettingKernelArgThenKernelNotUsesSystemMemory) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer);
|
||||
|
||||
auto memVal = (cl_mem)&buffer;
|
||||
auto val = &memVal;
|
||||
@@ -775,8 +763,7 @@ TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryWhenSettingKernelArgThenKer
|
||||
|
||||
TEST_F(KernelArgBufferTest, givenBufferAsDeviceMemoryAndKernelIsAlreadySetToUseSystemWhenSettingKernelArgThenKernelUsesSystemMemory) {
|
||||
MockBuffer buffer;
|
||||
auto &productHelper = pClDevice->getProductHelper();
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer, productHelper);
|
||||
buffer.getGraphicsAllocation(mockRootDeviceIndex)->setAllocationType(AllocationType::buffer);
|
||||
|
||||
auto memVal = (cl_mem)&buffer;
|
||||
auto val = &memVal;
|
||||
|
||||
Reference in New Issue
Block a user