diff --git a/rocclr/device/device.cpp b/rocclr/device/device.cpp index f4b3fb2a2b..f777a8a03f 100644 --- a/rocclr/device/device.cpp +++ b/rocclr/device/device.cpp @@ -430,8 +430,8 @@ amd::Memory* Device::CreateVirtualBuffer(amd::Context& device_context, void* vpt size_t offset = (reinterpret_cast
(vptr) - reinterpret_cast
(vaddr_base_obj->getSvmPtr())); - vaddr_sub_obj = new (device_context) amd::Buffer(*vaddr_base_obj, CL_MEM_VA_RANGE_AMD, offset, - size); + Context& ctx = vaddr_base_obj->getContext(); + vaddr_sub_obj = new (ctx) amd::Buffer(*vaddr_base_obj,CL_MEM_VA_RANGE_AMD, offset, size); // This curr_mem_obj->create() does not create an actual memory but stores the memory info // with given vptr on ROCr backend.