|
9 | 9 | #pragma once
|
10 | 10 |
|
11 | 11 | #include <CL/sycl/detail/common.hpp>
|
| 12 | +#include <CL/sycl/detail/context_impl.hpp> |
12 | 13 | #include <CL/sycl/detail/sycl_mem_obj_allocator.hpp>
|
13 | 14 | #include <CL/sycl/detail/plugin.hpp>
|
14 | 15 | #include <CL/sycl/detail/sycl_mem_obj_i.hpp>
|
@@ -71,35 +72,8 @@ class SYCLMemObjT : public SYCLMemObjI {
|
71 | 72 | : SYCLMemObjT(/*SizeInBytes*/ 0, Props, std::move(Allocator)) {}
|
72 | 73 |
|
73 | 74 | SYCLMemObjT(cl_mem MemObject, const context &SyclContext,
|
74 |
| -<<<<<<< HEAD |
75 | 75 | const size_t SizeInBytes, event AvailableEvent,
|
76 | 76 | unique_ptr_class<SYCLMemObjAllocator> Allocator);
|
77 |
| -======= |
78 |
| - const size_t SizeInBytes, event AvailableEvent) |
79 |
| - : MAllocator(), MProps(), |
80 |
| - MInteropEvent(detail::getSyclObjImpl(std::move(AvailableEvent))), |
81 |
| - MInteropContext(detail::getSyclObjImpl(SyclContext)), |
82 |
| - MInteropMemObject(MemObject), MOpenCLInterop(true), |
83 |
| - MHostPtrReadOnly(false), MNeedWriteBack(true), |
84 |
| - MSizeInBytes(SizeInBytes), MUserPtr(nullptr), MShadowCopy(nullptr), |
85 |
| - MUploadDataFunctor(nullptr), MSharedPtrStorage(nullptr) { |
86 |
| - if (MInteropContext->is_host()) |
87 |
| - throw cl::sycl::invalid_parameter_error( |
88 |
| - "Creation of interoperability memory object using host context is " |
89 |
| - "not allowed"); |
90 |
| - |
91 |
| - RT::PiMem Mem = pi::cast<RT::PiMem>(MInteropMemObject); |
92 |
| - RT::PiContext Context = nullptr; |
93 |
| - const plugin &Plugin = getPlugin(); |
94 |
| - Plugin.call<PiApiKind::piMemGetInfo>(Mem, CL_MEM_CONTEXT, sizeof(Context), |
95 |
| - &Context, nullptr); |
96 |
| - |
97 |
| - if (MInteropContext->getHandleRef() != Context) |
98 |
| - throw cl::sycl::invalid_parameter_error( |
99 |
| - "Input context must be the same as the context of cl_mem"); |
100 |
| - Plugin.call<PiApiKind::piMemRetain>(Mem); |
101 |
| - } |
102 |
| ->>>>>>> [SYCL][PI] Renamed plugin_impl to plugin class. |
103 | 77 |
|
104 | 78 | SYCLMemObjT(cl_mem MemObject, const context &SyclContext,
|
105 | 79 | event AvailableEvent,
|
@@ -201,26 +175,7 @@ class SYCLMemObjT : public SYCLMemObjI {
|
201 | 175 | // the memory object is allowed. This method is executed from child's
|
202 | 176 | // destructor. This cannot be done in SYCLMemObjT's destructor as child's
|
203 | 177 | // members must be alive.
|
204 |
| -<<<<<<< HEAD |
205 | 178 | void updateHostMemory();
|
206 |
| -======= |
207 |
| - void updateHostMemory() { |
208 |
| - if ((MUploadDataFunctor != nullptr) && MNeedWriteBack) |
209 |
| - MUploadDataFunctor(); |
210 |
| - |
211 |
| - // If we're attached to a memory record, process the deletion of the memory |
212 |
| - // record. We may get detached before we do this. |
213 |
| - if (MRecord) |
214 |
| - Scheduler::getInstance().removeMemoryObject(this); |
215 |
| - releaseHostMem(MShadowCopy); |
216 |
| - |
217 |
| - if (MOpenCLInterop) { |
218 |
| - const plugin &Plugin = getPlugin(); |
219 |
| - Plugin.call<PiApiKind::piMemRelease>( |
220 |
| - pi::cast<RT::PiMem>(MInteropMemObject)); |
221 |
| - } |
222 |
| - } |
223 |
| ->>>>>>> [SYCL][PI] Renamed plugin_impl to plugin class. |
224 | 179 |
|
225 | 180 | bool useHostPtr() {
|
226 | 181 | return has_property<property::buffer::use_host_ptr>() ||
|
|
0 commit comments