Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / cldnn.h
index 6a61b9e..9b705fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2016 Intel Corporation
+// Copyright (c) 2016-2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -157,8 +157,10 @@ typedef struct
     const char* engine_log;                             ///< Specifies a file to which engine log should be dumped. Null/empty values means no logging.
     const char* sources_dumps_dir;                      ///< Specifies a directory where sources of cldnn::program objects should be dumped. Null/empty values means no loggins.
     /*cldnn_priority_mode_type*/ int16_t priority_mode; ///< Priority mode (support of OpenCL priority hints in command queue).
-    /*cldnn_throttle_mode_type*/ int16_t throttle_mode; ///< Placeholder for throttle mode (support of throttle hints in command queue). It has no effect for now and should be set to cldnn_throttle_disabled.
+    /*cldnn_throttle_mode_type*/ int16_t throttle_mode; ///< Throttle mode (support of throttle hints in command queue).
     uint32_t enable_memory_pool;                        ///< Enables memory usage optimization. memory objects will be reused when possible. 
+    void* context;
+    const char* tuning_cache_path;                      ///< Enables defining other than default path to tuning cache json 
 }  cldnn_engine_configuration;
 
 /// @brief Information about the engine returned by cldnn_get_engine_info().
@@ -212,7 +214,8 @@ typedef enum /*:int32_t*/
     cldnn_build_option_graph_dumps_dir,         ///< Specifies a directory to which stages of network compilation should be dumped.
     cldnn_build_option_serialization,           ///< Specifies a name of files to which serialization should be dumped.
     cldnn_build_option_load_program,            ///< Specifies a name of load_program process.
-    cldnn_build_option_learning_config          ///< User defined learning parameters.
+    cldnn_build_option_learning_config,         ///< User defined learning parameters.
+    cldnn_build_option_detection_output_gpu     ///< Run detection output layer always on GPU, regardless performance
 } cldnn_build_option_type;
 
 /// @brief Tuning modes.
@@ -275,6 +278,8 @@ typedef enum /*:int32_t*/
     cldnn_format_fyxb,          ///< format not used inside clDNN, but supported in reorder as extension for user provided formats.
     cldnn_format_os_iyx_osv16,  ///< format used only for convolution weights: os - output feature maps slice, i - input feature maps, yx - spatials, sv16 - 16 values of single slice.
                                 ///< \n \image html os_iyx_osv16.jpg
+    cldnn_format_os_iyx_osv32,  ///< format used only for convolution weights: os - output feature maps slice, i - input feature maps, yx - spatials, sv32 - 32 values of single slice.
+    cldnn_format_os_iyx_osv64,  ///< format used only for convolution weights: os - output feature maps slice, i - input feature maps, yx - spatials, sv64 - 64 values of single slice.
     cldnn_format_bs_xs_xsv8_bsv8, ///< format used only for fully connected weights: bs - batch slice, xs - x slice, bsv8 - 8 values of single slice.
                                   ///< \n \image html bs_xs_xsv8_bsv8.jpg
     cldnn_format_bs_xs_xsv8_bsv16,///< format used only for fully connected weights: bs - batch slice, xs - x slice, bsv16 - 16 values of single slice.
@@ -287,10 +292,23 @@ typedef enum /*:int32_t*/
                                       ///< \n \image html image_2d_weights_c4_fyx_b.jpg
     cldnn_format_image_2d_weights_c1_b_fyx, ///< image format for weights, image 2d, single channel, width size is b, height is f*y*x
                                       ///< \n \image html image_2d_weights_c1_b_fyx.jpg
-    cldnn_format_byxf_af32,           /// < \n format for input for primitives using MMAD
-    cldnn_format_fs_bs_yx_bs4_fs32, /// < \n format for batched input for primitives using MMAD
+    cldnn_format_winograd_2x3_s1_data,       ///< format used for input for winograd convolution, F(2,3) -- filter 3x3 with stride 1
+    cldnn_format_winograd_2x3_s1_weights,    ///< format used for weights for winograd non-fused convolution, F(2,3) -- filter 3x3 with stride 1
+    cldnn_format_winograd_2x3_s1_fused_weights,    ///< format used for weights for winograd fused convolution, F(2,3) -- filter 3x3 with stride 1
+    cldnn_format_winograd_6x3_s1_fused_weights,    ///< format used for weights for winograd fused convolution, F(6,3) -- filter 3x3 with stride 1
+    cldnn_format_image_2d_weights_winograd_6x3_s1_fbxyb, ///< image format used for weights for winograd fused convolution, F(6,3) -- filter 3x3 with stride 1
+    cldnn_format_image_2d_weights_winograd_6x3_s1_xfbyb, ///< image format used for weights for winograd fused convolution, F(6,3) -- filter 3x3 with stride 1
+    cldnn_format_byxf_af32,               /// < \n format for input for primitives using MMAD
+    cldnn_format_byx8_f4,                 /// < \n format for input for MMAD convolutions
+    cldnn_format_fs_bs_yx_bs4_fs32,       /// < \n format for batched input for primitives using MMAD
     cldnn_format_os_is_yx_isa8_osv8_isv4, /// < \n format for weights for MMAD convolutions, stored as ((aligned_to_8(O)/8) * (aligned_to_32(I)/32) * Y * X * ( 8 ) * ( 8 ) * ( 4 )
+    cldnn_format_os_is_yx_isa8_osv8_isv4_swizzled_by_4, /// < \n format for weights for MMAD convolutions
     cldnn_format_is_o_yx_isv32, /// < \n format for weights for 1x1 MMAD convolutions 
+    cldnn_format_is_o32_yx_isv32_swizzled_by_4, /// < \n format for weights for 1x1 MMAD convolutions
+    cldnn_format_os_is_y_x8_osv8_isv4, /// < n\ format for weights for MMAD convolutions
+    cldnn_bf_lyx_yx,                      /// < \n format for local convolution weights
+    cldnn_format_b_fs_yx_fsv4,            /// < \n format for input for IMAD convolutions
+    cldnn_format_os_is_yx_osv16_isv4,     /// < \n format for weights for IMAD convolutions
     cldnn_format_format_num,    ///< number of format types
     cldnn_format_any = -1
 } cldnn_format_type;
@@ -301,6 +319,7 @@ typedef enum /*:int32_t*/
 #define CLDNN_TENSOR_BATCH_DIM_MAX 1
 #define CLDNN_TENSOR_FEATURE_DIM_MAX 1
 #define CLDNN_TENSOR_SPATIAL_DIM_MAX 2
+#define CLDNN_TENSOR_LOCAL_DIM_MAX 2
 #define CLDNN_TENSOR_DIM_MAX 8
 
 /// @brief N-dimensional vector. Mostly used to represent memory size.
@@ -309,6 +328,7 @@ typedef struct
     size_t batch_num;
     size_t feature_num;
     size_t spatial_num;
+    size_t local_num;
     int32_t sizes[CLDNN_TENSOR_DIM_MAX];
 } cldnn_tensor;
 
@@ -361,6 +381,13 @@ typedef struct
     size_t size;       ///< Size (in uint16_t) of the array.
 } cldnn_uint16_t_arr;
 
+/// @brief Represents reference to an array of uint8_t.
+typedef struct
+{
+    const uint8_t* data; ///< Pointer to uint8_t array.
+    size_t size;       ///< Size (in uint8_t) of the array.
+} cldnn_uint8_t_arr;
+
 /// @brief Represents reference to an array of tensor.
 typedef struct
 {
@@ -381,6 +408,13 @@ typedef struct
     size_t size;                    ///< Number of ids in the array.
 } cldnn_primitive_id_arr;
 
+typedef struct
+{
+    cldnn_data_type data_type;
+    // No bool type available...
+    char enabled;
+} cldnn_optional_data_type;
+
 /// @brief Custom primitive kernel source code
 typedef const char*  cldnn_kernel_code;
 /// @brief Custom primitive kernel source code array
@@ -434,8 +468,9 @@ typedef enum cldnn_activation_func_t
     activation_acos,                    // acos(val)
     activation_cosh,                    // cosh(val)
     activation_log,                     // log(val)
-       activation_log2,                                        // log2(val)
+    activation_log2,                    // log2(val)
     activation_exp,                     // exp(val)
+    activation_not                      // !(val)
 } cldnn_activation_func;
 
 /// @brief activation gradient functions
@@ -452,6 +487,17 @@ typedef struct cldnn_activation_additional_params_t
     float a, b;
 } cldnn_activation_additional_params;
 
+/// @brief Axis which index_select primitive will index.
+typedef enum index_select_axis_name_t
+{
+    along_b,
+    along_f,
+    along_y,
+    along_x
+} index_select_axis_name;
+
+/// @brief  Axis which index_select primitive will index array
+typedef const index_select_axis_name* index_select_axis_name_arr;
 
 /// @brief reorder mean operation modes
 typedef enum cldnn_reorder_mean_mode_t
@@ -470,7 +516,8 @@ typedef enum cldnn_reorder_mean_mode_t
     cldnn_primitive_type_id type; /**< @brief Primitive type identificator. */\
     cldnn_primitive_id id;        /**< @brief Primitive id unique within a topology. */\
     cldnn_primitive_id_arr input; /**< @brief Input primitives ids. */\
-    cldnn_padding output_padding; /**< @brief Output padding information. */
+    cldnn_padding output_padding; /**< @brief Output padding information. */\
+    cldnn_optional_data_type output_data_type; /**< @brief If specified, describes an explicit change of the output precision of the primitive. */
 
 /// @brief Close primitive descriptor definition.
 #define CLDNN_END_PRIMITIVE_DESC(PType) };