Skip to content

Commit da92ae9

Browse files
committed
rebase errors and issues.
Signed-off-by: Garima Gupta <[email protected]>
1 parent 502557b commit da92ae9

File tree

3 files changed

+10
-55
lines changed

3 files changed

+10
-55
lines changed

sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#pragma once
1010

1111
#include <CL/sycl/detail/common.hpp>
12+
#include <CL/sycl/detail/context_impl.hpp>
1213
#include <CL/sycl/detail/sycl_mem_obj_allocator.hpp>
1314
#include <CL/sycl/detail/plugin.hpp>
1415
#include <CL/sycl/detail/sycl_mem_obj_i.hpp>
@@ -71,35 +72,8 @@ class SYCLMemObjT : public SYCLMemObjI {
7172
: SYCLMemObjT(/*SizeInBytes*/ 0, Props, std::move(Allocator)) {}
7273

7374
SYCLMemObjT(cl_mem MemObject, const context &SyclContext,
74-
<<<<<<< HEAD
7575
const size_t SizeInBytes, event AvailableEvent,
7676
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.
10377

10478
SYCLMemObjT(cl_mem MemObject, const context &SyclContext,
10579
event AvailableEvent,
@@ -201,26 +175,7 @@ class SYCLMemObjT : public SYCLMemObjI {
201175
// the memory object is allowed. This method is executed from child's
202176
// destructor. This cannot be done in SYCLMemObjT's destructor as child's
203177
// members must be alive.
204-
<<<<<<< HEAD
205178
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.
224179

225180
bool useHostPtr() {
226181
return has_property<property::buffer::use_host_ptr>() ||

sycl/source/detail/image_impl.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,26 +246,26 @@ image_impl<Dimensions>::image_impl(
246246
&(BaseT::MSizeInBytes), nullptr);
247247

248248
RT::PiMemImageFormat Format;
249-
getImageInfo(PI_IMAGE_INFO_FORMAT, Format);
249+
getImageInfo(Context, PI_IMAGE_INFO_FORMAT, Format);
250250
MOrder = detail::convertChannelOrder(Format.image_channel_order);
251251
MType = detail::convertChannelType(Format.image_channel_data_type);
252252
MNumChannels = getImageNumberChannels(MOrder);
253253

254-
getImageInfo(PI_IMAGE_INFO_ELEMENT_SIZE, MElementSize);
254+
getImageInfo(Context, PI_IMAGE_INFO_ELEMENT_SIZE, MElementSize);
255255
assert(getImageElementSize(MNumChannels, MType) == MElementSize);
256256

257-
getImageInfo(PI_IMAGE_INFO_ROW_PITCH, MRowPitch);
258-
getImageInfo(PI_IMAGE_INFO_SLICE_PITCH, MSlicePitch);
257+
getImageInfo(Context, PI_IMAGE_INFO_ROW_PITCH, MRowPitch);
258+
getImageInfo(Context, PI_IMAGE_INFO_SLICE_PITCH, MSlicePitch);
259259

260260
switch (Dimensions) {
261261
case 3:
262-
getImageInfo(PI_IMAGE_INFO_DEPTH, MRange[2]);
262+
getImageInfo(Context, PI_IMAGE_INFO_DEPTH, MRange[2]);
263263
// fall through
264264
case 2:
265-
getImageInfo(PI_IMAGE_INFO_HEIGHT, MRange[1]);
265+
getImageInfo(Context, PI_IMAGE_INFO_HEIGHT, MRange[1]);
266266
// fall through
267267
case 1:
268-
getImageInfo(PI_IMAGE_INFO_WIDTH, MRange[0]);
268+
getImageInfo(Context, PI_IMAGE_INFO_WIDTH, MRange[0]);
269269
}
270270
}
271271

sycl/source/detail/sycl_mem_obj_t.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SYCLMemObjT::SYCLMemObjT(cl_mem MemObject, const context &SyclContext,
3131

3232
RT::PiMem Mem = pi::cast<RT::PiMem>(MInteropMemObject);
3333
RT::PiContext Context = nullptr;
34-
const plugin_impl &Plugin = getPlugin();
34+
const plugin &Plugin = getPlugin();
3535
Plugin.call<PiApiKind::piMemGetInfo>(Mem, CL_MEM_CONTEXT, sizeof(Context),
3636
&Context, nullptr);
3737

@@ -75,7 +75,7 @@ void SYCLMemObjT::updateHostMemory() {
7575
releaseHostMem(MShadowCopy);
7676

7777
if (MOpenCLInterop) {
78-
const plugin_impl &Plugin = getPlugin();
78+
const plugin &Plugin = getPlugin();
7979
Plugin.call<PiApiKind::piMemRelease>(
8080
pi::cast<RT::PiMem>(MInteropMemObject));
8181
}

0 commit comments

Comments
 (0)