Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
internal_alloc.hpp File Reference

This file contains the methods to actually allocate memory. More...

#include "shambackends/MemPerfInfos.hpp"
#include "shambackends/USMPtrHolder.hpp"
#include "shambackends/details/BufferEventHandler.hpp"
+ Include dependency graph for internal_alloc.hpp:
+ This graph shows which files directly or indirectly include this file:

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>
void * sham::details::internal_alloc (size_t sz, const std::shared_ptr< DeviceScheduler > &dev_sched, std::optional< size_t > alignment)
 Allocate a USM pointer with at least the given size in bytes.
 
template<USMKindTarget target>
void sham::details::internal_free (void *usm_ptr, size_t sz, const std::shared_ptr< DeviceScheduler > &dev_sched)
 Free a USM pointer.
 
MemPerfInfos sham::details::get_mem_perf_info ()
 Retrieve the memory performance information.
 
std::string sham::details::log_mem_perf_info (const std::shared_ptr< DeviceScheduler > &dev_sched)
 
void sham::details::reset_mem_info_max ()
 Reset the memory information for the maximum allocated bytes.
 

Detailed Description

This file contains the methods to actually allocate memory.

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 internal_alloc.hpp.

Function Documentation

◆ get_mem_perf_info()

MemPerfInfos sham::details::get_mem_perf_info ( )

Retrieve the memory performance information.

Returns
A MemPerfInfos object containing the memory performance data.

Definition at line 123 of file internal_alloc.cpp.

+ Here is the call graph for this function:

◆ internal_alloc()

template<USMKindTarget target>
void * sham::details::internal_alloc ( size_t  sz,
const std::shared_ptr< DeviceScheduler > &  dev_sched,
std::optional< size_t >  alignment 
)

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

Parameters
szThe minimum size of the USM pointer in bytes.
dev_schedThe SYCL queue used to allocate the USM pointer.
alignmentThe alignment of the USM pointer (optional).
Returns
A pointer to the allocated USM memory.

Definition at line 178 of file internal_alloc.cpp.

◆ internal_free()

template<USMKindTarget target>
void sham::details::internal_free ( void *  usm_ptr,
size_t  sz,
const std::shared_ptr< DeviceScheduler > &  dev_sched 
)

Free a USM pointer.

Parameters
usm_ptrThe pointer to free.
szThe size of the USM pointer in bytes.
dev_schedThe SYCL queue used to free the USM pointer.

Definition at line 147 of file internal_alloc.cpp.

◆ log_mem_perf_info()

std::string sham::details::log_mem_perf_info ( const std::shared_ptr< DeviceScheduler > &  dev_sched)

Definition at line 131 of file internal_alloc.cpp.

◆ reset_mem_info_max()

void sham::details::reset_mem_info_max ( )

Reset the memory information for the maximum allocated bytes.

Definition at line 125 of file internal_alloc.cpp.

+ Here is the call graph for this function: