diff --git a/opencl/source/mem_obj/pipe.cpp b/opencl/source/mem_obj/pipe.cpp index 42a2d47244..b387201c08 100644 --- a/opencl/source/mem_obj/pipe.cpp +++ b/opencl/source/mem_obj/pipe.cpp @@ -24,7 +24,7 @@ Pipe::Pipe(Context *context, cl_uint maxPackets, const cl_pipe_properties *properties, void *memoryStorage, - GraphicsAllocation *gfxAllocation) + MultiGraphicsAllocation multiGraphicsAllocation) : MemObj(context, CL_MEM_OBJECT_PIPE, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()), @@ -33,7 +33,7 @@ Pipe::Pipe(Context *context, static_cast(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace), memoryStorage, nullptr, - gfxAllocation, + multiGraphicsAllocation.getDefaultGraphicsAllocation(), false, false, false), @@ -71,7 +71,10 @@ Pipe *Pipe::create(Context *context, break; } - pPipe = new (std::nothrow) Pipe(context, flags, packetSize, maxPackets, properties, memory->getUnderlyingBuffer(), memory); + auto multiGraphicsAllocation = MultiGraphicsAllocation(rootDeviceIndex); + multiGraphicsAllocation.addAllocation(memory); + + pPipe = new (std::nothrow) Pipe(context, flags, packetSize, maxPackets, properties, memory->getUnderlyingBuffer(), std::move(multiGraphicsAllocation)); if (!pPipe) { memoryManager->freeGraphicsMemory(memory); memory = nullptr; diff --git a/opencl/source/mem_obj/pipe.h b/opencl/source/mem_obj/pipe.h index 1d5b20a54d..40b2047b2b 100644 --- a/opencl/source/mem_obj/pipe.h +++ b/opencl/source/mem_obj/pipe.h @@ -38,7 +38,7 @@ class Pipe : public MemObj { cl_uint maxPackets, const cl_pipe_properties *properties, void *memoryStorage, - GraphicsAllocation *gfxAllocation); + MultiGraphicsAllocation multiGraphicsAllocation); cl_uint pipePacketSize; cl_uint pipeMaxPackets; diff --git a/opencl/test/unit_test/mocks/mock_pipe.h b/opencl/test/unit_test/mocks/mock_pipe.h index 6c5586f0d7..3f81c9125d 100644 --- a/opencl/test/unit_test/mocks/mock_pipe.h +++ b/opencl/test/unit_test/mocks/mock_pipe.h @@ -27,7 +27,7 @@ class MockPipeStorage { class MockPipe : public MockPipeStorage, public Pipe { public: - MockPipe(Context *context) : MockPipeStorage(), Pipe(context, 0, 1, 128, nullptr, &data, mockGfxAllocation) { + MockPipe(Context *context) : MockPipeStorage(), Pipe(context, 0, 1, 128, nullptr, &data, GraphicsAllocationHelper::toMultiGraphicsAllocation(mockGfxAllocation)) { } ~MockPipe() override { if (!getContext()) {