Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
memoryHandle.cpp File Reference
Include dependency graph for memoryHandle.cpp:

Go to the source code of this file.

Namespaces

namespace  sham
 namespace for backends this one is named only sham since shambackends is too long to write

Functions

template<USMKindTarget target>
USMPtrHolder< target > sham::details::create_usm_ptr (size_t size, std::shared_ptr< DeviceScheduler > dev_sched, std::optional< size_t > alignment=std::nullopt)
 Create a USM pointer with at least the given size in bytes.
template<USMKindTarget target>
void sham::details::release_usm_ptr (USMPtrHolder< target > &&usm_ptr_hold, details::BufferEventHandler &&events)
 Release a USM pointer.

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file memoryHandle.cpp.

Function Documentation

◆ create_usm_ptr()

template<USMKindTarget target>
USMPtrHolder< target > sham::details::create_usm_ptr ( size_t size,
std::shared_ptr< DeviceScheduler > dev_sched,
std::optional< size_t > alignment = std::nullopt )

Create a USM pointer with at least the given size in bytes.

Note
The USM pointer may have a larger allocation than the required size.
Todo
should be renamed to aquire_...
Template Parameters
targetThe target of the USM pointer.
Parameters
sizeThe size of the pointer in bytes.
dev_schedPointer to the device scheduler.
alignmentThe alignment of the USM pointer (optional).
Returns
USMPtrHolder<target> The newly created USM pointer.

Definition at line 30 of file memoryHandle.cpp.

Here is the call graph for this function:

◆ release_usm_ptr()

template<USMKindTarget target>
void sham::details::release_usm_ptr ( USMPtrHolder< target > && usm_ptr_hold,
details::BufferEventHandler && events )

Release a USM pointer.

Template Parameters
targetThe target of the USM pointer.
Parameters
usm_ptr_holdThe USM pointer holder to release.
eventsThe event handler to wait for completion.

Definition at line 47 of file memoryHandle.cpp.