Home
libucxx
libucxx
ucxx
nightly (0.53)
nightly (0.53)
stable (0.52)
legacy (0.51)
Toggle main menu visibility
Loading...
Searching...
No Matches
include
ucxx
memory_handle.h
1
5
#pragma once
6
#include <memory>
7
#include <string>
8
#include <utility>
9
10
#include <ucp/api/ucp.h>
11
12
#include <ucxx/component.h>
13
#include <ucxx/context.h>
14
#include <ucxx/memory_handle_builder.h>
15
#include <ucxx/remote_key_builder.h>
16
17
namespace
ucxx
{
18
19
class
RemoteKey
;
20
28
class
MemoryHandle :
public
Component
{
29
private
:
30
ucp_mem_h _handle{};
31
size_t
_size{0};
32
uint64_t _baseAddress{0};
33
ucs_memory_type_t _memoryType{
34
UCS_MEMORY_TYPE_HOST};
35
56
MemoryHandle(std::shared_ptr<Context> context,
57
const
size_t
size,
58
void
* buffer,
59
const
ucs_memory_type_t memoryType);
60
61
public
:
62
MemoryHandle() =
delete
;
63
MemoryHandle(
const
MemoryHandle&) =
delete
;
64
MemoryHandle& operator=(MemoryHandle
const
&) =
delete
;
65
MemoryHandle(MemoryHandle&& o) =
delete
;
66
MemoryHandle& operator=(MemoryHandle&& o) =
delete
;
67
68
// Allow internal construction without exposing factory functions.
69
friend
class
detail::ConstructorFactory;
70
71
~MemoryHandle();
72
88
[[nodiscard]] ucp_mem_h
getHandle
();
89
103
[[nodiscard]]
size_t
getSize
()
const
;
104
119
[[nodiscard]] uint64_t
getBaseAddress
();
120
129
[[nodiscard]] ucs_memory_type_t
getMemoryType
();
130
139
[[nodiscard]]
RemoteKeyBuilder
remoteKeyBuilder
();
140
};
141
142
}
// namespace ucxx
ucxx::Component
A UCXX component class to prevent early destruction of parent object.
Definition
component.h:21
ucxx::MemoryHandle::getBaseAddress
uint64_t getBaseAddress()
Get the base address of the memory allocation.
ucxx::MemoryHandle::remoteKeyBuilder
RemoteKeyBuilder remoteKeyBuilder()
Create a builder for a remote key from this memory allocation.
ucxx::MemoryHandle::getHandle
ucp_mem_h getHandle()
Get the underlying ucp_mem_h handle.
ucxx::MemoryHandle::getSize
size_t getSize() const
Get the size of the memory allocation.
ucxx::MemoryHandle::getMemoryType
ucs_memory_type_t getMemoryType()
Get the memory type of the allocation.
ucxx::RemoteKeyBuilder
Builder class for constructing std::shared_ptr<ucxx::RemoteKey> objects.
Definition
remote_key_builder.h:25
ucxx::RemoteKey
Component holding a UCP rkey (remote key).
Definition
remote_key.h:39
ucxx
Definition
address.h:16
Generated by
1.18.0