Documentation
Install OpenVINO™
gpu
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
/**
41
* @def DECLARE_GPU_PARAM_KEY(name, ...)
42
* @brief Shortcut for defining object parameter keys
43
*/
44
#define DECLARE_GPU_PARAM_KEY(name, ...) \
45
static constexpr auto PARAM_##name = #name
46
/**
47
* @brief Shared device context type: can be either pure OpenCL (OCL)
48
* or shared video decoder (VA_SHARED) context
49
*/
50
DECLARE_GPU_PARAM_KEY
(CONTEXT_TYPE, std::string);
51
/**
52
* @brief Pure OpenCL device context
53
*/
54
DECLARE_GPU_PARAM_VALUE
(OCL);
55
/**
56
* @brief Shared context (video decoder or D3D)
57
*/
58
DECLARE_GPU_PARAM_VALUE
(VA_SHARED);
59
60
/**
61
* @brief This key identifies OpenCL context handle
62
* in a shared context or shared memory blob parameter map
63
*/
64
DECLARE_GPU_PARAM_KEY
(OCL_CONTEXT,
gpu_handle_param
);
65
66
/**
67
* @brief This key identifies video acceleration device/display handle
68
* in a shared context or shared memory blob parameter map
69
*/
70
DECLARE_GPU_PARAM_KEY
(VA_DEVICE,
gpu_handle_param
);
71
72
/**
73
* @brief This key identifies type of internal shared memory
74
* in a shared memory blob parameter map.
75
*/
76
DECLARE_GPU_PARAM_KEY
(SHARED_MEM_TYPE, std::string);
77
/**
78
* @brief Shared OpenCL buffer blob
79
*/
80
DECLARE_GPU_PARAM_VALUE
(OCL_BUFFER);
81
/**
82
* @brief Shared OpenCL 2D image blob
83
*/
84
DECLARE_GPU_PARAM_VALUE
(OCL_IMAGE2D);
85
/**
86
* @brief Shared video decoder surface or D3D 2D texture blob
87
*/
88
DECLARE_GPU_PARAM_VALUE
(VA_SURFACE);
89
/**
90
* @brief Shared D3D buffer blob
91
*/
92
DECLARE_GPU_PARAM_VALUE
(DX_BUFFER);
93
94
/**
95
* @brief This key identifies OpenCL memory handle
96
* in a shared memory blob parameter map
97
*/
98
DECLARE_GPU_PARAM_KEY
(MEM_HANDLE,
gpu_handle_param
);
99
100
/**
101
* @brief This key identifies video decoder surface handle
102
* in a shared memory blob parameter map
103
*/
104
#ifdef WIN32
105
DECLARE_GPU_PARAM_KEY
(DEV_OBJECT_HANDLE,
gpu_handle_param
);
106
#else
107
DECLARE_GPU_PARAM_KEY
(DEV_OBJECT_HANDLE, uint32_t);
108
#endif
109
110
/**
111
* @brief This key identifies video decoder surface plane
112
* in a shared memory blob parameter map
113
*/
114
DECLARE_GPU_PARAM_KEY
(VA_PLANE, uint32_t);
115
116
}
// namespace GPUContextParams
117
}
// namespace InferenceEngine
DECLARE_GPU_PARAM_VALUE
#define DECLARE_GPU_PARAM_VALUE(name)
Shortcut for defining possible values for object parameter keys.
Definition:
gpu_params.hpp:38
InferenceEngine::gpu_handle_param
void * gpu_handle_param
Shortcut for defining a handle parameter.
Definition:
gpu_params.hpp:20
DECLARE_GPU_PARAM_KEY
#define DECLARE_GPU_PARAM_KEY(name,...)
Shortcut for defining object parameter keys.
Definition:
gpu_params.hpp:44