Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions level_zero/core/source/cmdlist/cmdlist_hw.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemAdvise(ze_device_hand
const void *ptr, size_t size,
ze_memory_advice_t advice) {

this->memAdviseOperations.push_back(MemAdviseOperation(hDevice, ptr, size, advice));
this->memAdviseOperations.emplace_back(hDevice, ptr, size, advice);

return ZE_RESULT_SUCCESS;
}
Expand All @@ -1355,10 +1355,19 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::executeMemAdvise(ze_device_han
ze_memory_advice_t advice) {

auto driverHandle = device->getDriverHandle();
auto callingNEODevice = device->getNEODevice();
auto allocData = driverHandle->getSvmAllocsManager()->getSVMAlloc(ptr);

if (!allocData) {
if (device->getNEODevice()->areSharedSystemAllocationsAllowed()) {
if (callingNEODevice->areSharedSystemAllocationsAllowed()) {

DeviceImp *targetDeviceImp = static_cast<DeviceImp *>((L0::Device::fromHandle(hDevice)));
auto targetNEODevice = targetDeviceImp->getNEODevice();

if (!targetNEODevice->areSharedSystemAllocationsAllowed()) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}

NEO::MemAdvise memAdviseOp = NEO::MemAdvise::invalidAdvise;

switch (advice) {
Expand All @@ -1384,10 +1393,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::executeMemAdvise(ze_device_han
return ZE_RESULT_SUCCESS;
}

DeviceImp *deviceImp = static_cast<DeviceImp *>((L0::Device::fromHandle(hDevice)));
auto unifiedMemoryManager = driverHandle->getSvmAllocsManager();

unifiedMemoryManager->sharedSystemMemAdvise(*deviceImp->getNEODevice(), memAdviseOp, ptr, size);
unifiedMemoryManager->sharedSystemMemAdvise(*callingNEODevice, *targetNEODevice, memAdviseOp, ptr, size);

return ZE_RESULT_SUCCESS;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ TEST_F(CommandListCreateTests, givenValidDeviceMemPtrWhenExecuteMemAdviseFailsTh
ASSERT_EQ(res, ZE_RESULT_SUCCESS);
}

TEST_F(CommandListCreateTests, givenValidSystemAlloctedPtrAndNotSharedSystemAllocationsAllowedWhenExecuteMemAdviseFailsThenReturnError) {
TEST_F(CommandListCreateTests, givenValidSystemAlloctedPtrAndNotSharedSystemAllocationsAllowedForTheCallingDeviceWhenExecuteMemAdviseFailsThenReturnError) {

DebugManagerStateRestore restorer;
debugManager.flags.EnableSharedSystemUsmSupport.set(1u);
Expand All @@ -261,6 +261,37 @@ TEST_F(CommandListCreateTests, givenValidSystemAlloctedPtrAndNotSharedSystemAllo
free(ptr);
}

TEST_F(CommandListCreateTests, givenValidSystemAlloctedPtrAndNotSharedSystemAllocationsAllowedForTheTargetDeviceWhenExecuteMemAdviseFailsThenReturnError) {

DebugManagerStateRestore restorer;
debugManager.flags.EnableSharedSystemUsmSupport.set(1u);
debugManager.flags.EnableRecoverablePageFaults.set(1u);

ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false));
ASSERT_NE(nullptr, commandList);

// Create a new device with modified capabilities
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), rootDeviceIndex);
MockDeviceImp targetDevice(neoMockDevice);

auto &hwInfo = *targetDevice.getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};

sharedSystemMemCapabilities = 0; // enables return false for Device::areSharedSystemAllocationsAllowed()

size_t size = 10;
void *ptr = nullptr;

ptr = malloc(size);
EXPECT_NE(nullptr, ptr);

auto res = commandList->executeMemAdvise(targetDevice.toHandle(), ptr, size, ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, res);

free(ptr);
}

TEST_F(CommandListCreateTests, givenValidDeviceMemPtrWhenAppendMemAdviseSuccedsThenMemAdviseOperationsGrows) {

size_t size = 10;
Expand Down
2 changes: 1 addition & 1 deletion shared/source/memory_manager/memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class MemoryManager {
virtual AllocationStatus registerLocalMemAlloc(GraphicsAllocation *allocation, uint32_t rootDeviceIndex);

virtual bool setMemAdvise(GraphicsAllocation *gfxAllocation, MemAdviseFlags flags, uint32_t rootDeviceIndex) { return true; }
virtual bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) { return true; }
virtual bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, Device &callingDevice, Device &targetDevice) { return true; }
virtual bool setMemPrefetch(GraphicsAllocation *gfxAllocation, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) { return true; }
virtual bool prefetchSharedSystemAlloc(const void *ptr, const size_t size, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) { return true; }
virtual bool setAtomicAccess(GraphicsAllocation *gfxAllocation, size_t size, AtomicAccessMode mode, uint32_t rootDeviceIndex) { return true; }
Expand Down
7 changes: 2 additions & 5 deletions shared/source/memory_manager/unified_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,9 @@ static NEO::SubDeviceIdsVec getSubDeviceIds(CommandStreamReceiver &csr) {
return subDeviceIds;
};

void SVMAllocsManager::sharedSystemMemAdvise(Device &device, MemAdvise memAdviseOp, const void *ptr, const size_t size) {
void SVMAllocsManager::sharedSystemMemAdvise(Device &callingDevice, Device &targetDevice, MemAdvise memAdviseOp, const void *ptr, const size_t size) {

// All vm_ids on a single device for shared system USM allocation
auto subDeviceIds = NEO::SubDevice::getSubDeviceIdsFromDevice(device);

memoryManager->setSharedSystemMemAdvise(ptr, size, memAdviseOp, subDeviceIds, device.getRootDeviceIndex());
memoryManager->setSharedSystemMemAdvise(ptr, size, memAdviseOp, callingDevice, targetDevice);
}

void SVMAllocsManager::prefetchMemory(Device &device, CommandStreamReceiver &commandStreamReceiver, const void *ptr, const size_t size) {
Expand Down
2 changes: 1 addition & 1 deletion shared/source/memory_manager/unified_memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class SVMAllocsManager {
std::atomic<uint32_t> allocationsCounter = 0;
MOCKABLE_VIRTUAL void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, TaskCountType taskCount);
void prepareIndirectAllocationForDestruction(SvmAllocationData *allocationData, bool isNonBlockingFree);
void sharedSystemMemAdvise(Device &device, MemAdvise memAdviseOp, const void *ptr, const size_t size);
void sharedSystemMemAdvise(Device &callingDevice, Device &targetDevice, MemAdvise memAdviseOp, const void *ptr, const size_t size);
MOCKABLE_VIRTUAL void prefetchMemory(Device &device, CommandStreamReceiver &commandStreamReceiver, const void *ptr, const size_t size);
void prefetchSVMAllocs(Device &device, CommandStreamReceiver &commandStreamReceiver);
void sharedSystemAtomicAccess(Device &device, AtomicAccessMode mode, const void *ptr, const size_t size);
Expand Down
23 changes: 15 additions & 8 deletions shared/source/os_interface/linux/drm_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,29 @@ bool DrmMemoryManager::setMemAdvise(GraphicsAllocation *gfxAllocation, MemAdvise
return drmAllocation->setMemAdvise(&this->getDrm(rootDeviceIndex), flags);
}

bool DrmMemoryManager::setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) {
bool DrmMemoryManager::setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, Device &callingDevice, Device &targetDevice) {

auto &drm = this->getDrm(rootDeviceIndex);
auto ioctlHelper = drm.getIoctlHelper();
auto &targetDeviceDrm = this->getDrm(targetDevice.getRootDeviceIndex());
auto targetDeviceIoctlHelper = targetDeviceDrm.getIoctlHelper();
auto targetDeviceFd = targetDeviceDrm.getFileDescriptor();

uint32_t attribute = ioctlHelper->getPreferredLocationAdvise();
uint64_t param = ioctlHelper->getPreferredLocationArgs(memAdviseOp);
uint32_t attribute = targetDeviceIoctlHelper->getPreferredLocationAdvise();
uint64_t param = targetDeviceIoctlHelper->getPreferredLocationArgs(targetDeviceFd, memAdviseOp);

// Apply the shared system USM IOCTL to all the VMs of the device
// All vm_ids on a single device for shared system USM allocation
auto subDeviceIds = NEO::SubDevice::getSubDeviceIdsFromDevice(targetDevice);

// Need to apply the shared system USM IOCTL to all the VMs of the device
std::vector<uint32_t> vmIds;
vmIds.reserve(subDeviceIds.size());
for (auto subDeviceId : subDeviceIds) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be error prone that we pass targetDeviceDrm and subdevices seperatly, can you pass targetDevice and wihin this function extract sub device ids , this way the potential mismatch would be not possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!!!

vmIds.push_back(drm.getVirtualMemoryAddressSpace(subDeviceId));
vmIds.push_back(targetDeviceDrm.getVirtualMemoryAddressSpace(subDeviceId));
}

auto result = ioctlHelper->setVmSharedSystemMemAdvise(reinterpret_cast<uint64_t>(ptr), size, attribute, param, vmIds);
auto &callingDeviceDrm = this->getDrm(callingDevice.getRootDeviceIndex());
auto callingDeviceIoctlHelper = callingDeviceDrm.getIoctlHelper();

auto result = callingDeviceIoctlHelper->setVmSharedSystemMemAdvise(reinterpret_cast<uint64_t>(ptr), size, attribute, param, vmIds);

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion shared/source/os_interface/linux/drm_memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class DrmMemoryManager : public MemoryManager {
bool isKmdMigrationAvailable(uint32_t rootDeviceIndex) override;

bool setMemAdvise(GraphicsAllocation *gfxAllocation, MemAdviseFlags flags, uint32_t rootDeviceIndex) override;
bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) override;
bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, Device &callingDevice, Device &targetDevice) override;
bool setMemPrefetch(GraphicsAllocation *gfxAllocation, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) override;
bool prefetchSharedSystemAlloc(const void *ptr, const size_t size, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) override;
bool setAtomicAccess(GraphicsAllocation *gfxAllocation, size_t size, AtomicAccessMode mode, uint32_t rootDeviceIndex) override;
Expand Down
6 changes: 3 additions & 3 deletions shared/source/os_interface/linux/ioctl_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class IoctlHelper {
bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) = 0;
virtual uint32_t getAtomicAdvise(bool isNonAtomic) = 0;
virtual uint32_t getAtomicAccess(AtomicAccessMode mode) = 0;
virtual uint64_t getPreferredLocationArgs(MemAdvise memAdviseOp) = 0;
virtual uint64_t getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) = 0;
virtual uint32_t getPreferredLocationAdvise() = 0;
virtual std::optional<MemoryClassInstance> getPreferredLocationRegion(PreferredLocation memoryLocation, uint32_t memoryInstance) = 0;
virtual bool setVmBoAdvise(int32_t handle, uint32_t attribute, void *region) = 0;
Expand Down Expand Up @@ -328,7 +328,7 @@ class IoctlHelperUpstream : public IoctlHelperI915 {
bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) override;
uint32_t getAtomicAdvise(bool isNonAtomic) override;
uint32_t getAtomicAccess(AtomicAccessMode mode) override;
uint64_t getPreferredLocationArgs(MemAdvise memAdviseOp) override;
uint64_t getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) override;
uint32_t getPreferredLocationAdvise() override;
std::optional<MemoryClassInstance> getPreferredLocationRegion(PreferredLocation memoryLocation, uint32_t memoryInstance) override;
bool setVmBoAdvise(int32_t handle, uint32_t attribute, void *region) override;
Expand Down Expand Up @@ -404,7 +404,7 @@ class IoctlHelperPrelim20 : public IoctlHelperI915 {
bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) override;
uint32_t getAtomicAdvise(bool isNonAtomic) override;
uint32_t getAtomicAccess(AtomicAccessMode mode) override;
uint64_t getPreferredLocationArgs(MemAdvise memAdviseOp) override;
uint64_t getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) override;
uint32_t getPreferredLocationAdvise() override;
std::optional<MemoryClassInstance> getPreferredLocationRegion(PreferredLocation memoryLocation, uint32_t memoryInstance) override;
bool setVmBoAdvise(int32_t handle, uint32_t attribute, void *region) override;
Expand Down
2 changes: 1 addition & 1 deletion shared/source/os_interface/linux/ioctl_helper_prelim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ uint32_t IoctlHelperPrelim20::getAtomicAdvise(bool isNonAtomic) {
return isNonAtomic ? PRELIM_I915_VM_ADVISE_ATOMIC_NONE : PRELIM_I915_VM_ADVISE_ATOMIC_SYSTEM;
}

uint64_t IoctlHelperPrelim20::getPreferredLocationArgs(MemAdvise memAdviseOp) {
uint64_t IoctlHelperPrelim20::getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) {
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion shared/source/os_interface/linux/ioctl_helper_upstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ uint32_t IoctlHelperUpstream::getAtomicAccess(AtomicAccessMode mode) {
return 0;
}

uint64_t IoctlHelperUpstream::getPreferredLocationArgs(MemAdvise memAdviseOp) {
uint64_t IoctlHelperUpstream::getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) {
return 0;
}

Expand Down
20 changes: 14 additions & 6 deletions shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,24 +794,30 @@ uint32_t IoctlHelperXe::getAtomicAccess(AtomicAccessMode mode) {
return retVal;
}

uint64_t IoctlHelperXe::getPreferredLocationArgs(MemAdvise memAdviseOp) {
uint64_t IoctlHelperXe::getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) {
xeLog(" -> IoctlHelperXe::%s\n", __FUNCTION__);
uint64_t param = 0;

switch (memAdviseOp) {
case MemAdvise::setPreferredLocation:
case MemAdvise::clearPreferredLocation:

case MemAdvise::clearSystemMemoryPreferredLocation: {
// Assumes that the default location is Device VRAM.
const auto preferredLocation = static_cast<uint64_t>(getDrmParamValue(DrmParam::memoryAdviseLocationDevice));
const auto policy = static_cast<uint64_t>(getDrmParamValue(DrmParam::memoryAdviseMigrationPolicyAllPages));
param = (preferredLocation << 32) | policy;
const auto regionInstance = static_cast<uint64_t>(0);
param = (preferredLocation << 32) | (policy << 16) | regionInstance;
} break;
case MemAdvise::setPreferredLocation: {
const auto preferredLocation = static_cast<uint64_t>(deviceFd);
const auto policy = static_cast<uint64_t>(getDrmParamValue(DrmParam::memoryAdviseMigrationPolicyAllPages));
const auto regionInstance = static_cast<uint64_t>(1);
param = (preferredLocation << 32) | (policy << 16) | regionInstance;
} break;
case MemAdvise::setSystemMemoryPreferredLocation: {
const auto preferredLocation = static_cast<uint64_t>(getDrmParamValue(DrmParam::memoryAdviseLocationSystem));
const auto policy = static_cast<uint64_t>(getDrmParamValue(DrmParam::memoryAdviseMigrationPolicySystemPages));
param = (preferredLocation << 32) | policy;
const auto regionInstance = static_cast<uint64_t>(0);
param = (preferredLocation << 32) | (policy << 16) | regionInstance;
} break;
default:
xeLog(" Invalid advise operation %s\n", __FUNCTION__);
Expand All @@ -837,10 +843,12 @@ bool IoctlHelperXe::setVmBoAdvise(int32_t handle, uint32_t attribute, void *regi
inline void setMemoryAdvisePreferredLocationParam(drm_xe_madvise &vmAdvise, const uint64_t param) {

uint32_t devmemFd = static_cast<uint32_t>(param >> 32);
uint16_t migrationPolicy = static_cast<uint16_t>(param & 0xFFFF);
uint16_t migrationPolicy = static_cast<uint16_t>((param >> 16) & 0xFFFF);
uint16_t regionInstance = static_cast<uint16_t>(param & 0xFFFF);

vmAdvise.preferred_mem_loc.devmem_fd = devmemFd;
vmAdvise.preferred_mem_loc.migration_policy = migrationPolicy;
vmAdvise.preferred_mem_loc.region_instance = regionInstance;
}

inline void setMemoryAdviseAtomicParam(drm_xe_madvise &vmAdvise, const uint64_t param) {
Expand Down
2 changes: 1 addition & 1 deletion shared/source/os_interface/linux/xe/ioctl_helper_xe.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class IoctlHelperXe : public IoctlHelper {
bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) override;
uint32_t getAtomicAdvise(bool isNonAtomic) override;
uint32_t getAtomicAccess(AtomicAccessMode mode) override;
uint64_t getPreferredLocationArgs(MemAdvise memAdviseOp) override;
uint64_t getPreferredLocationArgs(int deviceFd, MemAdvise memAdviseOp) override;
uint32_t getPreferredLocationAdvise() override;
std::optional<MemoryClassInstance> getPreferredLocationRegion(PreferredLocation memoryLocation, uint32_t memoryInstance) override;
bool setVmBoAdvise(int32_t handle, uint32_t attribute, void *region) override;
Expand Down
4 changes: 2 additions & 2 deletions shared/test/common/mocks/mock_memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
return MemoryManager::setMemAdvise(gfxAllocation, flags, rootDeviceIndex);
}

bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) override {
bool setSharedSystemMemAdvise(const void *ptr, const size_t size, MemAdvise memAdviseOp, Device &callingDevice, Device &targetDevice) override {
setSharedSystemMemAdviseCalledCount++;
setSharedSystemMemAdviseCalled = true;
if (failSetSharedSystemMemAdvise) {
return false;
}
return MemoryManager::setSharedSystemMemAdvise(ptr, size, memAdviseOp, subDeviceIds, rootDeviceIndex);
return MemoryManager::setSharedSystemMemAdvise(ptr, size, memAdviseOp, callingDevice, targetDevice);
}

bool setMemPrefetch(GraphicsAllocation *gfxAllocation, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) override {
Expand Down
5 changes: 3 additions & 2 deletions shared/test/unit_test/memory_manager/memory_manager_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ using namespace NEO;
TEST(MemoryManagerTest, WhenCallingSetSharedSystemMemAdviseThenReturnTrue) {
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
OsAgnosticMemoryManager memoryManager(executionEnvironment);
auto subDeviceId = SubDeviceIdsVec{0};
EXPECT_TRUE(memoryManager.setSharedSystemMemAdvise(nullptr, 0u, MemAdvise::invalidAdvise, subDeviceId, 0u));
MockDevice callingDevice;
MockDevice targetDevice;
EXPECT_TRUE(memoryManager.setSharedSystemMemAdvise(nullptr, 0u, MemAdvise::invalidAdvise, callingDevice, targetDevice));
}

TEST(MemoryManagerTest, WhenCallingSetSharedSystemAtomicAccessThenReturnTrue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenSharedSystemAllocationWhenSharedSystemM
auto ptr = malloc(4096);
EXPECT_NE(nullptr, ptr);

svmManager->sharedSystemMemAdvise(*device, memAdviseOp, ptr, 4096);
svmManager->sharedSystemMemAdvise(*device, *device, memAdviseOp, ptr, 4096);

auto mockMemoryManager = static_cast<MockMemoryManager *>(device->getMemoryManager());
EXPECT_TRUE(mockMemoryManager->setSharedSystemMemAdviseCalled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6188,9 +6188,10 @@ HWTEST_TEMPLATED_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetSharedSyste
auto &drm = static_cast<DrmMockCustom &>(memoryManager.getDrm(mockRootDeviceIndex));
drm.ioctlHelper.reset(mockIoctlHelper);

auto subDeviceIds = NEO::SubDeviceIdsVec{0};
MockDevice callingDevice;
MockDevice targetDevice;
MemAdvise memAdviseOp = MemAdvise::setPreferredLocation;
EXPECT_TRUE(memoryManager.setSharedSystemMemAdvise(nullptr, 0u, memAdviseOp, subDeviceIds, 0u));
EXPECT_TRUE(memoryManager.setSharedSystemMemAdvise(nullptr, 0u, memAdviseOp, callingDevice, targetDevice));
EXPECT_EQ(1u, mockIoctlHelper->setVmSharedSystemMemAdviseCalled);
}

Expand Down
Loading