22 #ifdef EXPORT_NEURAL_SYMBOLS 23 # if defined(_MSC_VER) 25 # define CLDNN_API __declspec(dllexport) 26 # elif defined(__GNUC__) 28 # define CLDNN_API __attribute__((visibility("default"))) 31 # pragma warning Unknown dynamic link import/export semantics. 34 # if defined(_MSC_VER) 36 # define CLDNN_API __declspec(dllimport) 37 # elif defined(__GNUC__) 42 # pragma warning Unknown dynamic link import/export semantics. 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 174 uint64_t nanoseconds;
254 cldnn_format_any = -1
257 #define CLDNN_FLOAT_TYPE_MASK 0x80 258 #define CLDNN_UINT_TYPE_MASK 0x40 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 271 int32_t sizes[CLDNN_TENSOR_DIM_MAX];
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
353 typedef enum cldnn_arg_type_t
363 typedef struct cldnn_arg_t
373 typedef enum cldnn_activation_func_t
377 activation_hyperbolic_tan,
379 activation_relu_negative_slope,
389 typedef struct cldnn_activation_additional_params_t
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) }; 407 #define CLDNN_PRIMITIVE_DESC(PType) cldnn_##PType##_desc 673 #define CLDNN_DECLARE_PRIMITIVE_TYPE_ID(PType) extern "C" CLDNN_API cldnn_primitive_type_id cldnn_##PType##_type_id(cldnn_status* status) 675 #define CLDNN_DECLARE_PRIMITIVE_TYPE_ID(PType) CLDNN_API cldnn_primitive_type_id cldnn_##PType##_type_id(cldnn_status* status) cldnn_arg_type
Custom primitive kernel argument type.
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_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.
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.
Custom primitive kernel argument type.
uint8_t supports_fp16
Does engine support FP16.
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.
Tuning using the cached data (no on-line tuning for non-existing data).
const char * cldnn_primitive_id
Unique id of a primitive within a topology.
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)
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.
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.
const char * engine_log
Specifies a file to which engine log should be dumped. Null/empty values means no logging...
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.
Represents network build option.
int32_t revision
Revision version component (incremental identifier of current build/compilation). ...
const float * data
Pointer to float array.
const size_t * cldnn_work_group_sizes
Custom primitive kernel workgroup sizes.
Enable implicit reordering for user input.
int32_t minor
Minor version component (minor version of API interface - correlated with IE API version).
Represents reference to an array of tensor.
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
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.
Represents reference to an array of floats.
uint32_t enable_profiling
Enable per-primitive profiling.
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.
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. ...
cldnn_format_type
Represents memory formats (orders). In CNN most of data is describe as 4 dimensional blocks...
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.
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.
uint32_t meaningful_kernels_names
Generate meaniful names fo OpenCL kernels.
const cldnn_primitive_id * data
Pointer to ids array.
const char * single_kernel_name
If provided, runs specific layer.
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.
size_t data_type
data type (cldnn_data_type) stored in memory.
size_t size
Size (in tensor) of the array.
size_t size
Number of ids in the array.
activation additional params
size_t size
Size (in floats) of the array.
struct cldnn_event_impl * cldnn_event
Event object.
Specifies a directory to which stages of network compilation should be dumped.
cldnn_tensor size
N-dimensional vector describes size (in elements) of memory (excluding padding).
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.
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.
const cldnn_tensor * data
Pointer to tensor array.
format not used inside clDNN, but supported in reorder as extension for user provided formats...
struct cldnn_memory_impl * cldnn_memory
Memory object.
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.
uint64_t max_work_group_size
Maximum number of work-items in a work-group executing a kernel using the data parallel execution mod...
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.
Memory layout description.
uint32_t enable_parallelisation
Enables parallel execution of primitives which don't depend on each other. Disabled by default...
const int32_t mode
cldnn_tuning_mode_type.
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
Information about the engine returned by cldnn_get_engine_info().
uint8_t supports_fp16_denorms
Does engine support denormalized FP16.
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.
const char * sources_dumps_dir
Specifies a directory where sources of cldnn::program objects should be dumped. Null/empty values mea...
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.
cldnn_tuning_mode_type
Tuning modes.
const char * cldnn_kernel_code
Custom primitive kernel source code.
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.
uint64_t max_alloc_mem_size
Maximum size of memory object allocation in bytes.
cldnn_engine_type
Defines available engine types.
uint32_t priority_mode
Placeholder for priority mode (support of priority hints in command queue). Currently ignored...
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.
Configuration parameters for created engine.
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.
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.
cldnn_tensor upper_size
Upper padding sizes. For spatials, it means size of right (X) and bottom (Y) padding.
const void * data
option parameter - e.g list of outputs.
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.
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.
const char * cache_file_path
A path to the tuning cache file.
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.
int32_t build
Build version component (version/revision of official Open Source drop of clDNN library).
the most common format for activations in clDNN.
int32_t major
Major version component (major version of clDNN API interface).
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.
const uint16_t * data
Pointer to uint16_t array.
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.
uint8_t supports_subgroups_short
Does engine support cl_intel_subgroups_short.
uint64_t max_global_mem_size
Maximum size of global device memory in bytes.
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
used in bitmaps, input from user i.e b images of RGB format
Output information for executed cldnn_network.
const char * cldnn_kernel_entry_point
Custom primitive kernel entry point.
cldnn_build_option_type
Network build option types.
const struct cldnn_primitive_type * cldnn_primitive_type_id
Globally unique primitive's type id.
cldnn_padding padding
Explicitly added padding to memory buffer.
uint32_t cldnn_arg_index
Custom primitive kernel argument index.
#define CLDNN_END_PRIMITIVE_DESC(PType)
Close primitive descriptor definition.
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.
N-dimensional vector. Mostly used to represent memory size.
struct cldnn_network_impl * cldnn_network
Executable network allocated from cldnn_program.
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.