mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Correct tests: pass valid device bitfield
Related-To: NEO-4645 Change-Id: Iecb2eb7fb83216d85fc56a24666439ae4503194f Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
b23a53b109
commit
127f5de45f
@@ -43,7 +43,7 @@ struct EnqueueSvmTest : public ClDeviceFixture,
|
||||
REQUIRE_SVM_OR_SKIP(defaultHwInfo);
|
||||
ClDeviceFixture::SetUp();
|
||||
CommandQueueFixture::SetUp(pClDevice, 0);
|
||||
ptrSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, {});
|
||||
ptrSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -251,7 +251,7 @@ TEST_F(EnqueueSvmTest, GivenNullDstPtrWhenCopyingMemoryThenInvalidVaueErrorIsRet
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.EnableAsyncEventsHandler.set(false);
|
||||
void *pDstSVM = nullptr;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -496,7 +496,7 @@ TEST_F(EnqueueSvmTest, givenDstHostPtrAndSrcHostPtrAndSizeZeroWhenEnqueueSVMMemc
|
||||
|
||||
HWTEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSVMMemcpyThenSvmMemcpyCommandIsEnqueued) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
MockCommandQueueHw<FamilyType> myCmdQ(context, pClDevice, 0);
|
||||
retVal = myCmdQ.enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
@@ -526,7 +526,7 @@ HWTEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueNonBlockingSVMMemcpyThe
|
||||
|
||||
TEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueBlockingSVMMemcpyThenSuccessIsReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
true, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -542,7 +542,7 @@ TEST_F(EnqueueSvmTest, givenSvmToSvmCopyTypeWhenEnqueueBlockingSVMMemcpyThenSucc
|
||||
|
||||
TEST_F(EnqueueSvmTest, GivenValidParamsWhenCopyingMemoryWithBlockingThenSuccessisReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
auto uEvent = make_releaseable<UserEvent>();
|
||||
cl_event eventWaitList[] = {uEvent.get()};
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
@@ -563,7 +563,7 @@ TEST_F(EnqueueSvmTest, GivenCoherencyWhenCopyingMemoryThenSuccessIsReturned) {
|
||||
void *pDstSVM = ptrSVM;
|
||||
SVMAllocsManager::SvmAllocationProperties svmProperties;
|
||||
svmProperties.coherent = true;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, pDevice->getDeviceBitfield());
|
||||
retVal = this->pCmdQ->enqueueSVMMemcpy(
|
||||
false, // cl_bool blocking_copy
|
||||
pDstSVM, // void *dst_ptr
|
||||
@@ -581,7 +581,7 @@ TEST_F(EnqueueSvmTest, GivenCoherencyWhenCopyingMemoryWithBlockingThenSuccessIsR
|
||||
void *pDstSVM = ptrSVM;
|
||||
SVMAllocsManager::SvmAllocationProperties svmProperties;
|
||||
svmProperties.coherent = true;
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, {});
|
||||
void *pSrcSVM = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, svmProperties, pDevice->getDeviceBitfield());
|
||||
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, {}, {});
|
||||
svmPtrs[i] = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 1, {}, pDevice->getDeviceBitfield());
|
||||
auto svmData = context->getSVMAllocsManager()->getSVMAlloc(svmPtrs[i]);
|
||||
ASSERT_NE(nullptr, svmData);
|
||||
auto ga = svmData->gpuAllocation;
|
||||
@@ -882,7 +882,7 @@ TEST(CreateSvmAllocTests, givenVariousSvmAllocationPropertiesWhenAllocatingSvmTh
|
||||
svmAllocationProperties.readOnly = isReadOnly;
|
||||
svmAllocationProperties.hostPtrReadOnly = isHostPtrReadOnly;
|
||||
|
||||
auto ptrSVM = mockContext->getSVMAllocsManager()->createSVMAlloc(mockDevice->getRootDeviceIndex(), 256, svmAllocationProperties, {});
|
||||
auto ptrSVM = mockContext->getSVMAllocsManager()->createSVMAlloc(mockDevice->getRootDeviceIndex(), 256, svmAllocationProperties, mockDevice->getDeviceBitfield());
|
||||
EXPECT_NE(nullptr, ptrSVM);
|
||||
mockContext->getSVMAllocsManager()->freeSVMAlloc(ptrSVM);
|
||||
}
|
||||
@@ -900,7 +900,7 @@ struct EnqueueSvmTestLocalMemory : public ClDeviceFixture,
|
||||
ClDeviceFixture::SetUp();
|
||||
context = std::make_unique<MockContext>(pClDevice, true);
|
||||
size = 256;
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), size, {}, {});
|
||||
svmPtr = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), size, {}, pDevice->getDeviceBitfield());
|
||||
ASSERT_NE(nullptr, svmPtr);
|
||||
mockSvmManager = reinterpret_cast<MockSVMAllocsManager *>(context->getSVMAllocsManager());
|
||||
}
|
||||
@@ -1311,6 +1311,7 @@ struct FailCsr : public CommandStreamReceiverHw<GfxFamily> {
|
||||
HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAllocationsAreAdded) {
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties;
|
||||
unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
||||
unifiedMemoryProperties.subdeviceBitfield = pDevice->getDeviceBitfield();
|
||||
auto allocationSize = 4096u;
|
||||
auto svmManager = this->context->getSVMAllocsManager();
|
||||
EXPECT_NE(0u, svmManager->getNumAllocs());
|
||||
@@ -1335,6 +1336,7 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAll
|
||||
HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThenOnlyExpectedAllocationsAreAdded) {
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties;
|
||||
unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
|
||||
unifiedMemoryProperties.subdeviceBitfield = pDevice->getDeviceBitfield();
|
||||
auto allocationSize = 4096u;
|
||||
auto svmManager = this->context->getSVMAllocsManager();
|
||||
EXPECT_NE(0u, svmManager->getNumAllocs());
|
||||
@@ -1423,7 +1425,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, {}, {});
|
||||
auto srcSvm = context->getSVMAllocsManager()->createSVMAlloc(pDevice->getRootDeviceIndex(), 256, {}, pDevice->getDeviceBitfield());
|
||||
mockMemoryManager->getPageFaultManager()->insertAllocation(srcSvm, 256, context->getSVMAllocsManager(), context->getSpecialQueue());
|
||||
mockMemoryManager->getPageFaultManager()->insertAllocation(ptrSVM, 256, context->getSVMAllocsManager(), context->getSpecialQueue());
|
||||
EXPECT_EQ(static_cast<MockPageFaultManager *>(mockMemoryManager->getPageFaultManager())->transferToCpuCalled, 2);
|
||||
|
||||
Reference in New Issue
Block a user