Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
internal_alloc.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
21
22namespace sham::details {
23
33 template<USMKindTarget target>
34 void *internal_alloc(
35 size_t sz,
36 const std::shared_ptr<DeviceScheduler> &dev_sched,
37 std::optional<size_t> alignment);
38
46 template<USMKindTarget target>
47 void internal_free(void *usm_ptr, size_t sz, const std::shared_ptr<DeviceScheduler> &dev_sched);
48
51 MemPerfInfos get_mem_perf_info();
52
53 std::string log_mem_perf_info(const std::shared_ptr<DeviceScheduler> &dev_sched);
54
56 void reset_mem_info_max();
57
58} // namespace sham::details
This file contains the declaration of the USMPtrHolder class.
void * 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.
void internal_free(void *usm_ptr, size_t sz, const std::shared_ptr< DeviceScheduler > &dev_sched)
Free a USM pointer.
MemPerfInfos get_mem_perf_info()
Retrieve the memory performance information.
void reset_mem_info_max()
Reset the memory information for the maximum allocated bytes.
This file contains the class definition for BufferEventHandler.