is_resource_adaptor.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <rmm/detail/cuda_memory_resource.hpp>
8 #include <rmm/detail/export.hpp>
9 
10 #include <cuda/std/type_traits>
11 
12 namespace RMM_NAMESPACE {
13 namespace mr {
14 
25 template <class Resource, class = void>
26 inline constexpr bool is_resource_adaptor = false;
27 
28 template <class Resource>
29 inline constexpr bool is_resource_adaptor<
30  Resource,
31  cuda::std::void_t<decltype(cuda::std::declval<Resource>().get_upstream_resource())>> =
32  rmm::detail::polyfill::resource<Resource>;
33  // end of group
35 } // namespace mr
36 } // namespace RMM_NAMESPACE
constexpr bool is_resource_adaptor
Concept to check whether a resource is a resource adaptor by checking for get_upstream_resource.
Definition: is_resource_adaptor.hpp:26