Skip to content

Commit 8113faf

Browse files
Jaime ArteagaCompute-Runtime-Automation
authored andcommitted
Disable cross-device indirect access
Change-Id: I57655abfc02785dfd68384a1546ee4cfdbea938a Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
1 parent 351af1d commit 8113faf

File tree

10 files changed

+225
-14
lines changed

10 files changed

+225
-14
lines changed

level_zero/core/source/cmdlist/cmdlist_hw_base.inl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
6565
}
6666

6767
NEO::EncodeDispatchKernel<GfxFamily>::encode(commandContainer,
68-
reinterpret_cast<const void *>(pThreadGroupDimensions), isIndirect, isPredicate, kernel,
69-
0, device->getNEODevice(), commandListPreemptionMode);
68+
reinterpret_cast<const void *>(pThreadGroupDimensions),
69+
isIndirect,
70+
isPredicate,
71+
kernel,
72+
0,
73+
device->getNEODevice(),
74+
commandListPreemptionMode);
7075

7176
appendSignalEventPostWalker(hEvent);
7277

level_zero/core/source/cmdqueue/cmdqueue_hw.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
121121
UnifiedMemoryControls unifiedMemoryControls = commandList->getUnifiedMemoryControls();
122122

123123
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
124-
svmAllocsManager->addInternalAllocationsToResidencyContainer(commandList->commandContainer.getResidencyContainer(),
124+
svmAllocsManager->addInternalAllocationsToResidencyContainer(neoDevice->getRootDeviceIndex(),
125+
commandList->commandContainer.getResidencyContainer(),
125126
unifiedMemoryControls.generateMask());
126127
}
127128

opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ HWTEST_F(DispatchWalkerTest, WhenGettingComputeDimensionsThenCorrectNumberOfDime
126126

127127
HWTEST_F(DispatchWalkerTest, givenSimd1WhenSetGpgpuWalkerThreadDataThenSimdInWalkerIsSetTo32Value) {
128128
uint32_t pCmdBuffer[1024];
129-
MockGraphicsAllocation gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer));
129+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
130130
LinearStream linearStream(&gfxAllocation);
131131

132132
using WALKER_TYPE = typename FamilyType::WALKER_TYPE;

opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp

Lines changed: 172 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "shared/source/memory_manager/allocations_list.h"
1212
#include "shared/source/memory_manager/surface.h"
1313
#include "shared/source/memory_manager/unified_memory_manager.h"
14+
#include "shared/source/os_interface/device_factory.h"
1415
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
1516
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
1617
#include "shared/test/unit_test/page_fault_manager/mock_cpu_page_fault_manager.h"
@@ -24,6 +25,7 @@
2425
#include "opencl/test/unit_test/libult/ult_command_stream_receiver.h"
2526
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
2627
#include "opencl/test/unit_test/mocks/mock_context.h"
28+
#include "opencl/test/unit_test/mocks/mock_graphics_allocation.h"
2729
#include "opencl/test/unit_test/mocks/mock_kernel.h"
2830
#include "opencl/test/unit_test/mocks/mock_svm_manager.h"
2931
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
@@ -1331,6 +1333,7 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAll
13311333
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties;
13321334
unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
13331335
unifiedMemoryProperties.subdeviceBitfield = pDevice->getDeviceBitfield();
1336+
unifiedMemoryProperties.device = pDevice;
13341337
auto allocationSize = 4096u;
13351338
auto svmManager = this->context->getSVMAllocsManager();
13361339
EXPECT_NE(0u, svmManager->getNumAllocs());
@@ -1356,6 +1359,7 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThen
13561359
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties;
13571360
unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
13581361
unifiedMemoryProperties.subdeviceBitfield = pDevice->getDeviceBitfield();
1362+
unifiedMemoryProperties.device = pDevice;
13591363
auto allocationSize = 4096u;
13601364
auto svmManager = this->context->getSVMAllocsManager();
13611365
EXPECT_NE(0u, svmManager->getNumAllocs());
@@ -1366,7 +1370,9 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThen
13661370
ResidencyContainer residencyContainer;
13671371
EXPECT_EQ(0u, residencyContainer.size());
13681372

1369-
svmManager->addInternalAllocationsToResidencyContainer(residencyContainer, InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1373+
svmManager->addInternalAllocationsToResidencyContainer(pDevice->getRootDeviceIndex(),
1374+
residencyContainer,
1375+
InternalMemoryType::DEVICE_UNIFIED_MEMORY);
13701376

13711377
//only unified memory allocation is added to residency container
13721378
EXPECT_EQ(1u, residencyContainer.size());
@@ -1375,6 +1381,171 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreAddedToResidencyContainerThen
13751381
svmManager->freeSVMAlloc(unifiedMemoryPtr);
13761382
}
13771383

1384+
struct MemoryAllocationTypeArray {
1385+
const InternalMemoryType allocationType[3] = {InternalMemoryType::HOST_UNIFIED_MEMORY,
1386+
InternalMemoryType::DEVICE_UNIFIED_MEMORY,
1387+
InternalMemoryType::SHARED_UNIFIED_MEMORY};
1388+
};
1389+
1390+
struct UpdateResidencyContainerMultipleDevicesTest : public ::testing::WithParamInterface<std::tuple<InternalMemoryType, InternalMemoryType>>,
1391+
public ::testing::Test {
1392+
void SetUp() override {
1393+
device = context.pRootDevice0;
1394+
subDevice0 = context.pSubDevice00;
1395+
subDevice1 = context.pSubDevice01;
1396+
1397+
peerDevice = context.pRootDevice1;
1398+
peerSubDevice0 = context.pSubDevice10;
1399+
peerSubDevice1 = context.pSubDevice11;
1400+
1401+
svmManager = context.getSVMAllocsManager();
1402+
EXPECT_EQ(0u, svmManager->getNumAllocs());
1403+
}
1404+
MockUnrestrictiveContextMultiGPU context;
1405+
MockClDevice *device;
1406+
ClDevice *subDevice0 = nullptr;
1407+
ClDevice *subDevice1 = nullptr;
1408+
MockClDevice *peerDevice;
1409+
ClDevice *peerSubDevice0 = nullptr;
1410+
ClDevice *peerSubDevice1 = nullptr;
1411+
SVMAllocsManager *svmManager = nullptr;
1412+
};
1413+
1414+
HWTEST_F(UpdateResidencyContainerMultipleDevicesTest,
1415+
givenNoAllocationsCreatedThenNoInternalAllocationsAreAddedToResidencyContainer) {
1416+
ResidencyContainer residencyContainer;
1417+
EXPECT_EQ(0u, residencyContainer.size());
1418+
svmManager->addInternalAllocationsToResidencyContainer(device->getDevice().getRootDeviceIndex(),
1419+
residencyContainer,
1420+
InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1421+
EXPECT_EQ(0u, residencyContainer.size());
1422+
}
1423+
1424+
HWTEST_P(UpdateResidencyContainerMultipleDevicesTest, givenAllocationItIsAddedToContainerOnlyIfMaskMatches) {
1425+
uint32_t pCmdBuffer[1024];
1426+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
1427+
1428+
InternalMemoryType type = std::get<0>(GetParam());
1429+
uint32_t mask = std::get<1>(GetParam());
1430+
1431+
SvmAllocationData allocData;
1432+
allocData.gpuAllocation = &gfxAllocation;
1433+
allocData.memoryType = type;
1434+
allocData.device = &device->getDevice();
1435+
1436+
svmManager->insertSVMAlloc(allocData);
1437+
EXPECT_EQ(1u, svmManager->getNumAllocs());
1438+
1439+
ResidencyContainer residencyContainer;
1440+
EXPECT_EQ(0u, residencyContainer.size());
1441+
1442+
svmManager->addInternalAllocationsToResidencyContainer(device->getDevice().getRootDeviceIndex(),
1443+
residencyContainer,
1444+
mask);
1445+
1446+
if (mask == static_cast<uint32_t>(type)) {
1447+
EXPECT_EQ(1u, residencyContainer.size());
1448+
EXPECT_EQ(residencyContainer[0]->getGpuAddress(), gfxAllocation.getGpuAddress());
1449+
} else {
1450+
EXPECT_EQ(0u, residencyContainer.size());
1451+
}
1452+
}
1453+
1454+
MemoryAllocationTypeArray memoryTypeArray;
1455+
INSTANTIATE_TEST_SUITE_P(UpdateResidencyContainerMultipleDevicesTests,
1456+
UpdateResidencyContainerMultipleDevicesTest,
1457+
::testing::Combine(
1458+
::testing::ValuesIn(memoryTypeArray.allocationType),
1459+
::testing::ValuesIn(memoryTypeArray.allocationType)));
1460+
1461+
HWTEST_F(UpdateResidencyContainerMultipleDevicesTest,
1462+
whenInternalAllocationsAreAddedToResidencyContainerThenOnlyAllocationsFromSameDeviceAreAdded) {
1463+
1464+
uint32_t pCmdBuffer[1024];
1465+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
1466+
SvmAllocationData allocData;
1467+
allocData.gpuAllocation = &gfxAllocation;
1468+
allocData.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1469+
allocData.device = &device->getDevice();
1470+
1471+
uint32_t pCmdBufferPeer[1024];
1472+
MockGraphicsAllocation gfxAllocationPeer((void *)pCmdBufferPeer, sizeof(pCmdBufferPeer));
1473+
SvmAllocationData allocDataPeer;
1474+
allocDataPeer.gpuAllocation = &gfxAllocationPeer;
1475+
allocDataPeer.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1476+
allocDataPeer.device = &peerDevice->getDevice();
1477+
1478+
svmManager->insertSVMAlloc(allocData);
1479+
svmManager->insertSVMAlloc(allocDataPeer);
1480+
EXPECT_EQ(2u, svmManager->getNumAllocs());
1481+
1482+
ResidencyContainer residencyContainer;
1483+
EXPECT_EQ(0u, residencyContainer.size());
1484+
svmManager->addInternalAllocationsToResidencyContainer(device->getDevice().getRootDeviceIndex(),
1485+
residencyContainer,
1486+
InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1487+
EXPECT_EQ(1u, residencyContainer.size());
1488+
EXPECT_EQ(residencyContainer[0]->getGpuAddress(), gfxAllocation.getGpuAddress());
1489+
}
1490+
1491+
HWTEST_F(UpdateResidencyContainerMultipleDevicesTest,
1492+
givenAllocationsFromSubDevicesBelongingTheTargetDeviceThenTheyAreAddedToTheResidencyContainer) {
1493+
1494+
uint32_t pCmdBuffer[1024];
1495+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
1496+
SvmAllocationData allocData0;
1497+
allocData0.gpuAllocation = &gfxAllocation;
1498+
allocData0.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1499+
allocData0.device = &subDevice0->getDevice();
1500+
1501+
uint32_t pCmdBufferPeer[1024];
1502+
MockGraphicsAllocation gfxAllocationPeer((void *)pCmdBufferPeer, sizeof(pCmdBufferPeer));
1503+
SvmAllocationData allocData1;
1504+
allocData1.gpuAllocation = &gfxAllocationPeer;
1505+
allocData1.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1506+
allocData1.device = &subDevice1->getDevice();
1507+
1508+
svmManager->insertSVMAlloc(allocData0);
1509+
svmManager->insertSVMAlloc(allocData1);
1510+
EXPECT_EQ(2u, svmManager->getNumAllocs());
1511+
1512+
ResidencyContainer residencyContainer;
1513+
EXPECT_EQ(0u, residencyContainer.size());
1514+
svmManager->addInternalAllocationsToResidencyContainer(device->getDevice().getRootDeviceIndex(),
1515+
residencyContainer,
1516+
InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1517+
EXPECT_EQ(2u, residencyContainer.size());
1518+
}
1519+
1520+
HWTEST_F(UpdateResidencyContainerMultipleDevicesTest,
1521+
givenAllocationsFromSubDevicesNotBelongingTheTargetDeviceThenTheyAreNotAddedToTheResidencyContainer) {
1522+
1523+
uint32_t pCmdBuffer[1024];
1524+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
1525+
SvmAllocationData allocData0;
1526+
allocData0.gpuAllocation = &gfxAllocation;
1527+
allocData0.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1528+
allocData0.device = &subDevice0->getDevice();
1529+
1530+
uint32_t pCmdBufferPeer[1024];
1531+
MockGraphicsAllocation gfxAllocationPeer((void *)pCmdBufferPeer, sizeof(pCmdBufferPeer));
1532+
SvmAllocationData allocData1;
1533+
allocData1.gpuAllocation = &gfxAllocationPeer;
1534+
allocData1.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY;
1535+
allocData1.device = &subDevice1->getDevice();
1536+
1537+
svmManager->insertSVMAlloc(allocData0);
1538+
svmManager->insertSVMAlloc(allocData1);
1539+
EXPECT_EQ(2u, svmManager->getNumAllocs());
1540+
1541+
ResidencyContainer residencyContainer;
1542+
EXPECT_EQ(0u, residencyContainer.size());
1543+
svmManager->addInternalAllocationsToResidencyContainer(peerDevice->getDevice().getRootDeviceIndex(),
1544+
residencyContainer,
1545+
InternalMemoryType::DEVICE_UNIFIED_MEMORY);
1546+
EXPECT_EQ(0u, residencyContainer.size());
1547+
}
1548+
13781549
HWTEST_F(EnqueueSvmTest, GivenDstHostPtrWhenHostPtrAllocationCreationFailsThenReturnOutOfResource) {
13791550
char dstHostPtr[260];
13801551
void *pDstSVM = dstHostPtr;

opencl/test/unit_test/command_stream/linear_stream_fixture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace NEO {
1717

1818
struct LinearStreamFixture {
1919
LinearStreamFixture(void)
20-
: gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer)), linearStream(&gfxAllocation) {
20+
: gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer)), linearStream(&gfxAllocation) {
2121
}
2222

2323
virtual void SetUp(void) {

opencl/test/unit_test/mocks/mock_context.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,16 @@ MockUnrestrictiveContext::MockUnrestrictiveContext() : MockContext(nullptr, null
126126
initializeWithDevices(ClDeviceVector{deviceIds, 3}, true);
127127
}
128128

129+
MockUnrestrictiveContextMultiGPU::MockUnrestrictiveContextMultiGPU() : MockContext(nullptr, nullptr) {
130+
pRootDevice0 = ultClDeviceFactory.rootDevices[0];
131+
pSubDevice00 = ultClDeviceFactory.subDevices[0];
132+
pSubDevice01 = ultClDeviceFactory.subDevices[1];
133+
pRootDevice1 = ultClDeviceFactory.rootDevices[1];
134+
pSubDevice10 = ultClDeviceFactory.subDevices[2];
135+
pSubDevice11 = ultClDeviceFactory.subDevices[3];
136+
cl_device_id deviceIds[] = {pRootDevice0, pSubDevice00, pSubDevice01,
137+
pRootDevice1, pSubDevice10, pSubDevice11};
138+
initializeWithDevices(ClDeviceVector{deviceIds, 6}, true);
139+
}
140+
129141
} // namespace NEO

opencl/test/unit_test/mocks/mock_context.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,16 @@ struct MockUnrestrictiveContext : MockContext {
7171
ClDevice *pSubDevice1 = nullptr;
7272
};
7373

74+
struct MockUnrestrictiveContextMultiGPU : MockContext {
75+
MockUnrestrictiveContextMultiGPU();
76+
77+
UltClDeviceFactory ultClDeviceFactory{2, 2};
78+
MockClDevice *pRootDevice0;
79+
ClDevice *pSubDevice00 = nullptr;
80+
ClDevice *pSubDevice01 = nullptr;
81+
MockClDevice *pRootDevice1;
82+
ClDevice *pSubDevice10 = nullptr;
83+
ClDevice *pSubDevice11 = nullptr;
84+
};
85+
7486
} // namespace NEO

shared/source/memory_manager/unified_memory_manager.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@ SvmMapOperation *SVMAllocsManager::MapOperationsTracker::get(const void *regionP
7070
return &iter->second;
7171
}
7272

73-
void SVMAllocsManager::addInternalAllocationsToResidencyContainer(ResidencyContainer &residencyContainer, uint32_t requestedTypesMask) {
73+
void SVMAllocsManager::addInternalAllocationsToResidencyContainer(uint32_t rootDeviceIndex,
74+
ResidencyContainer &residencyContainer,
75+
uint32_t requestedTypesMask) {
7476
std::unique_lock<SpinLock> lock(mtx);
7577
for (auto &allocation : this->SVMAllocs.allocations) {
76-
if (allocation.second.memoryType & requestedTypesMask) {
77-
residencyContainer.push_back(allocation.second.gpuAllocation);
78+
if (!(allocation.second.memoryType & requestedTypesMask)) {
79+
continue;
80+
}
81+
if ((allocation.second.memoryType & InternalMemoryType::DEVICE_UNIFIED_MEMORY ||
82+
allocation.second.memoryType & InternalMemoryType::SHARED_UNIFIED_MEMORY) &&
83+
(static_cast<Device *>(allocation.second.device)->getRootDeviceIndex() != rootDeviceIndex)) {
84+
continue;
7885
}
86+
residencyContainer.push_back(allocation.second.gpuAllocation);
7987
}
8088
}
8189

shared/source/memory_manager/unified_memory_manager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ class SVMAllocsManager {
9696
void insertSvmMapOperation(void *regionSvmPtr, size_t regionSize, void *baseSvmPtr, size_t offset, bool readOnlyMap);
9797
void removeSvmMapOperation(const void *regionSvmPtr);
9898
SvmMapOperation *getSvmMapOperation(const void *regionPtr);
99-
void addInternalAllocationsToResidencyContainer(ResidencyContainer &residencyContainer, uint32_t requestedTypesMask);
99+
void addInternalAllocationsToResidencyContainer(uint32_t rootDeviceIndex,
100+
ResidencyContainer &residencyContainer,
101+
uint32_t requestedTypesMask);
100102
void makeInternalAllocationsResident(CommandStreamReceiver &commandStreamReceiver, uint32_t requestedTypesMask);
101103
void *createUnifiedAllocationWithDeviceStorage(uint32_t rootDeviceIndex, size_t size, const SvmAllocationProperties &svmProperties, const UnifiedMemoryProperties &unifiedMemoryProperties);
102104
void freeSvmAllocationWithDeviceStorage(SvmAllocationData *svmData);

shared/test/unit_test/encoders/test_encode_mi_flush_dw.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using EncodeMiFlushDWTest = testing::Test;
2020
HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithNoPostSyncThenPostSyncNotWriteIsSet) {
2121
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
2222
uint32_t pCmdBuffer[1024];
23-
MockGraphicsAllocation gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer));
23+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
2424
LinearStream stream(&gfxAllocation);
2525

2626
EncodeMiFlushDW<FamilyType>::programMiFlushDw(stream, 0, 0, false, false);
@@ -38,7 +38,7 @@ HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithNoPostSyncThe
3838
HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithPostSyncDataThenPostSyncDataIsSet) {
3939
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
4040
uint32_t pCmdBuffer[1024];
41-
MockGraphicsAllocation gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer));
41+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
4242
LinearStream stream(&gfxAllocation);
4343

4444
uint64_t address = 0x1000;
@@ -68,7 +68,7 @@ HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithPostSyncDataT
6868
HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithTimestampFaslseThenPostSyncDataTypeIsSet) {
6969
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
7070
uint32_t pCmdBuffer[1024];
71-
MockGraphicsAllocation gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer));
71+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
7272
LinearStream stream(&gfxAllocation);
7373

7474
uint64_t address = 0x1000;
@@ -97,7 +97,7 @@ HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithTimestampFasl
9797
HWTEST_F(EncodeMiFlushDWTest, GivenLinearStreamWhenCllaedEncodeWithTimestampTrueThenPostSyncDataTypeIsSet) {
9898
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
9999
uint32_t pCmdBuffer[1024];
100-
MockGraphicsAllocation gfxAllocation((void *)pCmdBuffer, sizeof(pCmdBuffer));
100+
MockGraphicsAllocation gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer));
101101
LinearStream stream(&gfxAllocation);
102102

103103
uint64_t address = 0x1000;

0 commit comments

Comments
 (0)