Skip to content

Commit 4bea0ee

Browse files
committed
Rebase conflict resolution errors and
Addition of a suggested change. Signed-off-by: Garima Gupta <[email protected]>
1 parent da92ae9 commit 4bea0ee

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ class SYCLMemObjT : public SYCLMemObjI {
8383

8484
virtual ~SYCLMemObjT() = default;
8585

86-
const plugin &getPlugin() const { return MInteropContext->getPlugin(); }
86+
const plugin &getPlugin() const {
87+
assert((MInteropContext != nullptr) &&
88+
"Trying to get Plugin from SYCLMemObjT with nullptr ContextImpl.");
89+
return (MInteropContext->getPlugin());
90+
}
8791
size_t getSize() const override { return MSizeInBytes; }
8892
size_t get_count() const {
8993
size_t AllocatorValueSize = MAllocator->getValueSize();

sycl/source/detail/usm/usm_impl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ alloc get_pointer_type(const void *Ptr, const context &Ctxt) {
250250
pi_usm_type AllocTy;
251251

252252
// query type using PI function
253-
PI_CALL(piextUSMGetMemAllocInfo)(PICtx, Ptr, PI_MEM_ALLOC_TYPE,
254-
sizeof(pi_usm_type), &AllocTy, nullptr);
253+
const detail::plugin &Plugin = CtxImpl->getPlugin();
254+
Plugin.call<detail::PiApiKind::piextUSMGetMemAllocInfo>(
255+
PICtx, Ptr, PI_MEM_ALLOC_TYPE, sizeof(pi_usm_type), &AllocTy, nullptr);
255256

256257
alloc ResultAlloc;
257258
switch (AllocTy) {
@@ -297,8 +298,9 @@ device get_pointer_device(const void *Ptr, const context &Ctxt) {
297298
pi_device DeviceId;
298299

299300
// query device using PI function
300-
PI_CALL(piextUSMGetMemAllocInfo)(PICtx, Ptr, PI_MEM_ALLOC_DEVICE,
301-
sizeof(pi_device), &DeviceId, nullptr);
301+
const detail::plugin &Plugin = CtxImpl->getPlugin();
302+
Plugin.call<detail::PiApiKind::piextUSMGetMemAllocInfo>(
303+
PICtx, Ptr, PI_MEM_ALLOC_DEVICE, sizeof(pi_device), &DeviceId, nullptr);
302304

303305
for (const device &Dev : CtxImpl->getDevices()) {
304306
// Try to find the real sycl device used in the context

0 commit comments

Comments
 (0)