diff --git a/opencl/source/mem_obj/mem_obj.cpp b/opencl/source/mem_obj/mem_obj.cpp index 7eae19b70e..d639432455 100644 --- a/opencl/source/mem_obj/mem_obj.cpp +++ b/opencl/source/mem_obj/mem_obj.cpp @@ -132,8 +132,8 @@ cl_int MemObj::getMemObjectInfo(cl_mem_info paramName, cl_mem clAssociatedMemObject = static_cast(this->associatedMemObject); cl_context ctx = nullptr; uint64_t internalHandle = 0llu; - auto allocation = getGraphicsAllocation(0); - cl_bool usesCompression = allocation && allocation->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED; + auto allocation = getMultiGraphicsAllocation().getDefaultGraphicsAllocation(); + cl_bool usesCompression = allocation->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED; switch (paramName) { case CL_MEM_TYPE: diff --git a/opencl/test/unit_test/mem_obj/get_mem_object_info_tests.cpp b/opencl/test/unit_test/mem_obj/get_mem_object_info_tests.cpp index b7a91281d1..f34ac9c8fb 100644 --- a/opencl/test/unit_test/mem_obj/get_mem_object_info_tests.cpp +++ b/opencl/test/unit_test/mem_obj/get_mem_object_info_tests.cpp @@ -327,7 +327,7 @@ TEST_F(GetMemObjectInfo, GivenMemReferenceCountWhenGettingMemObjectInfoThenCorre TEST_F(GetMemObjectInfo, GivenValidBufferWhenGettingCompressionOfMemObjectThenCorrectValueIsReturned) { auto buffer = std::unique_ptr(BufferHelper<>::create()); - auto graphicsAllocation = buffer->getGraphicsAllocation(0); + auto graphicsAllocation = buffer->getMultiGraphicsAllocation().getDefaultGraphicsAllocation(); size_t sizeReturned = 0; cl_bool usesCompression{};