17 inline namespace _V1 {
19 #ifdef XPTI_ENABLE_INSTRUMENTATION
20 uint8_t GBufferStreamID;
25 bool HostPtrReadOnly =
false;
29 "Internal error. Allocating memory on the host "
30 "while having use_host_ptr property");
32 std::move(Context),
this, HostPtr, HostPtrReadOnly,
37 void *UserObj,
const void *HostObj,
38 const void *Type, uint32_t Dim,
39 uint32_t ElemSize,
size_t Range[3]) {
41 Dim, ElemSize, Range);
49 std::vector<pi_native_handle> &Handles)
const {
51 if (std::find(Handles.begin(), Handles.end(),
62 std::vector<pi_native_handle>
64 std::vector<pi_native_handle> Handles{};
70 for (
auto &Cmd :
MRecord->MAllocaCommands) {
72 pi::cast<sycl::detail::pi::PiMem>(Cmd->getMemAllocation());
73 auto Ctx = Cmd->getWorkerContext();
74 auto Platform = Ctx->getPlatformImpl();
77 if (!Platform || (Platform->getBackend() != BackendName))
80 auto Plugin = Platform->getPlugin();
92 Handles.push_back(Handle);
static void * allocateMemBuffer(ContextImplPtr TargetContext, SYCLMemObjI *MemObj, void *UserPtr, bool HostPtrReadOnly, size_t Size, const EventImplPtr &InteropEvent, const ContextImplPtr &InteropContext, const sycl::property_list &PropsList, sycl::detail::pi::PiEvent &OutEventToWait)
std::shared_ptr< MemObjRecord > MRecord
const PluginPtr & getPlugin() const
ContextImplPtr MInteropContext
size_t getSizeInBytes() const noexcept override
void determineHostPtr(const ContextImplPtr &Context, bool InitFromUserData, void *&HostPtr, bool &HostPtrReadOnly)
sycl::detail::pi::PiMem MInteropMemObject
EventImplPtr MInteropEvent
static void bufferConstructorNotification(const void *, const detail::code_location &, const void *, const void *, uint32_t, uint32_t, size_t[3])
static void bufferDestructorNotification(const void *)
std::vector< pi_native_handle > getNativeVector(backend BackendName) const
void * allocateMem(ContextImplPtr Context, bool InitFromUserData, void *HostPtr, sycl::detail::pi::PiEvent &OutEventToWait) override
void destructorNotification(void *UserObj)
void constructorNotification(const detail::code_location &CodeLoc, void *UserObj, const void *HostObj, const void *Type, uint32_t Dim, uint32_t ElemType, size_t Range[3])
void addInteropObject(std::vector< pi_native_handle > &Handles) const
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
std::shared_ptr< plugin > PluginPtr
pi_result piextMemGetNativeHandle(pi_mem mem, pi_device dev, pi_native_handle *nativeHandle)
Gets the native handle of a PI mem object.
uintptr_t pi_native_handle
pi_result piMemRetain(pi_mem mem)