Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / examples / simple_net.c
index 6a4e78a..a88d0a8 100644 (file)
@@ -76,13 +76,13 @@ void _free(void *ptr) {
 }
 #endif
 
-static size_t product(int *arr, size_t size) {
+static size_t product(ptrdiff_t *arr, size_t size) {
     size_t prod = 1;
     for (size_t i = 0; i < size; ++i) prod *= arr[i];
     return prod;
 }
 
-static void init_data_memory(uint32_t dim, const int *dims,
+static void init_data_memory(uint32_t dim, const ptrdiff_t *dims,
         mkldnn_memory_format_t user_fmt, mkldnn_data_type_t mkldnn_f32,
         mkldnn_engine_t engine, float *data, mkldnn_primitive_t *memory)
 {
@@ -159,12 +159,12 @@ mkldnn_status_t simple_net() {
      * {BATCH, OC, CONV_OH, CONV_OW}
      * strides: {CONV_STRIDE, CONV_STRIDE}
      */
-    int conv_user_src_sizes[4] = { BATCH, IC, CONV_IH, CONV_IW };
-    int conv_user_weights_sizes[4] = { OC, IC, 11, 11 };
-    int conv_bias_sizes[4] = { OC };
-    int conv_user_dst_sizes[4] = { BATCH, OC, CONV_OH, CONV_OW };
-    int conv_strides[2] = { CONV_STRIDE, CONV_STRIDE };
-    int conv_padding[2] = { CONV_PAD, CONV_PAD };
+    ptrdiff_t conv_user_src_sizes[4] = { BATCH, IC, CONV_IH, CONV_IW };
+    ptrdiff_t conv_user_weights_sizes[4] = { OC, IC, 11, 11 };
+    ptrdiff_t conv_bias_sizes[4] = { OC };
+    ptrdiff_t conv_user_dst_sizes[4] = { BATCH, OC, CONV_OH, CONV_OW };
+    ptrdiff_t conv_strides[2] = { CONV_STRIDE, CONV_STRIDE };
+    ptrdiff_t conv_padding[2] = { CONV_PAD, CONV_PAD };
 
     float *conv_src = net_src;
     float *conv_weights = (float *)aligned_malloc(
@@ -350,10 +350,10 @@ mkldnn_status_t simple_net() {
      * strides: {POOL_STRIDE, POOL_STRIDE}
      */
 
-    int32_t pool_dst_sizes[4] = { BATCH, OC, POOL_OH, POOL_OW };
-    int32_t pool_kernel[2] = { 3, 3 };
-    int32_t pool_strides[2] = { POOL_STRIDE, POOL_STRIDE };
-    int32_t pool_padding[2] = { POOL_PAD, POOL_PAD };
+    ptrdiff_t pool_dst_sizes[4] = { BATCH, OC, POOL_OH, POOL_OW };
+    ptrdiff_t pool_kernel[2] = { 3, 3 };
+    ptrdiff_t pool_strides[2] = { POOL_STRIDE, POOL_STRIDE };
+    ptrdiff_t pool_padding[2] = { POOL_PAD, POOL_PAD };
 
     /* create pooling memory descriptor on dst descriptor
      *  from previous primitive */