#include <rmm/mr/device/device_memory_resource.hpp>
#include <functional>
#include <iostream>
#include <memory>
#include <utility>
Go to the source code of this file.
|
template<typename Resource , typename UpstreamTuple , std::size_t... Indices, typename... Args> |
auto | rmm::mr::detail::make_resource_impl (UpstreamTuple const &upstreams, std::index_sequence< Indices... >, Args &&... args) |
| Converts a tuple into a parameter pack. More...
|
|
template<typename Resource , typename... Upstreams, typename... Args> |
auto | rmm::mr::detail::make_resource (std::tuple< std::shared_ptr< Upstreams >... > const &upstreams, Args &&... args) |
| Create a std::unique_ptr to a Resource with the given upstreams and arguments. More...
|
|
template<template< typename... > class Resource, typename... Upstreams, typename... Args> |
auto | rmm::mr::make_owning_wrapper (std::tuple< std::shared_ptr< Upstreams >... > upstreams, Args &&... args) |
| Constructs a resource of type Resource wrapped in an owning_wrapper using upstreams as the upstream resources and args as the additional parameters for the constructor of Resource . More...
|
|
template<template< typename > class Resource, typename Upstream , typename... Args> |
auto | rmm::mr::make_owning_wrapper (std::shared_ptr< Upstream > upstream, Args &&... args) |
| Additional convenience factory for owning_wrapper when Resource has only a single upstream resource. More...
|
|
◆ make_resource()
template<typename Resource , typename... Upstreams, typename... Args>
auto rmm::mr::detail::make_resource |
( |
std::tuple< std::shared_ptr< Upstreams >... > const & |
upstreams, |
|
|
Args &&... |
args |
|
) |
| |
Create a std::unique_ptr
to a Resource
with the given upstreams and arguments.
- Template Parameters
-
Resource | The resource type to create |
Upstreams | The types of the upstream resources |
Args | The types of the arguments to the resource's constructor |
- Parameters
-
upstreams | Tuple of std::shared_ptr s to the upstreams used by the wrapped resource, in the same order as expected by Resource s constructor. |
args | Function parameter pack of arguments to forward to the wrapped resource's constructor |
- Returns
- std::unique_ptr<Resource> A unique pointer to the created resource
◆ make_resource_impl()
template<typename Resource , typename UpstreamTuple , std::size_t... Indices, typename... Args>
auto rmm::mr::detail::make_resource_impl |
( |
UpstreamTuple const & |
upstreams, |
|
|
std::index_sequence< Indices... > |
, |
|
|
Args &&... |
args |
|
) |
| |
Converts a tuple into a parameter pack.
This helper function for make_resource allows passing the upstreams as a list of arguments to the Resource's constructor.
- Template Parameters
-
Resource | The resource type to create |
UpstreamTuple | A tuple of shared pointers of the types of the upstream resources |
Args | The types of the arguments to the resource's constructor |
- Parameters
-
upstreams | Tuple of std::shared_ptr s to the upstreams used by the wrapped resource, in the same order as expected by Resource s constructor. |
args | Function parameter pack of arguments to forward to the Resource's constructor |
- Returns
- std::unique_ptr<Resource> A unique pointer to the created resource.