Home
librmm
libucxx
ucxx
nightly (26.12)
nightly (26.12)
stable (26.10)
legacy (26.08)
Toggle main menu visibility
Loading...
Searching...
No Matches
include
rmm
mr
logging_resource_adaptor.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
#pragma once
6
7
#include <rmm/detail/export.hpp>
8
#include <rmm/mr/detail/logging_resource_adaptor_impl.hpp>
9
#include <
rmm/resource_ref.hpp
>
10
11
#include <cuda/memory_resource>
12
13
#include <initializer_list>
14
#include <ostream>
15
#include <string>
16
17
RMM_NAMESPACE_BEGIN
18
namespace
mr {
19
25
37
class
RMM_EXPORT
logging_resource_adaptor
38
:
public
cuda::mr::shared_resource<detail::logging_resource_adaptor_impl> {
39
using
shared_base = cuda::mr::shared_resource<detail::logging_resource_adaptor_impl>;
40
41
public
:
47
RMM_CONSTEXPR_FRIEND
void
get_property
(
logging_resource_adaptor
const
&,
48
cuda::mr::device_accessible)
noexcept
49
{
50
}
51
72
logging_resource_adaptor
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
73
std::string
const
& filename =
get_default_filename
(),
74
bool
auto_flush =
false
);
75
88
logging_resource_adaptor
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
89
std::ostream& stream,
90
bool
auto_flush =
false
);
91
104
logging_resource_adaptor
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
105
std::initializer_list<rapids_logger::sink_ptr> sinks,
106
bool
auto_flush =
false
);
107
111
[[nodiscard]]
rmm::device_async_resource_ref
get_upstream_resource
() const noexcept;
112
116
void
flush
();
117
123
[[nodiscard]] std::
string
header
() const;
124
132
static std::
string
get_default_filename
();
133
};
134
135
static_assert(cuda::
mr
::resource_with<
logging_resource_adaptor
, cuda::
mr
::device_accessible>,
136
"logging_resource_adaptor does not satisfy the cuda::mr::resource concept"
);
137
// end of group
139
}
// namespace mr
140
RMM_NAMESPACE_END
rmm::mr::logging_resource_adaptor::get_upstream_resource
rmm::device_async_resource_ref get_upstream_resource() const noexcept
rmm::device_async_resource_ref to the upstream resource
rmm::mr::logging_resource_adaptor::get_default_filename
static std::string get_default_filename()
Return the value of the environment variable RMM_LOG_FILE.
rmm::mr::logging_resource_adaptor::logging_resource_adaptor
logging_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::ostream &stream, bool auto_flush=false)
Construct a new logging resource adaptor using upstream to satisfy allocation requests and logging in...
rmm::mr::logging_resource_adaptor::flush
void flush()
Flush logger contents.
rmm::mr::logging_resource_adaptor::logging_resource_adaptor
logging_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::string const &filename=get_default_filename(), bool auto_flush=false)
Construct a new logging resource adaptor using upstream to satisfy allocation requests and logging in...
rmm::mr::logging_resource_adaptor::logging_resource_adaptor
logging_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::initializer_list< rapids_logger::sink_ptr > sinks, bool auto_flush=false)
Construct a new logging resource adaptor using upstream to satisfy allocation requests and logging in...
rmm::mr::logging_resource_adaptor::header
std::string header() const
Return the CSV header string.
rmm::mr::logging_resource_adaptor::get_property
friend void get_property(logging_resource_adaptor const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition
logging_resource_adaptor.hpp:47
rmm::device_async_resource_ref
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
Alias for a cuda::mr::resource_ref with the property cuda::mr::device_accessible.
Definition
resource_ref.hpp:30
rmm::mr
Memory Resource classes and adaptors.
resource_ref.hpp
Generated by
1.18.0