gpu_params.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief a header for properties
7  * of shared device contexts and shared device memory blobs
8  * for clDNN plugin
9  *
10  * @file gpu_params.hpp
11  */
12 #pragma once
13 
14 #include <string>
15 
16 namespace InferenceEngine {
17 /**
18  * @brief Shortcut for defining a handle parameter
19  */
20 using gpu_handle_param = void*;
21 
22 namespace GPUContextParams {
23 /**
24  * @def GPU_PARAM_KEY(name)
25  * @brief Shortcut for defining configuration keys
26  */
27 #define GPU_PARAM_KEY(name) GPUContextParams::PARAM_##name
28 /**
29  * @def GPU_PARAM_VALUE(name)
30  * @brief Shortcut for defining configuration values
31  */
32 #define GPU_PARAM_VALUE(name) GPUContextParams::name
33 
34 /**
35  * @def DECLARE_GPU_PARAM__VALUE(name)
36  * @brief Shortcut for defining possible values for object parameter keys
37  */
38 #define DECLARE_GPU_PARAM__VALUE(name) static constexpr auto name = #name
39 
40 #ifndef DECLARE_PARAM_KEY_IMPL
41 # define DECLARE_PARAM_KEY_IMPL(...)
42 #endif
43 
44 /**
45  * @def DECLARE_GPU_PARAM_KEY(name, ...)
46  * @brief Shortcut for defining object parameter keys
47  */
48 #define DECLARE_GPU_PARAM_KEY(name, ...) \
49  static constexpr auto PARAM_##name = #name; \
50  DECLARE_PARAM_KEY_IMPL(name, __VA_ARGS__)
51 
52 /**
53 * @brief Shared device context type: can be either pure OpenCL (OCL)
54 * or shared video decoder (VA_SHARED) context
55 */
56 DECLARE_GPU_PARAM_KEY(CONTEXT_TYPE, std::string);
57 /**
58 * @brief Pure OpenCL device context
59 */
61 /**
62 * @brief Shared context (video decoder or D3D)
63 */
65 
66 /**
67 * @brief This key identifies OpenCL context handle
68 * in a shared context or shared memory blob parameter map
69 */
71 
72 /**
73 * @brief This key identifies video acceleration device/display handle
74 * in a shared context or shared memory blob parameter map
75 */
77 
78 /**
79 * @brief This key identifies type of internal shared memory
80 * in a shared memory blob parameter map.
81 */
82 DECLARE_GPU_PARAM_KEY(SHARED_MEM_TYPE, std::string);
83 /**
84 * @brief Shared OpenCL buffer blob
85 */
87 /**
88 * @brief Shared OpenCL 2D image blob
89 */
91 /**
92 * @brief Shared video decoder surface or D3D 2D texture blob
93 */
95 /**
96 * @brief Shared D3D buffer blob
97 */
99 
100 /**
101 * @brief This key identifies OpenCL memory handle
102 * in a shared memory blob parameter map
103 */
105 
106 /**
107 * @brief This key identifies video decoder surface handle
108 * in a shared memory blob parameter map
109 */
110 #ifdef WIN32
111 DECLARE_GPU_PARAM_KEY(DEV_OBJECT_HANDLE, gpu_handle_param);
112 #else
113 DECLARE_GPU_PARAM_KEY(DEV_OBJECT_HANDLE, uint32_t);
114 #endif
115 
116 /**
117 * @brief This key identifies video decoder surface plane
118 * in a shared memory blob parameter map
119 */
120 DECLARE_GPU_PARAM_KEY(VA_PLANE, uint32_t);
121 
122 } // namespace GPUContextParams
123 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
void * gpu_handle_param
Shortcut for defining a handle parameter.
Definition: gpu_params.hpp:20
#define DECLARE_GPU_PARAM__VALUE(name)
Shortcut for defining possible values for object parameter keys.
Definition: gpu_params.hpp:38
#define DECLARE_GPU_PARAM_KEY(name,...)
Shortcut for defining object parameter keys.
Definition: gpu_params.hpp:48