Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
memoryHandle.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
48
49namespace sham::details {
50
65 template<USMKindTarget target>
66 USMPtrHolder<target> create_usm_ptr(
67 size_t size,
68 std::shared_ptr<DeviceScheduler> dev_sched,
69 std::optional<size_t> alignment = std::nullopt);
70
78 template<USMKindTarget target>
79 void release_usm_ptr(USMPtrHolder<target> &&usm_ptr_hold, details::BufferEventHandler &&events);
80
81} // namespace sham::details
This file contains the declaration of the USMPtrHolder class.
This file contains the methods to actually allocate memory.
void release_usm_ptr(USMPtrHolder< target > &&usm_ptr_hold, details::BufferEventHandler &&events)
Release a USM pointer.
USMPtrHolder< target > 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.
This file contains the class definition for BufferEventHandler.