mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Refactor USM properties
store reference to std of root device indices and device bitfields store NEO::Device in USM properties Related-To: NEO-3691 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
06dad67c5a
commit
1b7d7afc07
@@ -38,9 +38,9 @@ struct EnqueueSvmMemCopyTest : public ClDeviceFixture,
|
||||
}
|
||||
|
||||
CommandQueueFixture::SetUp(pClDevice, 0);
|
||||
srcSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
srcSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, srcSvmPtr);
|
||||
dstSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
dstSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, dstSvmPtr);
|
||||
auto srcSvmData = context->getSVMAllocsManager()->getSVMAlloc(srcSvmPtr);
|
||||
ASSERT_NE(nullptr, srcSvmData);
|
||||
@@ -372,7 +372,7 @@ struct EnqueueSvmMemCopyHw : public ::testing::Test {
|
||||
}
|
||||
|
||||
context = std::make_unique<MockContext>(device.get());
|
||||
srcSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(device->getRootDeviceIndex(), 256, {}, device->getDeviceBitfield());
|
||||
srcSvmPtr = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, srcSvmPtr);
|
||||
dstHostPtr = alignedMalloc(256, 64);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct EnqueueSvmMemFillTest : public ClDeviceFixture,
|
||||
ASSERT_TRUE((0 < patternSize) && (patternSize <= 128));
|
||||
SVMAllocsManager::SvmAllocationProperties svmProperties;
|
||||
svmProperties.coherent = true;
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, pDevice->getDeviceBitfield());
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(256, svmProperties, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, svmPtr);
|
||||
auto svmData = context->getSVMAllocsManager()->getSVMAlloc(svmPtr);
|
||||
ASSERT_NE(nullptr, svmData);
|
||||
@@ -156,7 +156,7 @@ struct EnqueueSvmMemFillHw : public ::testing::Test {
|
||||
}
|
||||
|
||||
context = std::make_unique<MockContext>(device.get());
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(device->getRootDeviceIndex(), 256, {}, device->getDeviceBitfield());
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, svmPtr);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ struct EnqueueSvmTest : public ClDeviceFixture,
|
||||
REQUIRE_SVM_OR_SKIP(defaultHwInfo);
|
||||
ClDeviceFixture::SetUp();
|
||||
CommandQueueFixture::SetUp(pClDevice, 0);
|
||||
ptrSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
ptrSVM = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -253,7 +253,7 @@ TEST_F(EnqueueSvmTest, GivenNullDstPtrWhenCopyingMemoryThenInvalidVaueErrorIsRet
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.EnableAsyncEventsHandler.set(false);
|
||||
void *pDstSVM = nullptr;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -498,7 +498,7 @@ TEST_F(EnqueueSvmTest, givenDstHostPtrAndSrcHostPtrAndSizeZeroWhenEnqueueSVMMemc
|
||||
|
||||
HWTEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSVMMemcpyThenSvmMemcpyCommandIsEnqueued) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
MockCommandQueueHw<FamilyType> myCmdQ(context, pClDevice, 0);
|
||||
retVal = myCmdQ.enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
@@ -528,7 +528,7 @@ HWTEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSVMMemcpyThe
|
||||
|
||||
TEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueBlockingSVMMemcpyThenSuccessIsReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
true, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -544,7 +544,7 @@ TEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueBlockingSVMMemcpyThenSucc
|
||||
|
||||
TEST_F(EnqueueSvmTest, GivenValidParamsWhenCopyingMemoryWithBlockingThenSuccessisReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
auto uEvent = make_releaseable<UserEvent>();
|
||||
cl_event eventWaitList[] = {uEvent.get()};
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
@@ -565,7 +565,7 @@ TEST_F(EnqueueSvmTest, GivenCoherencyWhenCopyingMemoryThenSuccessIsReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
SVMAllocsManager::SvmAllocationProperties svmProperties;
|
||||
svmProperties.coherent = true;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, svmProperties, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -583,7 +583,7 @@ TEST_F(EnqueueSvmTest, GivenCoherencyWhenCopyingMemoryWithBlockingThenSuccessIsR
|
||||
void *pDstSVM = ptrSVM;
|
||||
SVMAllocsManager::SvmAllocationProperties svmProperties;
|
||||
svmProperties.coherent = true;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(256, svmProperties, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
auto uEvent = make_releaseable<UserEvent>();
|
||||
cl_event eventWaitList[] = {uEvent.get()};
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
@@ -806,7 +806,7 @@ TEST_F(EnqueueSvmTest, GivenMultipleThreasWhenAllocatingSvmThenOnlyOneAllocation
|
||||
|
||||
auto allocSvm = [&](uint32_t from, uint32_t to) {
|
||||
for (uint32_t i = from; i <= to; i++) {
|
||||
svmPtrs[i] = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 1, {}, pDevice->getDeviceBitfield());
|
||||
svmPtrs[i] = context->getSVMAllocsManager()->createSVMAlloc(1, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
auto svmData = context->getSVMAllocsManager()->getSVMAlloc(svmPtrs[i]);
|
||||
ASSERT_NE(nullptr, svmData);
|
||||
auto ga = svmData->gpuAllocations.getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
@@ -899,7 +899,7 @@ TEST(CreateSvmAllocTests, givenVariousSvmAllocationPropertiesWhenAllocatingSvmTh
|
||||
svmAllocationProperties.readOnly = isReadOnly;
|
||||
svmAllocationProperties.hostPtrReadOnly = isHostPtrReadOnly;
|
||||
|
||||
auto ptrSVM = mockContext->getSVMAllocsManager()->createSVMAlloc(mockDevice->getRootDeviceIndex(), 256, svmAllocationProperties, mockDevice->getDeviceBitfield());
|
||||
auto ptrSVM = mockContext->getSVMAllocsManager()->createSVMAlloc(256, svmAllocationProperties, mockContext->getRootDeviceIndices(), mockContext->getDeviceBitfields());
|
||||
EXPECT_NE(nullptr, ptrSVM);
|
||||
mockContext->getSVMAllocsManager()->freeSVMAlloc(ptrSVM);
|
||||
}
|
||||
@@ -917,7 +917,7 @@ struct EnqueueSvmTestLocalMemory : public ClDeviceFixture,
|
||||
ClDeviceFixture::SetUp();
|
||||
context = std::make_unique<MockContext>(pClDevice, true);
|
||||
size = 256;
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), size, {}, pDevice->getDeviceBitfield());
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(size, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
ASSERT_NE(nullptr, svmPtr);
|
||||
mockSvmManager = reinterpret_cast<MockSVMAllocsManager *>(context->getSVMAllocsManager());
|
||||
}
|
||||
@@ -1345,12 +1345,12 @@ struct FailCsr : public CommandStreamReceiverHw<GfxFamily> {
|
||||
};
|
||||
|
||||
HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAllocationsAreAdded) {
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, pDevice->getDeviceBitfield());
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
unifiedMemoryProperties.device = pDevice;
|
||||
auto allocationSize = 4096u;
|
||||
auto svmManager = this->context->getSVMAllocsManager();
|
||||
EXPECT_NE(0u, svmManager->getNumAllocs());
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(pDevice->getRootDeviceIndex(), allocationSize, unifiedMemoryProperties);
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(allocationSize, unifiedMemoryProperties);
|
||||
EXPECT_NE(nullptr, unifiedMemoryPtr);
|
||||
EXPECT_EQ(2u, svmManager->getNumAllocs());
|
||||
|
||||
@@ -1369,12 +1369,12 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAll
|
||||
}
|
||||
|
||||
HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThenOnlyExpectedAllocationsAreAdded) {
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, pDevice->getDeviceBitfield());
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
unifiedMemoryProperties.device = pDevice;
|
||||
auto allocationSize = 4096u;
|
||||
auto svmManager = this->context->getSVMAllocsManager();
|
||||
EXPECT_NE(0u, svmManager->getNumAllocs());
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(pDevice->getRootDeviceIndex(), allocationSize, unifiedMemoryProperties);
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(allocationSize, unifiedMemoryProperties);
|
||||
EXPECT_NE(nullptr, unifiedMemoryPtr);
|
||||
EXPECT_EQ(2u, svmManager->getNumAllocs());
|
||||
|
||||
@@ -1393,12 +1393,12 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThen
|
||||
}
|
||||
|
||||
HWTEST_F(EnqueueSvmTest, whenInternalAllocationIsTriedToBeAddedTwiceToResidencyContainerThenOnlyOnceIsAdded) {
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, pDevice->getDeviceBitfield());
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
unifiedMemoryProperties.device = pDevice;
|
||||
auto allocationSize = 4096u;
|
||||
auto svmManager = this->context->getSVMAllocsManager();
|
||||
EXPECT_NE(0u, svmManager->getNumAllocs());
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(pDevice->getRootDeviceIndex(), allocationSize, unifiedMemoryProperties);
|
||||
auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(allocationSize, unifiedMemoryProperties);
|
||||
EXPECT_NE(nullptr, unifiedMemoryPtr);
|
||||
EXPECT_EQ(2u, svmManager->getNumAllocs());
|
||||
|
||||
@@ -1441,11 +1441,10 @@ struct createHostUnifiedMemoryAllocationTest : public ::testing::Test {
|
||||
HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
whenCreatingHostUnifiedMemoryAllocationThenOneAllocDataIsCreatedWithOneGraphicsAllocationPerDevice) {
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, device0->getDevice().getDeviceBitfield());
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
|
||||
EXPECT_EQ(0u, svmManager->getNumAllocs());
|
||||
auto unifiedMemoryPtr = svmManager->createHostUnifiedMemoryAllocation(numDevices - 1,
|
||||
allocationSize,
|
||||
auto unifiedMemoryPtr = svmManager->createHostUnifiedMemoryAllocation(allocationSize,
|
||||
unifiedMemoryProperties);
|
||||
EXPECT_NE(nullptr, unifiedMemoryPtr);
|
||||
EXPECT_EQ(1u, svmManager->getNumAllocs());
|
||||
@@ -1464,7 +1463,7 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
whenCreatingMultiGraphicsAllocationThenGraphicsAllocationPerDeviceIsCreated) {
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, device0->getDevice().getDeviceBitfield());
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
|
||||
auto alignedSize = alignUp<size_t>(allocationSize, MemoryConstants::pageSize64k);
|
||||
auto memoryManager = context.getMemoryManager();
|
||||
@@ -1478,13 +1477,14 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
rootDeviceIndices.push_back(2u);
|
||||
|
||||
auto rootDeviceIndex = rootDeviceIndices.at(0);
|
||||
auto deviceBitfield = device0->getDeviceBitfield();
|
||||
AllocationProperties allocationProperties{rootDeviceIndex,
|
||||
true,
|
||||
alignedSize,
|
||||
allocationType,
|
||||
unifiedMemoryProperties.subdeviceBitfield.count() > 1,
|
||||
unifiedMemoryProperties.subdeviceBitfield.count() > 1,
|
||||
unifiedMemoryProperties.subdeviceBitfield};
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield};
|
||||
allocationProperties.flags.shareable = unifiedMemoryProperties.allocationFlags.flags.shareable;
|
||||
|
||||
SvmAllocationData allocData(maxRootDeviceIndex);
|
||||
@@ -1509,7 +1509,7 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
whenCreatingMultiGraphicsAllocationForSpecificRootDeviceIndicesThenOnlyGraphicsAllocationPerSpecificRootDeviceIndexIsCreated) {
|
||||
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, device0->getDevice().getDeviceBitfield());
|
||||
NEO::SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
|
||||
auto alignedSize = alignUp<size_t>(allocationSize, MemoryConstants::pageSize64k);
|
||||
auto memoryManager = context.getMemoryManager();
|
||||
@@ -1523,13 +1523,14 @@ HWTEST_F(createHostUnifiedMemoryAllocationTest,
|
||||
|
||||
auto noProgramedRootDeviceIndex = 1u;
|
||||
auto rootDeviceIndex = rootDeviceIndices.at(0);
|
||||
auto deviceBitfield = device0->getDeviceBitfield();
|
||||
AllocationProperties allocationProperties{rootDeviceIndex,
|
||||
true,
|
||||
alignedSize,
|
||||
allocationType,
|
||||
unifiedMemoryProperties.subdeviceBitfield.count() > 1,
|
||||
unifiedMemoryProperties.subdeviceBitfield.count() > 1,
|
||||
unifiedMemoryProperties.subdeviceBitfield};
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield.count() > 1,
|
||||
deviceBitfield};
|
||||
allocationProperties.flags.shareable = unifiedMemoryProperties.allocationFlags.flags.shareable;
|
||||
|
||||
SvmAllocationData allocData(maxRootDeviceIndex);
|
||||
@@ -1878,7 +1879,7 @@ TEST_F(EnqueueSvmTest, givenPageFaultManagerWhenEnqueueMemcpyThenAllocIsDecommit
|
||||
mockMemoryManager->pageFaultManager.reset(new MockPageFaultManager());
|
||||
auto memoryManager = context->getMemoryManager();
|
||||
context->memoryManager = mockMemoryManager.get();
|
||||
auto srcSvm = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
auto srcSvm = context->getSVMAllocsManager()->createSVMAlloc(256, {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
mockMemoryManager->getPageFaultManager()->insertAllocation(srcSvm, 256, context->getSVMAllocsManager(), context->getSpecialQueue(pDevice->getRootDeviceIndex()), {});
|
||||
mockMemoryManager->getPageFaultManager()->insertAllocation(ptrSVM, 256, context->getSVMAllocsManager(), context->getSpecialQueue(pDevice->getRootDeviceIndex()), {});
|
||||
EXPECT_EQ(static_cast<MockPageFaultManager *>(mockMemoryManager->getPageFaultManager())->transferToCpuCalled, 0);
|
||||
|
||||
@@ -762,8 +762,8 @@ HWTEST_F(ZeroSizeEnqueueHandlerTest, GivenZeroSizeEnqueueIsDetectedWhenCopyingSv
|
||||
REQUIRE_SVM_OR_SKIP(pDevice);
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(&context, pClDevice, 0));
|
||||
|
||||
void *pSrcSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pDstSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
void *pDstSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
size_t zeroSize = 0;
|
||||
mockCmdQ->enqueueSVMMemcpy(false, pSrcSVM, pDstSVM, zeroSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(static_cast<cl_command_type>(CL_COMMAND_MARKER), mockCmdQ->lastCommandType);
|
||||
@@ -777,8 +777,8 @@ HWTEST_F(ZeroSizeEnqueueHandlerTest, GivenZeroSizeEnqueueIsDetectedWhenCopyingSv
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(&context, pClDevice, 0));
|
||||
|
||||
cl_event event;
|
||||
void *pSrcSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pDstSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSrcSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
void *pDstSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
size_t zeroSize = 0;
|
||||
mockCmdQ->enqueueSVMMemcpy(false, pSrcSVM, pDstSVM, zeroSize, 0, nullptr, &event);
|
||||
EXPECT_EQ(static_cast<cl_command_type>(CL_COMMAND_MARKER), mockCmdQ->lastCommandType);
|
||||
@@ -800,7 +800,7 @@ HWTEST_F(ZeroSizeEnqueueHandlerTest, GivenZeroSizeEnqueueIsDetectedWhenFillingSv
|
||||
REQUIRE_SVM_OR_SKIP(pDevice);
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(&context, pClDevice, 0));
|
||||
|
||||
void *pSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
const float pattern[1] = {1.2345f};
|
||||
size_t zeroSize = 0;
|
||||
mockCmdQ->enqueueSVMMemFill(pSVM, &pattern, sizeof(pattern), zeroSize, 0, nullptr, nullptr);
|
||||
@@ -814,7 +814,7 @@ HWTEST_F(ZeroSizeEnqueueHandlerTest, GivenZeroSizeEnqueueIsDetectedWhenFillingSv
|
||||
auto mockCmdQ = std::unique_ptr<MockCommandQueueHw<FamilyType>>(new MockCommandQueueHw<FamilyType>(&context, pClDevice, 0));
|
||||
|
||||
cl_event event;
|
||||
void *pSVM = context.getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
void *pSVM = context.getSVMAllocsManager()->createSVMAlloc(256, {}, context.getRootDeviceIndices(), context.getDeviceBitfields());
|
||||
const float pattern[1] = {1.2345f};
|
||||
size_t zeroSize = 0;
|
||||
mockCmdQ->enqueueSVMMemFill(pSVM, &pattern, sizeof(pattern), zeroSize, 0, nullptr, &event);
|
||||
|
||||
Reference in New Issue
Block a user