Skip to content

Commit 9147d4c

Browse files
Fix SyncBuffer page tables cloning
multiOsContextCapable param was hardcoded to false and page tables were not cloned to other SubDevices Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent c36c083 commit 9147d4c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -238,3 +238,12 @@ TEST(SyncBufferHandlerDeviceTest, GivenSubDeviceWhenAllocateSyncBufferIsCalledTw
238238

239239
EXPECT_EQ(testUsedBufferSize, syncBufferHandler->usedBufferSize);
240240
}
241+
242+
TEST(SyncBufferHandlerDeviceTest, givenMultipleSubDevicesWhenAllocatingSyncBufferThenClonePageTables) {
243+
UltDeviceFactory ultDeviceFactory{1, 2};
244+
auto rootDevice = ultDeviceFactory.rootDevices[0];
245+
rootDevice->allocateSyncBufferHandler();
246+
auto syncBufferHandler = reinterpret_cast<MockSyncBufferHandler *>(rootDevice->syncBufferHandler.get());
247+
248+
EXPECT_TRUE(syncBufferHandler->graphicsAllocation->storageInfo.cloningOfPageTables);
249+
}

shared/source/program/sync_buffer_handler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -29,7 +29,8 @@ void SyncBufferHandler::makeResident(CommandStreamReceiver &csr) {
2929
void SyncBufferHandler::allocateNewBuffer() {
3030
AllocationProperties allocationProperties{device.getRootDeviceIndex(), true, bufferSize,
3131
GraphicsAllocation::AllocationType::LINEAR_STREAM,
32-
false, false, device.getDeviceBitfield()};
32+
(device.getNumGenericSubDevices() > 1u), /* multiOsContextCapable */
33+
false, device.getDeviceBitfield()};
3334
graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties);
3435
UNRECOVERABLE_IF(graphicsAllocation == nullptr);
3536

0 commit comments

Comments
 (0)