cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
identify.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 #ifndef CUDA_GRAPH_API_WRAPPERS_ERROR_HPP_
7 #define CUDA_GRAPH_API_WRAPPERS_ERROR_HPP_
8 
9 #if CUDA_VERSION >= 10000
10 
11 #include "../error.hpp"
12 #include "../types.hpp"
13 
14 namespace cuda {
15 
16 namespace graph {
17 
18 namespace template_ {
19 
20 namespace detail_ {
21 
22 inline ::std::string identify(handle_t handle)
23 {
24  return "execution graph template " + cuda::detail_::ptr_as_hex(handle);
25 }
26 
27 inline ::std::string identify(handle_t handle, device::id_t device_id)
28 {
29  return identify(handle) + " on " + device::detail_::identify(device_id);
30 }
31 /*
32 
33 inline ::std::string identify(handle_t handle, context::handle_t context_handle)
34 {
35  return identify(handle) + " on " + context::detail_::identify(context_handle);
36 }
37 
38 inline ::std::string identify(handle_t handle, context::handle_t context_handle, device::id_t device_id)
39 {
40  return identify(handle) + " on " + context::detail_::identify(context_handle, device_id);
41 }
42 */
43 
44 } // namespace detail_
45 
46 } // namespace template_
47 
48 namespace instance {
49 
50 namespace detail_ {
51 
52 inline ::std::string identify(handle_t handle)
53 {
54  return "execution graph instance " + cuda::detail_::ptr_as_hex(handle);
55 }
56 
57 inline ::std::string identify(handle_t handle, device::id_t device_id)
58 {
59  return identify(handle) + " on " + device::detail_::identify(device_id);
60 }
61 
62 inline ::std::string identify(handle_t handle, context::handle_t context_handle)
63 {
64  return identify(handle) + " on " + context::detail_::identify(context_handle);
65 }
66 
67 inline ::std::string identify(handle_t handle, context::handle_t context_handle, device::id_t device_id)
68 {
69  return identify(handle) + " on " + context::detail_::identify(context_handle, device_id);
70 }
71 
72 } // namespace detail_
73 
74 } // namespace instance
75 
76 namespace node {
77 
78 namespace detail_ {
79 
80 inline ::std::string identify(handle_t handle)
81 {
82  return ::std::string("node with handle ") + ::cuda::detail_::ptr_as_hex(handle);
83 }
84 
85 inline ::std::string identify(handle_t node_handle, template_::handle_t graph_template_handle)
86 {
87  return identify(node_handle) + " in " + template_::detail_::identify(graph_template_handle);
88 }
89 
90 } // namespace detail_
91 
92 } // namespace node
93 
94 } // namespace graph
95 
96 } // namespace cuda
97 
98 #endif // CUDA_VERSION >= 10000
99 
100 #endif // CUDA_GRAPH_API_WRAPPERS_ERROR_HPP_
Definitions and functionality wrapping CUDA APIs.
Definition: array.hpp:22
CUdevice id_t
Numeric ID of a CUDA device used by the CUDA Runtime API.
Definition: types.hpp:850
CUarray handle_t
Raw CUDA driver handle for arrays (of any dimension)
Definition: array.hpp:34