Skip to content

Commit 4abe4a9

Browse files
kgibalaCompute-Runtime-Automation
authored andcommitted
Add multiGraphicsAllocation to CSR
Related-To: NEO-5508 Signed-off-by: Krzysztof Gibala <[email protected]>
1 parent 7fdbf4f commit 4abe4a9

26 files changed

+266
-125
lines changed

level_zero/core/source/event/event.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ ze_result_t EventPoolImp::initialize(DriverHandle *driver, uint32_t numDevices,
7171
deviceBitfield};
7272
unifiedMemoryProperties.alignment = eventAlignment;
7373

74-
void *eventPoolPtr = driver->getMemoryManager()->createMultiGraphicsAllocation(rootDeviceIndices,
75-
unifiedMemoryProperties,
76-
*eventPoolAllocations);
74+
void *eventPoolPtr = driver->getMemoryManager()->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices,
75+
unifiedMemoryProperties,
76+
*eventPoolAllocations);
77+
7778
if (!eventPoolPtr) {
7879
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
7980
}

level_zero/core/test/unit_tests/sources/device/test_device.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "shared/test/common/mocks/mock_device.h"
1313
#include "shared/test/common/mocks/ult_device_factory.h"
1414

15+
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
1516
#include "test.h"
1617

1718
#include "level_zero/core/source/cmdqueue/cmdqueue_imp.h"
@@ -143,14 +144,6 @@ TEST_F(DeviceTest, givenEmptySVmAllocStorageWhenAllocateMemoryFromHostPtrThenVal
143144
neoDevice->getMemoryManager()->freeGraphicsMemory(allocation);
144145
}
145146

146-
struct MemoryManagerHostPointer : public NEO::OsAgnosticMemoryManager {
147-
MemoryManagerHostPointer(NEO::ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(const_cast<NEO::ExecutionEnvironment &>(executionEnvironment)) {}
148-
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties,
149-
const void *ptr) override {
150-
return nullptr;
151-
}
152-
};
153-
154147
struct DeviceHostPointerTest : public ::testing::Test {
155148
void SetUp() override {
156149
executionEnvironment = new NEO::ExecutionEnvironment();
@@ -159,16 +152,16 @@ struct DeviceHostPointerTest : public ::testing::Test {
159152
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(NEO::defaultHwInfo.get());
160153
}
161154

162-
memoryManager = new MemoryManagerHostPointer(*executionEnvironment);
163-
executionEnvironment->memoryManager.reset(memoryManager);
164-
165155
neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, rootDeviceIndex);
166156
std::vector<std::unique_ptr<NEO::Device>> devices;
167157
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
168158

169159
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
170160
driverHandle->initialize(std::move(devices));
171161

162+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->isMockHostMemoryManager = true;
163+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->forceFailureInAllocationWithHostPointer = true;
164+
172165
device = driverHandle->devices[0];
173166
}
174167
void TearDown() override {
@@ -178,7 +171,6 @@ struct DeviceHostPointerTest : public ::testing::Test {
178171
std::unique_ptr<Mock<L0::DriverHandleImp>> driverHandle;
179172
NEO::MockDevice *neoDevice = nullptr;
180173
L0::Device *device = nullptr;
181-
MemoryManagerHostPointer *memoryManager = nullptr;
182174
const uint32_t rootDeviceIndex = 1u;
183175
const uint32_t numRootDevices = 2u;
184176
};

level_zero/core/test/unit_tests/sources/event/test_event.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
*/
77

8+
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
89
#include "opencl/test/unit_test/mocks/mock_memory_operations_handler.h"
910
#include "test.h"
1011

@@ -319,15 +320,6 @@ TEST_F(EventPoolCreateMultiDevice, whenCreatingEventPoolWithNoDevicesThenEventPo
319320
EXPECT_EQ(allocation->getGraphicsAllocations().size(), 1u);
320321
}
321322

322-
struct MemoryManagerEventPoolCreateNegativeTest : public NEO::OsAgnosticMemoryManager {
323-
MemoryManagerEventPoolCreateNegativeTest(NEO::ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(const_cast<NEO::ExecutionEnvironment &>(executionEnvironment)) {}
324-
void *createMultiGraphicsAllocation(std::vector<uint32_t> &rootDeviceIndices,
325-
NEO::AllocationProperties &properties,
326-
NEO::MultiGraphicsAllocation &multiGraphicsAllocation) override {
327-
return nullptr;
328-
}
329-
};
330-
331323
struct EventPoolCreateNegativeTest : public ::testing::Test {
332324
void SetUp() override {
333325
executionEnvironment = new NEO::ExecutionEnvironment();
@@ -336,9 +328,6 @@ struct EventPoolCreateNegativeTest : public ::testing::Test {
336328
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(NEO::defaultHwInfo.get());
337329
}
338330

339-
memoryManager = new MemoryManagerEventPoolCreateNegativeTest(*executionEnvironment);
340-
executionEnvironment->memoryManager.reset(memoryManager);
341-
342331
std::vector<std::unique_ptr<NEO::Device>> devices;
343332
for (uint32_t i = 0; i < numRootDevices; i++) {
344333
neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, i);
@@ -347,6 +336,7 @@ struct EventPoolCreateNegativeTest : public ::testing::Test {
347336

348337
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
349338
driverHandle->initialize(std::move(devices));
339+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->isMockEventPoolCreateMemoryManager = true;
350340

351341
device = driverHandle->devices[0];
352342
}
@@ -357,7 +347,6 @@ struct EventPoolCreateNegativeTest : public ::testing::Test {
357347
std::unique_ptr<Mock<L0::DriverHandleImp>> driverHandle;
358348
NEO::MockDevice *neoDevice = nullptr;
359349
L0::Device *device = nullptr;
360-
MemoryManagerEventPoolCreateNegativeTest *memoryManager = nullptr;
361350
const uint32_t numRootDevices = 2u;
362351
};
363352

level_zero/core/test/unit_tests/sources/memory/test_memory.cpp

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -718,32 +718,6 @@ TEST(MemoryBitfieldTests, givenDeviceWithValidBitfieldWhenAllocatingSharedMemory
718718
ASSERT_EQ(result, ZE_RESULT_SUCCESS);
719719
}
720720

721-
class MockHostMemoryManager : public NEO::MockMemoryManager {
722-
public:
723-
MockHostMemoryManager(const NEO::ExecutionEnvironment &executionEnvironment) : NEO::MockMemoryManager(const_cast<NEO::ExecutionEnvironment &>(executionEnvironment)){};
724-
725-
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) override {
726-
allocateGraphicsMemoryWithPropertiesCount++;
727-
if (forceFailureInPrimaryAllocation) {
728-
return nullptr;
729-
}
730-
return NEO::MemoryManager::allocateGraphicsMemoryWithProperties(properties);
731-
}
732-
733-
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties,
734-
const void *ptr) override {
735-
allocateGraphicsMemoryWithPropertiesCount++;
736-
if (forceFailureInAllocationWithHostPointer) {
737-
return nullptr;
738-
}
739-
return NEO::MemoryManager::allocateGraphicsMemoryWithProperties(properties, ptr);
740-
}
741-
742-
uint32_t allocateGraphicsMemoryWithPropertiesCount = 0;
743-
bool forceFailureInPrimaryAllocation = false;
744-
bool forceFailureInAllocationWithHostPointer = false;
745-
};
746-
747721
struct AllocHostMemoryTest : public ::testing::Test {
748722
void SetUp() override {
749723
std::vector<std::unique_ptr<NEO::Device>> devices;
@@ -758,29 +732,26 @@ struct AllocHostMemoryTest : public ::testing::Test {
758732
executionEnvironment, i)));
759733
}
760734

761-
memoryManager = new MockHostMemoryManager(*devices[0].get()->getExecutionEnvironment());
762-
devices[0].get()->getExecutionEnvironment()->memoryManager.reset(memoryManager);
763-
764735
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
765736
driverHandle->initialize(std::move(devices));
766737
}
767738

768739
DebugManagerStateRestore restorer;
769740
std::unique_ptr<Mock<L0::DriverHandleImp>> driverHandle;
770-
MockHostMemoryManager *memoryManager = nullptr;
771741
const uint32_t numRootDevices = 2u;
772742
};
773743

774744
TEST_F(AllocHostMemoryTest,
775745
whenCallingAllocHostMemThenAllocateGraphicsMemoryWithPropertiesIsCalledTheNumberOfTimesOfRootDevices) {
776746
void *ptr = nullptr;
777747

778-
memoryManager->allocateGraphicsMemoryWithPropertiesCount = 0;
748+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->isMockHostMemoryManager = true;
749+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount = 0;
779750

780751
ze_host_mem_alloc_desc_t hostDesc = {};
781752
ze_result_t result = driverHandle->allocHostMem(&hostDesc,
782753
4096u, 0u, &ptr);
783-
EXPECT_EQ(memoryManager->allocateGraphicsMemoryWithPropertiesCount, numRootDevices);
754+
EXPECT_EQ(static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount, numRootDevices);
784755
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
785756
EXPECT_NE(nullptr, ptr);
786757

@@ -790,33 +761,35 @@ TEST_F(AllocHostMemoryTest,
790761
TEST_F(AllocHostMemoryTest,
791762
whenCallingAllocHostMemAndFailingOnCreatingGraphicsAllocationThenNullIsReturned) {
792763

793-
memoryManager->forceFailureInPrimaryAllocation = true;
764+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->isMockHostMemoryManager = true;
765+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->forceFailureInPrimaryAllocation = true;
794766

795767
void *ptr = nullptr;
796768

797-
memoryManager->allocateGraphicsMemoryWithPropertiesCount = 0;
769+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount = 0;
798770

799771
ze_host_mem_alloc_desc_t hostDesc = {};
800772
ze_result_t result = driverHandle->allocHostMem(&hostDesc,
801773
4096u, 0u, &ptr);
802-
EXPECT_EQ(memoryManager->allocateGraphicsMemoryWithPropertiesCount, 1u);
774+
EXPECT_EQ(static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount, 1u);
803775
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY, result);
804776
EXPECT_EQ(nullptr, ptr);
805777
}
806778

807779
TEST_F(AllocHostMemoryTest,
808780
whenCallingAllocHostMemAndFailingOnCreatingGraphicsAllocationWithHostPointerThenNullIsReturned) {
809781

810-
memoryManager->forceFailureInAllocationWithHostPointer = true;
782+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->isMockHostMemoryManager = true;
783+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->forceFailureInAllocationWithHostPointer = true;
811784

812785
void *ptr = nullptr;
813786

814-
memoryManager->allocateGraphicsMemoryWithPropertiesCount = 0;
787+
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount = 0;
815788

816789
ze_host_mem_alloc_desc_t hostDesc = {};
817790
ze_result_t result = driverHandle->allocHostMem(&hostDesc,
818791
4096u, 0u, &ptr);
819-
EXPECT_EQ(memoryManager->allocateGraphicsMemoryWithPropertiesCount, numRootDevices);
792+
EXPECT_EQ(static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->allocateGraphicsMemoryWithPropertiesCount, numRootDevices);
820793
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY, result);
821794
EXPECT_EQ(nullptr, ptr);
822795
}

opencl/test/unit_test/api/cl_create_buffer_tests.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -514,34 +514,16 @@ INSTANTIATE_TEST_CASE_P(
514514
clCreateBufferWithMultiDeviceContextTests,
515515
testing::ValuesIn(validFlagsForMultiDeviceContextBuffer));
516516

517-
class MockMemoryManagerWithFailures2 : public OsAgnosticMemoryManager {
518-
public:
519-
MockMemoryManagerWithFailures2(ExecutionEnvironment &executionEnvironment) : OsAgnosticMemoryManager(executionEnvironment){};
520-
521-
GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override {
522-
if (allocationData.rootDeviceIndex == forbiddenRootDeviceIndex) {
523-
return nullptr;
524-
}
525-
return OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(allocationData, status);
526-
}
527-
uint32_t forbiddenRootDeviceIndex = 1u;
528-
};
529-
530517
using clCreateBufferWithMultiDeviceContextFaillingAllocationTests = clCreateBufferTemplateTests;
531518

532519
TEST_F(clCreateBufferWithMultiDeviceContextFaillingAllocationTests, GivenContextdWithMultiDeviceFailingAllocationThenBufferAllocateFails) {
533520
UltClDeviceFactory deviceFactory{3, 0};
534521
DebugManager.flags.EnableMultiRootDeviceContexts.set(true);
535522

536-
auto mockMemoryManager = new MockMemoryManagerWithFailures2(*deviceFactory.rootDevices[0]->getExecutionEnvironment());
537-
deviceFactory.rootDevices[0]->injectMemoryManager(mockMemoryManager);
538-
539523
cl_device_id devices[] = {deviceFactory.rootDevices[0], deviceFactory.rootDevices[1], deviceFactory.rootDevices[2]};
540524

541525
MockContext pContext(ClDeviceVector(devices, 3));
542526

543-
pContext.memoryManager = mockMemoryManager;
544-
545527
EXPECT_EQ(2u, pContext.getMaxRootDeviceIndex());
546528

547529
constexpr auto bufferSize = 64u;
@@ -551,6 +533,9 @@ TEST_F(clCreateBufferWithMultiDeviceContextFaillingAllocationTests, GivenContext
551533

552534
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
553535

536+
static_cast<MockMemoryManager *>(pContext.memoryManager)->successAllocatedGraphicsMemoryIndex = 0u;
537+
static_cast<MockMemoryManager *>(pContext.memoryManager)->maxSuccessAllocatedGraphicsMemoryIndex = 2u;
538+
554539
auto buffer = clCreateBuffer(&pContext, flags, bufferSize, ptrHostBuffer, &retVal);
555540
ASSERT_EQ(CL_OUT_OF_HOST_MEMORY, retVal);
556541
EXPECT_EQ(nullptr, buffer);

opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ TEST(clUnifiedSharedMemoryTests, whenClHostMemAllocINTELisCalledWithoutContextTh
2727

2828
TEST(clUnifiedSharedMemoryTests, whenClHostMemAllocIntelIsCalledThenItAllocatesHostUnifiedMemoryAllocation) {
2929
MockContext mockContext;
30+
auto device = mockContext.getDevice(0u);
31+
REQUIRE_SVM_OR_SKIP(device);
32+
3033
cl_int retVal = CL_SUCCESS;
3134
auto unifiedMemoryHostAllocation = clHostMemAllocINTEL(&mockContext, nullptr, 4, 0, &retVal);
3235
EXPECT_EQ(CL_SUCCESS, retVal);
@@ -172,6 +175,9 @@ TEST(clUnifiedSharedMemoryTests, whenClMemBlockingFreeINTELisCalledWithNullPoint
172175

173176
TEST(clUnifiedSharedMemoryTests, whenClMemFreeINTELisCalledWithValidUmPointerThenMemoryIsFreed) {
174177
MockContext mockContext;
178+
auto device = mockContext.getDevice(0u);
179+
REQUIRE_SVM_OR_SKIP(device);
180+
175181
cl_int retVal = CL_SUCCESS;
176182
auto unifiedMemoryHostAllocation = clHostMemAllocINTEL(&mockContext, nullptr, 4, 0, &retVal);
177183

@@ -186,6 +192,9 @@ TEST(clUnifiedSharedMemoryTests, whenClMemFreeINTELisCalledWithValidUmPointerThe
186192

187193
TEST(clUnifiedSharedMemoryTests, whenClMemFreeINTELisCalledWithInvalidUmPointerThenMemoryIsNotFreed) {
188194
MockContext mockContext;
195+
auto device = mockContext.getDevice(0u);
196+
REQUIRE_SVM_OR_SKIP(device);
197+
189198
cl_int retVal = CL_SUCCESS;
190199
auto unifiedMemoryHostAllocation = clHostMemAllocINTEL(&mockContext, nullptr, 4, 0, &retVal);
191200

@@ -276,6 +285,9 @@ TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocInfoINTELisCalledWithAllocatio
276285

277286
TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocInfoINTELisCalledWithValidUnifiedMemoryHostAllocationThenProperFieldsAreSet) {
278287
MockContext mockContext;
288+
auto device = mockContext.getDevice(0u);
289+
REQUIRE_SVM_OR_SKIP(device);
290+
279291
cl_int retVal = CL_SUCCESS;
280292
size_t paramValueSize = sizeof(cl_int);
281293
cl_int paramValue = 0;
@@ -308,6 +320,9 @@ TEST(clUnifiedSharedMemoryTests, whenHostMemAllocWithInvalidPropertiesTokenThenE
308320

309321
TEST(clUnifiedSharedMemoryTests, whenHostMemAllocWithInvalidWriteCombinedTokenThenSuccessIsReturned) {
310322
MockContext mockContext;
323+
auto device = mockContext.getDevice(0u);
324+
REQUIRE_SVM_OR_SKIP(device);
325+
311326
cl_int retVal = CL_SUCCESS;
312327
cl_mem_properties_intel properties[] = {CL_MEM_ALLOC_FLAGS_INTEL, CL_MEM_ALLOC_WRITE_COMBINED_INTEL, 0};
313328

@@ -360,6 +375,9 @@ TEST(clUnifiedSharedMemoryTests, whenSharedMemAllocWithInvalidWriteCombinedToken
360375
TEST(clUnifiedSharedMemoryTests, givenUnifiedMemoryAllocWithoutPropertiesWhenGetMemAllocFlagsThenDefaultValueIsReturned) {
361376
uint64_t defaultValue = CL_MEM_ALLOC_DEFAULT_INTEL;
362377
MockContext mockContext;
378+
auto device = mockContext.getDevice(0u);
379+
REQUIRE_SVM_OR_SKIP(device);
380+
363381
cl_int retVal = CL_SUCCESS;
364382
size_t paramValueSize = sizeof(cl_mem_properties_intel);
365383
cl_mem_properties_intel paramValue = 0;
@@ -377,6 +395,9 @@ TEST(clUnifiedSharedMemoryTests, givenUnifiedMemoryAllocWithoutPropertiesWhenGet
377395

378396
TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocTypeIsCalledWithValidUnifiedMemoryHostAllocationThenProperTypeIsReturned) {
379397
MockContext mockContext;
398+
auto device = mockContext.getDevice(0u);
399+
REQUIRE_SVM_OR_SKIP(device);
400+
380401
cl_int retVal = CL_SUCCESS;
381402
size_t paramValueSize = sizeof(cl_mem_properties_intel);
382403
cl_mem_properties_intel paramValue = 0;
@@ -533,6 +554,9 @@ TEST(clUnifiedSharedMemoryTests, givenSharedAllocationWithoutDeviceWhenItIsQueri
533554

534555
TEST(clUnifiedSharedMemoryTests, givenHostAllocationWhenItIsQueriedForDeviceThenProperDeviceIsReturned) {
535556
MockContext mockContext;
557+
auto device = mockContext.getDevice(0u);
558+
REQUIRE_SVM_OR_SKIP(device);
559+
536560
cl_int retVal = CL_SUCCESS;
537561
size_t paramValueSizeRet = 0;
538562
auto unifiedMemoryHostAllocation = clHostMemAllocINTEL(&mockContext, nullptr, 4, 0, &retVal);
@@ -573,6 +597,9 @@ TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocInfoINTELisCalledWithAllocatio
573597

574598
TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocInfoINTELisCalledWithAllocationSizeParamNameThenProperFieldsAreSet) {
575599
MockContext mockContext;
600+
auto device = mockContext.getDevice(0u);
601+
REQUIRE_SVM_OR_SKIP(device);
602+
576603
cl_int retVal = CL_SUCCESS;
577604
size_t paramValueSize = sizeof(size_t);
578605
size_t paramValue = 0;
@@ -1051,6 +1078,9 @@ TEST(clUnifiedSharedMemoryTests, givenUnifiedMemoryAllocationSizeGreaterThanMaxM
10511078
using MultiRootDeviceClUnifiedSharedMemoryTests = MultiRootDeviceFixture;
10521079

10531080
TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClHostMemAllocIntelIsCalledInMultiRootDeviceEnvironmentThenItAllocatesHostUnifiedMemoryAllocations) {
1081+
REQUIRE_SVM_OR_SKIP(device1);
1082+
REQUIRE_SVM_OR_SKIP(device2);
1083+
10541084
cl_int retVal = CL_SUCCESS;
10551085
auto unifiedMemoryHostAllocation = clHostMemAllocINTEL(context.get(), nullptr, 4, 0, &retVal);
10561086

@@ -1085,6 +1115,9 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClHostMemAllocIntelIsCalle
10851115
}
10861116

10871117
TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClSharedMemAllocIntelIsCalledWithoutDeviceInMultiRootDeviceEnvironmentThenItAllocatesHostUnifiedMemoryAllocations) {
1118+
REQUIRE_SVM_OR_SKIP(device1);
1119+
REQUIRE_SVM_OR_SKIP(device2);
1120+
10881121
cl_int retVal = CL_SUCCESS;
10891122
auto unifiedMemorySharedAllocation = clSharedMemAllocINTEL(context.get(), nullptr, nullptr, 4, 0, &retVal);
10901123

@@ -1118,6 +1151,9 @@ TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClSharedMemAllocIntelIsCal
11181151
EXPECT_EQ(CL_SUCCESS, retVal);
11191152
}
11201153
TEST_F(MultiRootDeviceClUnifiedSharedMemoryTests, WhenClSharedMemAllocIntelIsCalledWithoutDeviceInMultiRootDeviceEnvironmentThenItWaitsForAllGpuAllocations) {
1154+
REQUIRE_SVM_OR_SKIP(device1);
1155+
REQUIRE_SVM_OR_SKIP(device2);
1156+
11211157
mockMemoryManager->waitAllocations.reset(new MultiGraphicsAllocation(2u));
11221158

11231159
cl_int retVal = CL_SUCCESS;

0 commit comments

Comments
 (0)