clDNN
cldnn.h
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
18 #ifndef CLDNN_H
19 #define CLDNN_H
20 
21 // exporting symbols form dynamic library
22 #ifdef EXPORT_NEURAL_SYMBOLS
23 # if defined(_MSC_VER)
24 // Microsoft
25 # define CLDNN_API __declspec(dllexport)
26 # elif defined(__GNUC__)
27 // GCC
28 # define CLDNN_API __attribute__((visibility("default")))
29 # else
30 # define CLDNN_API
31 # pragma warning Unknown dynamic link import/export semantics.
32 # endif
33 #else //import dll
34 # if defined(_MSC_VER)
35 // Microsoft
36 # define CLDNN_API __declspec(dllimport)
37 # elif defined(__GNUC__)
38 // GCC
39 # define CLDNN_API
40 # else
41 # define CLDNN_API
42 # pragma warning Unknown dynamic link import/export semantics.
43 # endif
44 #endif
45 
46 #include <stdint.h>
47 #include <stddef.h>
48 
51 
53 
55 
57 
59 
61 
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
70 #define CLDNN_SUCCESS 0
71 #define CLDNN_ERROR -1
72 #define CLDNN_INVALID_ARG -2
73 #define CLDNN_OUT_OF_RESOURCES -3
74 #define CLDNN_DEVICE_ERROR -4
75 #define CLDNN_UNSUPPORTED_SIZE -5
76 #define CLDNN_UNSUPPORTED_FORMAT -6
77 #define CLDNN_DIMENSION_MISMATCH -7
78 #define CLDNN_ALLOC_SIZE_EXCEEDED -8
79 #define CLDNN_GLOBAL_SIZE_EXCEEDED -9
80 
82 typedef int32_t cldnn_status;
84 
88 typedef struct
89 {
90  int32_t major;
91  int32_t minor;
92  int32_t build;
93  int32_t revision;
96 
99 typedef struct cldnn_engine_impl* cldnn_engine;
100 
103 typedef struct cldnn_event_impl* cldnn_event;
104 
107 typedef struct cldnn_topology_impl* cldnn_topology;
108 
111 typedef struct cldnn_program_impl* cldnn_program;
112 
115 typedef struct cldnn_network_impl* cldnn_network;
116 
119 typedef struct cldnn_memory_impl* cldnn_memory;
120 
123 
125 typedef enum /*:int32_t*/
126 {
129 
131 typedef struct
132 {
133  uint32_t enable_profiling;
136  const char* compiler_options;
137  const char* single_kernel_name;
139  const char* engine_log;
140  const char* sources_dumps_dir;
141  uint32_t priority_mode;
143 
145 typedef struct
146 {
147  uint32_t cores_count;
148  uint32_t core_frequency;
149 
154 
155  // Flags (for layout compatibility fixed size types are used).
156  uint8_t supports_fp16;
161 
164 
166 typedef void(*cldnn_event_handler)(void*);
167 
171 typedef struct
172 {
173  const char* name;
174  uint64_t nanoseconds;
176 
178 typedef enum /*:int32_t*/
179 {
187 
189 typedef enum /*:int32_t*/
190 {
195 
198 {
199  const int32_t mode;
200  const char* cache_file_path;
201 };
202 
204 typedef struct
205 {
206  int32_t type;
207  const void* data;
209 
212 typedef struct
213 {
218 
220 
223 
233 typedef enum /*:int32_t*/
234 {
254  cldnn_format_any = -1
256 
257 #define CLDNN_FLOAT_TYPE_MASK 0x80
258 #define CLDNN_UINT_TYPE_MASK 0x40
259 
260 #define CLDNN_TENSOR_BATCH_DIM_MAX 1
261 #define CLDNN_TENSOR_FEATURE_DIM_MAX 1
262 #define CLDNN_TENSOR_SPATIAL_DIM_MAX 2
263 #define CLDNN_TENSOR_DIM_MAX 8
264 
266 typedef struct
267 {
268  size_t batch_num;
269  size_t feature_num;
270  size_t spatial_num;
271  int32_t sizes[CLDNN_TENSOR_DIM_MAX];
272 } cldnn_tensor;
273 
275 typedef struct
276 {
280 } cldnn_padding;
283 
285 typedef enum /*:size_t*/
286 {
287  cldnn_i8 = sizeof(int8_t),
288  cldnn_f16 = sizeof(int16_t) | CLDNN_FLOAT_TYPE_MASK,
289  cldnn_f32 = sizeof(float) | CLDNN_FLOAT_TYPE_MASK,
290  cldnn_u8 = sizeof(uint8_t) | CLDNN_UINT_TYPE_MASK // TODO: move to top of list and re-compile inference engine
291 
293 
295 typedef struct
296 {
297  size_t data_type;
298  int32_t format;
301 } cldnn_layout;
303 
306 
308 typedef struct
309 {
310  const float* data;
311  size_t size;
313 
315 typedef struct
316 {
317  const uint16_t* data;
318  size_t size;
320 
322 typedef struct
323 {
325  size_t size;
327 
329 typedef const struct cldnn_primitive_type* cldnn_primitive_type_id;
330 
332 typedef const char* cldnn_primitive_id;
333 
335 typedef struct
336 {
338  size_t size;
340 
342 typedef const char* cldnn_kernel_code;
346 typedef const char* cldnn_kernel_entry_point;
348 typedef const char* cldnn_kernel_build_options;
350 typedef const size_t* cldnn_work_group_sizes;
351 
353 typedef enum cldnn_arg_type_t
354 {
355  arg_input,
356  arg_output,
358 
360 typedef uint32_t cldnn_arg_index;
361 
363 typedef struct cldnn_arg_t
364 {
365  cldnn_arg_type arg_type;
366  cldnn_arg_index index;
367 } cldnn_arg;
368 
371 
373 typedef enum cldnn_activation_func_t
374 {
375  activation_none, // val
376  activation_logistic, // 1/(1 + exp(-val))
377  activation_hyperbolic_tan, // tanh(val)
378  activation_relu, // max(0, val)
379  activation_relu_negative_slope, // max(0, val) + a * min(0, val) (a is additional param)
380  activation_clamp, // max(a, min(b, val) (a,b are additional param)
381  activation_softrelu, // log(1 + exp(val))
382  activation_abs, // abs(val)
383  activation_linear, // a*val + b (a,b are additional params)
384  activation_square, // val*val
385  activation_sqrt, // sqrt(val)
387 
389 typedef struct cldnn_activation_additional_params_t
390 {
391  float a, b;
393 
398 #define CLDNN_BEGIN_PRIMITIVE_DESC(PType) struct cldnn_##PType##_desc {\
399  cldnn_primitive_type_id type; \
400  cldnn_primitive_id id; \
401  cldnn_primitive_id_arr input; \
402  cldnn_padding output_padding;
404 #define CLDNN_END_PRIMITIVE_DESC(PType) };
406 
407 #define CLDNN_PRIMITIVE_DESC(PType) cldnn_##PType##_desc
408 
411 CLDNN_END_PRIMITIVE_DESC(primitive)
412 
413 
418 CLDNN_API cldnn_version cldnn_get_version(cldnn_status* status);
420 
423 
426 
429 CLDNN_API void cldnn_add_primitive(cldnn_topology topology, const struct CLDNN_PRIMITIVE_DESC(primitive)* dto, cldnn_status* status);
430 
436 CLDNN_API void cldnn_get_primitive_ids(cldnn_topology topology, char* ids, size_t size, size_t* size_ret, cldnn_status* status);
437 
439 CLDNN_API void cldnn_retain_topology(cldnn_topology topology, cldnn_status* status);
440 
442 CLDNN_API void cldnn_release_topology(cldnn_topology topology, cldnn_status* status);
444 
447 
449 CLDNN_API uint32_t cldnn_get_engine_count(/*cldnn_engine_type*/ int32_t type, cldnn_status* status);
450 
455 CLDNN_API cldnn_engine cldnn_create_engine(/*cldnn_engine_type*/ int32_t type, uint32_t engine_num, const cldnn_engine_configuration* configuration, cldnn_status* status);
456 
458 CLDNN_API void cldnn_retain_engine(cldnn_engine engine, cldnn_status* status);
459 
461 CLDNN_API void cldnn_release_engine(cldnn_engine engine, cldnn_status* status);
462 
465 
467 CLDNN_API /*cldnn_engine_type*/ int32_t cldnn_get_engine_type(cldnn_engine engine, cldnn_status* status);
469 
472 
475 
477 CLDNN_API int32_t cldnn_is_user_event(cldnn_event event, cldnn_status* status);
478 
480 CLDNN_API void cldnn_retain_event(cldnn_event event, cldnn_status* status);
481 
483 CLDNN_API void cldnn_release_event(cldnn_event event, cldnn_status* status);
484 
486 CLDNN_API void cldnn_wait_for_event(cldnn_event event, cldnn_status* status);
487 
489 CLDNN_API void cldnn_set_event(cldnn_event event, cldnn_status* status);
490 
494 CLDNN_API void cldnn_add_event_handler(cldnn_event event, cldnn_event_handler handler, void* param, cldnn_status* status);
495 
500 CLDNN_API void cldnn_get_event_profiling_info(cldnn_event event, cldnn_profiling_interval* profiling, size_t size, size_t* size_ret, cldnn_status* status);
502 
505 
511 CLDNN_API cldnn_program cldnn_build_program(cldnn_engine engine, cldnn_topology topology, cldnn_build_option* options, size_t options_num, cldnn_status* status);
512 
514 CLDNN_API void cldnn_retain_program(cldnn_program program, cldnn_status* status);
515 
517 CLDNN_API void cldnn_release_program(cldnn_program program, cldnn_status* status);
519 
522 
528 CLDNN_API cldnn_network cldnn_build_network(cldnn_engine engine, cldnn_topology topology, cldnn_build_option* options, size_t options_num, cldnn_status* status);
529 
533 
535 CLDNN_API void cldnn_retain_network(cldnn_network network, cldnn_status* status);
536 
538 CLDNN_API void cldnn_release_network(cldnn_network network, cldnn_status* status);
539 
545 CLDNN_API void cldnn_set_network_input(cldnn_network network, cldnn_primitive_id id, cldnn_memory mem, cldnn_status* status);
546 
554 CLDNN_API void cldnn_get_primitive_info(cldnn_network network, cldnn_primitive_id id, char* info, size_t size, size_t* size_ret, cldnn_status* status);
555 
558 
561 
568 CLDNN_API void cldnn_get_network_output_names(cldnn_network network, char* names, size_t size, size_t* size_ret, cldnn_status* status);
569 
576 CLDNN_API void cldnn_get_network_executed_primitive_names(cldnn_network network, char* names, size_t size, size_t* size_ret, cldnn_status* status);
577 
584 CLDNN_API void cldnn_get_network_all_primitive_names(cldnn_network network, char* names, size_t size, size_t* size_ret, cldnn_status* status);
585 
592 CLDNN_API void cldnn_get_network_all_primitive_org_names(cldnn_network network, char* names, size_t size, size_t* size_ret, cldnn_status* status);
593 
599 CLDNN_API void cldnn_execute_network(cldnn_network network, cldnn_event* dependencies, size_t deps_num, cldnn_status* status);
600 
607 CLDNN_API cldnn_network_output cldnn_get_network_output(cldnn_network network, const char* name, cldnn_status* status);
608 
613 CLDNN_API cldnn_memory cldnn_get_network_output_memory(cldnn_network network, const char* name, cldnn_status* status);
614 
619 CLDNN_API cldnn_event cldnn_get_network_output_event(cldnn_network network, const char* name, cldnn_status* status);
621 
624 
626 CLDNN_API cldnn_memory cldnn_allocate_memory(cldnn_engine engine, cldnn_layout layout, cldnn_status* status);
629 CLDNN_API cldnn_memory cldnn_attach_memory(cldnn_layout layout, void* pointer, size_t size, cldnn_status* status);
631 CLDNN_API int32_t cldnn_is_the_same_buffer(cldnn_memory mem1, cldnn_memory mem2, cldnn_status* status);
633 CLDNN_API void cldnn_retain_memory(cldnn_memory memory, cldnn_status* status);
635 CLDNN_API void cldnn_release_memory(cldnn_memory memory, cldnn_status* status);
638 CLDNN_API void* cldnn_lock_memory(cldnn_memory memory, cldnn_status* status);
640 CLDNN_API void cldnn_unlock_memory(cldnn_memory memory, cldnn_status* status);
649 CLDNN_API uint16_t cldnn_float_to_half(float,cldnn_status*);
652 CLDNN_API float cldnn_half_to_float(uint16_t, cldnn_status*);
653 
655 
658 
662 CLDNN_API const char* cldnn_get_last_error_message();
664 
665 #ifdef __cplusplus
666 }
667 #endif
668 
670 
671 //primitives
672 #ifdef __cplusplus
673 #define CLDNN_DECLARE_PRIMITIVE_TYPE_ID(PType) extern "C" CLDNN_API cldnn_primitive_type_id cldnn_##PType##_type_id(cldnn_status* status)
674 #else
675 #define CLDNN_DECLARE_PRIMITIVE_TYPE_ID(PType) CLDNN_API cldnn_primitive_type_id cldnn_##PType##_type_id(cldnn_status* status)
676 #endif
677 
678 
679 #endif /* CLDNN_H */
cldnn_arg_type
Custom primitive kernel argument type.
Definition: cldnn.h:353
Tuning config.
Definition: cldnn.h:197
CLDNN_API cldnn_event cldnn_create_user_event(cldnn_engine engine, cldnn_status *status)
Creates an event which can be set by user.
CLDNN_API void cldnn_get_network_output_names(cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
Returns names of network outputs.
CLDNN_API void cldnn_unlock_memory(cldnn_memory memory, cldnn_status *status)
Unlocks memory locked by cldnn_lock_memory(cldnn_memory memory, cldnn_status* status).
cldnn_memory memory
Definition: cldnn.h:215
CLDNN_API int32_t cldnn_get_engine_type(cldnn_engine engine, cldnn_status *status)
Returns the cldnn_engine_type for the particular engine.
#define CLDNN_BEGIN_PRIMITIVE_DESC(PType)
Begin primitive description definition.
Definition: cldnn.h:398
CLDNN_API void cldnn_get_network_all_primitive_names(cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
Returns names of all primitives in network.
Allow primitives fusing during network build.
Definition: cldnn.h:180
Custom primitive kernel argument type.
Definition: cldnn.h:363
uint8_t supports_fp16
Does engine support FP16.
Definition: cldnn.h:156
CLDNN_API void cldnn_get_network_all_primitive_org_names(cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
Returns names of all primitives in network before graph optimization.
Represents reference to an array of uint16_t.
Definition: cldnn.h:315
Tuning using the cached data (no on-line tuning for non-existing data).
Definition: cldnn.h:192
const char * cldnn_primitive_id
Unique id of a primitive within a topology.
Definition: cldnn.h:332
CLDNN_API void cldnn_release_engine(cldnn_engine engine, cldnn_status *status)
Decrement reference counter for the engine object. Deletes object when counter becomes zero...
int32_t format
Memor format (cldnn_format_type)
Definition: cldnn.h:298
CLDNN_API void cldnn_release_network(cldnn_network network, cldnn_status *status)
Decrement reference counter for the network object. Deletes object when counter becomes zero...
CLDNN_API uint16_t cldnn_float_to_half(float, cldnn_status *)
converts float(32 bit) to half_t(fp16 bit)
const char * compiler_options
OpenCL compiler options string.
Definition: cldnn.h:136
CLDNN_API cldnn_network cldnn_build_network(cldnn_engine engine, cldnn_topology topology, cldnn_build_option *options, size_t options_num, cldnn_status *status)
Builds and allocates executable network based on user-defined topology by specified engine...
void(* cldnn_event_handler)(void *)
user-defined event handler callback.
Definition: cldnn.h:166
const char * engine_log
Specifies a file to which engine log should be dumped. Null/empty values means no logging...
Definition: cldnn.h:139
CLDNN_API cldnn_memory cldnn_get_network_output_memory(cldnn_network network, const char *name, cldnn_status *status)
Returns memory corresponding to output with name.
User selected list of network outputs.
Definition: cldnn.h:183
Represents network build option.
Definition: cldnn.h:204
int32_t revision
Revision version component (incremental identifier of current build/compilation). ...
Definition: cldnn.h:93
const float * data
Pointer to float array.
Definition: cldnn.h:310
const size_t * cldnn_work_group_sizes
Custom primitive kernel workgroup sizes.
Definition: cldnn.h:350
Enable implicit reordering for user input.
Definition: cldnn.h:181
int32_t minor
Minor version component (minor version of API interface - correlated with IE API version).
Definition: cldnn.h:91
Represents reference to an array of tensor.
Definition: cldnn.h:322
CLDNN_API void cldnn_retain_topology(cldnn_topology topology, cldnn_status *status)
Increment reference counter for the topology object.
CLDNN_API void cldnn_get_network_executed_primitive_names(cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
Returns names of executed primitives.
cldnn_activation_func
activation functions
Definition: cldnn.h:373
CLDNN_API int32_t cldnn_is_the_same_buffer(cldnn_memory mem1, cldnn_memory mem2, cldnn_status *status)
Checks if two memory objects refer to the same underlaying buffer.
struct cldnn_engine_impl * cldnn_engine
Engine object.
Definition: cldnn.h:99
Represents reference to an array of floats.
Definition: cldnn.h:308
uint32_t enable_profiling
Enable per-primitive profiling.
Definition: cldnn.h:133
CLDNN_API void cldnn_release_event(cldnn_event event, cldnn_status *status)
Decrement reference counter for the event object. Deletes object when counter becomes zero...
struct cldnn_program_impl * cldnn_program
Compiled program build from cldnn_topology by cldnn_engine.
Definition: cldnn.h:111
CLDNN_API void cldnn_retain_network(cldnn_network network, cldnn_status *status)
Increment reference counter for the network object.
CLDNN_API const char * cldnn_get_last_error_message()
If cldnn function returns status different than CLDNN_SUCCESS, user call this function to get more de...
cldnn_tensor lower_size
Lower padding sizes. For spatials, it means size of left (X) and top (Y) padding. ...
Definition: cldnn.h:277
cldnn_format_type
Represents memory formats (orders). In CNN most of data is describe as 4 dimensional blocks...
Definition: cldnn.h:233
CLDNN_API void cldnn_add_primitive(cldnn_topology topology, const struct cldnn_primitive_desc *dto, cldnn_status *status)
Add new primitive to the topology.
CLDNN_API cldnn_layout cldnn_get_memory_layout(cldnn_memory memory, cldnn_status *status)
Returns memory layout.
const cldnn_arg * cldnn_kernel_arguments
Custom primitive kernel argument array.
Definition: cldnn.h:370
CLDNN_API uint32_t cldnn_get_engine_count(int32_t type, cldnn_status *status)
number of available engines of the particular type
CLDNN_API void cldnn_release_topology(cldnn_topology topology, cldnn_status *status)
Decrement reference counter for the topology object. Deletes object when counter becomes zero...
size_t size
Size (in uint16_t) of the array.
Definition: cldnn.h:318
uint32_t meaningful_kernels_names
Generate meaniful names fo OpenCL kernels.
Definition: cldnn.h:134
const cldnn_primitive_id * data
Pointer to ids array.
Definition: cldnn.h:337
const char * single_kernel_name
If provided, runs specific layer.
Definition: cldnn.h:137
CLDNN_API cldnn_event cldnn_get_network_output_event(cldnn_network network, const char *name, cldnn_status *status)
Returns event corresponding to output with name.
Enable debug mode.
Definition: cldnn.h:182
size_t data_type
data type (cldnn_data_type) stored in memory.
Definition: cldnn.h:297
size_t size
Size (in tensor) of the array.
Definition: cldnn.h:325
size_t size
Number of ids in the array.
Definition: cldnn.h:338
activation additional params
Definition: cldnn.h:389
size_t size
Size (in floats) of the array.
Definition: cldnn.h:311
struct cldnn_event_impl * cldnn_event
Event object.
Definition: cldnn.h:103
Specifies a directory to which stages of network compilation should be dumped.
Definition: cldnn.h:185
cldnn_tensor size
N-dimensional vector describes size (in elements) of memory (excluding padding).
Definition: cldnn.h:299
CLDNN_API cldnn_engine cldnn_get_memory_engine(cldnn_memory memory, cldnn_status *status)
Returns reference to the engine associated with memory object.
int32_t cldnn_status
Represents errors status for all API calls.
Definition: cldnn.h:82
CLDNN_API void cldnn_release_program(cldnn_program program, cldnn_status *status)
Decrement reference counter for the program object. Deletes object when counter becomes zero...
const char * cldnn_kernel_build_options
Custom primitive kernel build options.
Definition: cldnn.h:348
const cldnn_tensor * data
Pointer to tensor array.
Definition: cldnn.h:324
format not used inside clDNN, but supported in reorder as extension for user provided formats...
Definition: cldnn.h:238
struct cldnn_memory_impl * cldnn_memory
Memory object.
Definition: cldnn.h:119
CLDNN_API void cldnn_retain_program(cldnn_program program, cldnn_status *status)
Increment reference counter for the program object.
CLDNN_API cldnn_memory cldnn_allocate_memory(cldnn_engine engine, cldnn_layout layout, cldnn_status *status)
Allocate memory on engine using specified layout.
CLDNN_API void cldnn_add_event_handler(cldnn_event event, cldnn_event_handler handler, void *param, cldnn_status *status)
Register call back to be called on event completion.
OpenCL engine.
Definition: cldnn.h:127
uint64_t max_work_group_size
Maximum number of work-items in a work-group executing a kernel using the data parallel execution mod...
Definition: cldnn.h:150
CLDNN_API void cldnn_execute_network(cldnn_network network, cldnn_event *dependencies, size_t deps_num, cldnn_status *status)
Executes network.
uint32_t cores_count
Number of available HW cores.
Definition: cldnn.h:147
Memory layout description.
Definition: cldnn.h:295
uint32_t enable_parallelisation
Enables parallel execution of primitives which don&#39;t depend on each other. Disabled by default...
Definition: cldnn.h:138
Tuning is disabled.
Definition: cldnn.h:191
const int32_t mode
cldnn_tuning_mode_type.
Definition: cldnn.h:199
CLDNN_API float cldnn_half_to_float(uint16_t, cldnn_status *)
converts half_t(f16 bit) to float(32 bit)
batch first, feature and than spatials
Definition: cldnn.h:235
Information about the engine returned by cldnn_get_engine_info().
Definition: cldnn.h:145
uint8_t supports_fp16_denorms
Does engine support denormalized FP16.
Definition: cldnn.h:157
CLDNN_API cldnn_engine cldnn_get_network_engine(cldnn_network network, cldnn_status *status)
Returns engine associated with the network.
struct cldnn_topology_impl * cldnn_topology
Network topology to be defined by user.
Definition: cldnn.h:107
const char * sources_dumps_dir
Specifies a directory where sources of cldnn::program objects should be dumped. Null/empty values mea...
Definition: cldnn.h:140
float filling_value
Definition: cldnn.h:279
CLDNN_API void cldnn_get_event_profiling_info(cldnn_event event, cldnn_profiling_interval *profiling, size_t size, size_t *size_ret, cldnn_status *status)
Returns the profiling information for an network primitive associated with event. ...
Tuning using the cached data if exist, tune and update cache otherwise.
Definition: cldnn.h:193
cldnn_tuning_mode_type
Tuning modes.
Definition: cldnn.h:189
const char * cldnn_kernel_code
Custom primitive kernel source code.
Definition: cldnn.h:342
CLDNN_API void cldnn_retain_event(cldnn_event event, cldnn_status *status)
Increment reference counter for the event object.
cldnn_data_type
Data type stored in memory.
Definition: cldnn.h:285
uint64_t max_alloc_mem_size
Maximum size of memory object allocation in bytes.
Definition: cldnn.h:153
cldnn_engine_type
Defines available engine types.
Definition: cldnn.h:125
uint32_t priority_mode
Placeholder for priority mode (support of priority hints in command queue). Currently ignored...
Definition: cldnn.h:141
CLDNN_API void cldnn_release_memory(cldnn_memory memory, cldnn_status *status)
Decrement reference counter for the memory object. Deletes object when counter becomes zero...
CLDNN_API cldnn_topology cldnn_create_topology(cldnn_status *status)
Create empty network topology.
number of format types
Definition: cldnn.h:253
Configuration parameters for created engine.
Definition: cldnn.h:131
CLDNN_API int32_t cldnn_is_user_event(cldnn_event event, cldnn_status *status)
Checks if an event was created by user.
cldnn_event event
Event to be waited.
Definition: cldnn.h:214
CLDNN_API cldnn_memory cldnn_attach_memory(cldnn_layout layout, void *pointer, size_t size, cldnn_status *status)
Create memory object attached to the buffer allocated by user.
Padding information.
Definition: cldnn.h:275
cldnn_tensor upper_size
Upper padding sizes. For spatials, it means size of right (X) and bottom (Y) padding.
Definition: cldnn.h:278
const void * data
option parameter - e.g list of outputs.
Definition: cldnn.h:207
CLDNN_API void cldnn_retain_engine(cldnn_engine engine, cldnn_status *status)
Increment reference counter for the engine object.
CLDNN_API void * cldnn_lock_memory(cldnn_memory memory, cldnn_status *status)
Locks memory buffer. Provides direct access to memory data.
CLDNN_API cldnn_engine cldnn_create_engine(int32_t type, uint32_t engine_num, const cldnn_engine_configuration *configuration, cldnn_status *status)
Create new engine of the specified type, engine_num, and configuration options.
Represents reference to an array of primitive ids.
Definition: cldnn.h:335
CLDNN_API void cldnn_get_primitive_info(cldnn_network network, cldnn_primitive_id id, char *info, size_t size, size_t *size_ret, cldnn_status *status)
Returns information about particular primitive.
CLDNN_API cldnn_engine_info cldnn_get_engine_info(cldnn_engine engine, cldnn_status *status)
Returns engine information. See cldnn_engine_info for details.
const char * name
Profiling interval name.
Definition: cldnn.h:173
const char * cache_file_path
A path to the tuning cache file.
Definition: cldnn.h:200
CLDNN_API void cldnn_retain_memory(cldnn_memory memory, cldnn_status *status)
Increment reference counter for the memory object.
int32_t type
cldnn_build_option_type.
Definition: cldnn.h:206
int32_t build
Build version component (version/revision of official Open Source drop of clDNN library).
Definition: cldnn.h:92
the most common format for activations in clDNN.
Definition: cldnn.h:237
int32_t major
Major version component (major version of clDNN API interface).
Definition: cldnn.h:90
CLDNN_API cldnn_network cldnn_allocate_network(cldnn_program program, cldnn_status *status)
Allocates memory for a new network which will be able to execute specified program.
CLDNN_API cldnn_network_output cldnn_get_network_output(cldnn_network network, const char *name, cldnn_status *status)
Returns executed network output information.
uint32_t core_frequency
Clock frequency in MHz.
Definition: cldnn.h:148
const uint16_t * data
Pointer to uint16_t array.
Definition: cldnn.h:317
CLDNN_API cldnn_program cldnn_build_program(cldnn_engine engine, cldnn_topology topology, cldnn_build_option *options, size_t options_num, cldnn_status *status)
Builds executable program based on user-defined topology by specified engine.
CLDNN_API void cldnn_wait_for_event(cldnn_event event, cldnn_status *status)
Waits for event completion or error.
cldnn_kernel_code * cldnn_kernels_code
Custom primitive kernel source code array.
Definition: cldnn.h:344
uint8_t supports_subgroups_short
Does engine support cl_intel_subgroups_short.
Definition: cldnn.h:158
uint64_t max_global_mem_size
Maximum size of global device memory in bytes.
Definition: cldnn.h:152
CLDNN_API void cldnn_set_event(cldnn_event event, cldnn_status *status)
Set event status to completed.
uint32_t dump_custom_program
dump the custom generated program to files
Definition: cldnn.h:135
used in bitmaps, input from user i.e b images of RGB format
Definition: cldnn.h:236
Output information for executed cldnn_network.
Definition: cldnn.h:212
const char * cldnn_kernel_entry_point
Custom primitive kernel entry point.
Definition: cldnn.h:346
cldnn_build_option_type
Network build option types.
Definition: cldnn.h:178
const struct cldnn_primitive_type * cldnn_primitive_type_id
Globally unique primitive&#39;s type id.
Definition: cldnn.h:329
cldnn_padding padding
Explicitly added padding to memory buffer.
Definition: cldnn.h:300
uint32_t cldnn_arg_index
Custom primitive kernel argument index.
Definition: cldnn.h:360
#define CLDNN_END_PRIMITIVE_DESC(PType)
Close primitive descriptor definition.
Definition: cldnn.h:409
CLDNN_API cldnn_program cldnn_get_network_program(cldnn_network network, cldnn_status *status)
Returns program associated with the network.
Profiling information for an executed network primitive.
Definition: cldnn.h:171
N-dimensional vector. Mostly used to represent memory size.
Definition: cldnn.h:266
struct cldnn_network_impl * cldnn_network
Executable network allocated from cldnn_program.
Definition: cldnn.h:115
CLDNN_API void cldnn_set_network_input(cldnn_network network, cldnn_primitive_id id, cldnn_memory mem, cldnn_status *status)
Provides user input data to the network (for input_layout primitives).
CLDNN_API void cldnn_get_primitive_ids(cldnn_topology topology, char *ids, size_t size, size_t *size_ret, cldnn_status *status)
Return all primitives id from topology.
uint64_t max_local_mem_size
Maximum size of local memory arena in bytes.
Definition: cldnn.h:151