Coverage Report

Created: 2022-08-03 23:52

/home/liu/buildslave/linux-x64-runtests/build/lib/nnc/ccv_nnc_internal.h
Line
Count
Source (jump to first uncovered line)
1
/**********************************************************
2
 * C-based/Cached/Core Computer Vision Library
3
 * Liu Liu, 2010-02-01
4
 **********************************************************/
5
6
/**********************************************************
7
 * CCV - Neural Network Collection
8
 **********************************************************/
9
10
#ifndef GUARD_ccv_nnc_internal_h
11
#define GUARD_ccv_nnc_internal_h
12
13
#include "ccv.h"
14
#include "ccv_internal.h"
15
#include "nnc/ccv_nnc.h"
16
17
// Define some internal constraints
18
19
#define CCV_NNC_STACK_BITMASK_ALLOC (2)
20
#define CCV_NNC_TENSOR_PLACEHOLDER ((ccv_nnc_tensor_t*)(intptr_t)(0x10))
21
22
typedef void (*ccv_nnc_cmd_tensor_auto_f)(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size);
23
typedef int (*ccv_nnc_cmd_bitmask_f)(const int input_size, const int output_size, const uint64_t* const input_bitmasks, const int input_bitmask_size, const uint64_t* const output_bitmasks, const int output_bitmask_size);
24
typedef int (*ccv_nnc_cmd_inplace_f)(const int input_idx, const int input_size, const int output_idx, const int output_size);
25
26
typedef struct {
27
  int flags;
28
  ccv_nnc_cmd_bitmask_f bitmask;
29
  ccv_nnc_cmd_tensor_auto_f tensor_auto;
30
  ccv_nnc_cmd_inplace_f allow_inplace;
31
  ccv_nnc_cmd_inplace_f enforce_inplace;
32
} ccv_nnc_cmd_registry_t;
33
34
typedef struct {
35
  int tensor_formats; /**< [formats] The supported formats for this API implementation. */
36
  int tensor_datatypes; /**< [datatypes] The supported data types for this API implementation. */
37
  int tensor_memory; /**< [memory] The supported tensor memory type for this API implementation. */
38
  int algorithms; /**< [algorithms] Number of algorithms variation. */
39
  ccv_nnc_cmd_exec_f exec; /**< [exec] The function for command execution. */
40
  ccv_nnc_cmd_autotune_f autotune; /**< [autotune] The function to find the best algorithm to apply. */
41
  void* aux; /**< [aux] The additional information available for a particular command under a particular backend. */
42
} ccv_nnc_cmd_backend_registry_t;
43
44
static inline int ccv_nnc_tensor_hw(const ccv_nnc_tensor_param_t a, const int nd)
45
4.25k
{
46
4.25k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
47
4.25k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 211
CCV_NNC_MAX_DIM211
+ 1))
48
59
    return 0;
49
4.19k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 152
CCV_NNC_MAX_DIM152
+ 2) ||
50
4.19k
       
(4.04k
a.format == CCV_TENSOR_FORMAT_NCHW4.04k
&&
nd == 4.04k
CCV_NNC_MAX_DIM4.04k
+ 1))
51
156
    return 1;
52
4.03k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
53
4.03k
    return 2;
54
0
  return -1;
55
4.25k
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_hw
ccv_nnc_convolution.c:ccv_nnc_tensor_hw
Line
Count
Source
45
2.17k
{
46
2.17k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
47
2.17k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 109
CCV_NNC_MAX_DIM109
+ 1))
48
38
    return 0;
49
2.13k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 71
CCV_NNC_MAX_DIM71
+ 2) ||
50
2.13k
       
(2.06k
a.format == CCV_TENSOR_FORMAT_NCHW2.06k
&&
nd == 2.06k
CCV_NNC_MAX_DIM2.06k
+ 1))
51
71
    return 1;
52
2.06k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
53
2.06k
    return 2;
54
0
  return -1;
55
2.17k
}
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_tensor_hw
ccv_nnc_pool.c:ccv_nnc_tensor_hw
Line
Count
Source
45
2.06k
{
46
2.06k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
47
2.06k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 102
CCV_NNC_MAX_DIM102
+ 1))
48
21
    return 0;
49
2.04k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 81
CCV_NNC_MAX_DIM81
+ 2) ||
50
2.04k
       
(1.96k
a.format == CCV_TENSOR_FORMAT_NCHW1.96k
&&
nd == 1.96k
CCV_NNC_MAX_DIM1.96k
+ 1))
51
83
    return 1;
52
1.96k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
53
1.96k
    return 2;
54
0
  return -1;
55
2.06k
}
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_tensor_hw
ccv_nnc_compression.c:ccv_nnc_tensor_hw
Line
Count
Source
45
10
{
46
10
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
47
10
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 0
CCV_NNC_MAX_DIM0
+ 1))
48
0
    return 0;
49
10
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 0
CCV_NNC_MAX_DIM0
+ 2) ||
50
10
       (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 1))
51
2
    return 1;
52
8
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
53
8
    return 2;
54
0
  return -1;
55
10
}
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_hw
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_tensor_hw
56
57
static inline void ccv_nnc_hint_tensor_forward(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t a, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* b)
58
3.30k
{
59
3.30k
  int i;
60
3.30k
  assert(a.format == b->format);
61
3.30k
  const int nd = ccv_nnc_tensor_nd(a.dim);
62
3.30k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
63
3.30k
  int hw = ccv_nnc_tensor_hw(a, nd);
64
3.30k
  assert(hw >= 0);
65
9.90k
  
for (i = 0; 3.30k
i < CCV_NNC_MAX_DIM;
i++6.60k
)
66
6.60k
  {
67
6.60k
    int stride = ccv_max(1, hint.stride.dim[i]);
68
6.60k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
69
6.60k
  }
70
3.30k
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_hint_tensor_forward
ccv_nnc_convolution.c:ccv_nnc_hint_tensor_forward
Line
Count
Source
58
2.17k
{
59
2.17k
  int i;
60
2.17k
  assert(a.format == b->format);
61
2.17k
  const int nd = ccv_nnc_tensor_nd(a.dim);
62
2.17k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
63
2.17k
  int hw = ccv_nnc_tensor_hw(a, nd);
64
2.17k
  assert(hw >= 0);
65
6.53k
  
for (i = 0; 2.17k
i < CCV_NNC_MAX_DIM;
i++4.35k
)
66
4.35k
  {
67
4.35k
    int stride = ccv_max(1, hint.stride.dim[i]);
68
4.35k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
69
4.35k
  }
70
2.17k
}
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_hint_tensor_forward
ccv_nnc_pool.c:ccv_nnc_hint_tensor_forward
Line
Count
Source
58
1.12k
{
59
1.12k
  int i;
60
1.12k
  assert(a.format == b->format);
61
1.12k
  const int nd = ccv_nnc_tensor_nd(a.dim);
62
1.12k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
63
1.12k
  int hw = ccv_nnc_tensor_hw(a, nd);
64
1.12k
  assert(hw >= 0);
65
3.36k
  
for (i = 0; 1.12k
i < CCV_NNC_MAX_DIM;
i++2.24k
)
66
2.24k
  {
67
2.24k
    int stride = ccv_max(1, hint.stride.dim[i]);
68
2.24k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
69
2.24k
  }
70
1.12k
}
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_compression.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_hint_tensor_forward
71
72
static inline void ccv_nnc_hint_tensor_backward(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t a, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* b)
73
942
{
74
942
  int i;
75
942
  assert(a.format == b->format);
76
942
  const int nd = ccv_nnc_tensor_nd(a.dim);
77
942
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
78
942
  int hw = ccv_nnc_tensor_hw(a, nd);
79
942
  assert(hw >= 0);
80
2.82k
  
for (i = 0; 942
i < CCV_NNC_MAX_DIM;
i++1.88k
)
81
1.88k
  {
82
1.88k
    int stride = ccv_max(1, hint.stride.dim[i]);
83
1.88k
    b->dim[i + hw] = (a.dim[i + hw] - 1) * stride - hint.border.begin[i] - hint.border.end[i] + cmd.size.dim[i];
84
1.88k
  }
85
942
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_hint_tensor_backward
ccv_nnc_pool.c:ccv_nnc_hint_tensor_backward
Line
Count
Source
73
942
{
74
942
  int i;
75
942
  assert(a.format == b->format);
76
942
  const int nd = ccv_nnc_tensor_nd(a.dim);
77
942
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
78
942
  int hw = ccv_nnc_tensor_hw(a, nd);
79
942
  assert(hw >= 0);
80
2.82k
  
for (i = 0; 942
i < CCV_NNC_MAX_DIM;
i++1.88k
)
81
1.88k
  {
82
1.88k
    int stride = ccv_max(1, hint.stride.dim[i]);
83
1.88k
    b->dim[i + hw] = (a.dim[i + hw] - 1) * stride - hint.border.begin[i] - hint.border.end[i] + cmd.size.dim[i];
84
1.88k
  }
85
942
}
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_compression.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_hint_tensor_backward
86
87
void ccv_nnc_hint_tensor_auto_forward_from_inputs(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size);
88
void ccv_nnc_hint_tensor_auto_backward_from_gradient(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size);
89
void ccv_nnc_hint_tensor_auto_backward_from_inputs(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size);
90
void ccv_nnc_hint_tensor_auto_backward_from_gradient_and_inputs(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size);
91
int ccv_nnc_device_ids_for_io(ccv_nnc_tensor_t* const* const inputs, const int input_size, ccv_nnc_tensor_t* const* const outputs, const int output_size, const int tensor_type, int* const device_ids, const int max_device_id_size);
92
void ccv_nnc_print_tensor_info(const ccv_nnc_tensor_t* const tensor);
93
94
static inline off_t ccv_nnc_tensor_view_offset(const int datatype, const int inc[CCV_NNC_MAX_DIM_ALLOC], const int ofs[CCV_NNC_MAX_DIM_ALLOC])
95
0
{
96
0
  int i;
97
0
  off_t offset = 0;
98
0
  size_t step = CCV_GET_DATA_TYPE_SIZE(datatype);
99
0
  const int nd = ccv_nnc_tensor_nd(inc);
100
0
  for (i = nd - 1; i >= 0; i--)
101
0
  {
102
0
    offset += ofs[i] * step;
103
0
    step *= inc[i];
104
0
  }
105
0
  return offset;
106
0
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_pool.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_compression.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_tensor_view_offset
107
108
static inline int ccv_nnc_tensor_view_is_contiguous(const int dim[CCV_NNC_MAX_DIM_ALLOC], const int inc[CCV_NNC_MAX_DIM_ALLOC], const int ofs[CCV_NNC_MAX_DIM_ALLOC])
109
0
{
110
0
  // Check if a tensor view is contiguous.
111
0
  const int nd = ccv_nnc_tensor_nd(dim);
112
0
  int first_none_one_dim_idx = -1;
113
0
  int i;
114
0
  for (i = 0; first_none_one_dim_idx < 0 && i < nd; i++)
115
0
    if (dim[i] > 1)
116
0
      first_none_one_dim_idx = i;
117
0
  // If it is all 1, it is contiguous.
118
0
  if (first_none_one_dim_idx < 0)
119
0
    return 1;
120
0
  // Check if from 0 to first_none_one_dim_idx, it is 1.
121
0
  int no_inc = 1;
122
0
  assert(ofs[first_none_one_dim_idx] + dim[first_none_one_dim_idx] <= inc[first_none_one_dim_idx]);
123
0
  if (first_none_one_dim_idx < CCV_NNC_MAX_DIM_ALLOC)
124
0
    no_inc = (memcmp(inc + first_none_one_dim_idx + 1, dim + first_none_one_dim_idx + 1, sizeof(int) * (CCV_NNC_MAX_DIM_ALLOC - first_none_one_dim_idx - 1)) == 0);
125
0
  return no_inc;
126
0
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_pool.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_compression.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_tensor_view_is_contiguous
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_tensor_view_is_contiguous
127
128
static inline void ccv_array_add_unique_int(ccv_array_t* ints, const int idx)
129
0
{
130
0
  int i;
131
0
  for (i = 0; i < ints->rnum; i++)
132
0
    if (*(int*)ccv_array_get(ints, i) == idx)
133
0
      return;
134
0
  ccv_array_push(ints, &idx);
135
0
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_rand.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_swish.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_pool.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_compression.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_mse.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_relu.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_adam.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_nms.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_blas.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_array_add_unique_int
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_comm.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_util.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_ew.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_norm.c:ccv_array_add_unique_int
136
137
static inline void ccv_array_add_unique_uint(ccv_array_t* ints, const uint32_t idx)
138
0
{
139
0
  int i;
140
0
  for (i = 0; i < ints->rnum; i++)
141
0
    if (*(uint32_t*)ccv_array_get(ints, i) == idx)
142
0
      return;
143
0
  ccv_array_push(ints, &idx);
144
0
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_rand.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_swish.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_pool.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_compression.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_mse.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_relu.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_adam.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_nms.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_blas.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_array_add_unique_uint
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_comm.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_util.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_ew.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_norm.c:ccv_array_add_unique_uint
145
146
#ifdef __cplusplus
147
#define REGISTER_COMMAND_BACKEND(x, y) extern "C" void _register_command_ ## x ## _backend_ ## y
148
#define REGISTER_COMMAND(x) extern "C" void _register_command_ ## x
149
#else
150
#define REGISTER_COMMAND_BACKEND(x, y) void _register_command_ ## x ## _backend_ ## y
151
#define REGISTER_COMMAND(x) void _register_command_ ## x
152
#endif
153
#define FIND_BACKEND(...)
154
#define FIND_FILE(...)
155
156
// x is the dimension.
157
// n[x] is the start point for the filter on y axis, so that we can avoid computing the padding.
158
// m[x] shows how long we should loop for filter on y axis, avoid computing the padding too.
159
#define SET_BORDER_OFFSET_SIZE_FOR(x, i, hint, wd, ad, n, m) \
160
124M
  do { \
161
124M
    n[x] = ccv_max(i[x] * hint.stride.dim[x] - hint.border.begin[x], 0) - (i[x] * hint.stride.dim[x] - hint.border.begin[x]); \
162
124M
    m[x] = (wd)[x] - n[x] - (i[x] * hint.stride.dim[x] - hint.border.begin[x] + (wd)[x] - ccv_min(ad[x], i[x] * hint.stride.dim[x] - hint.border.begin[x] + (wd)[x])); \
163
124M
  } while (0)
164
165
// Defines common graph visit macros
166
167
// The visitor function / macro takes parameter visitor(node_type* node, int index, int term);
168
#define CCV_NNC_GRAPH_VISIT(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset, visitor) \
169
  do { \
170
    /* Use the same data structure to do topological ordering. */ \
171
    typedef struct { \
172
      int8_t d; /* tag if this is the destination node. */ \
173
      int8_t r; /* tag if this is reached as destination node. */ \
174
      uint16_t c; /* number of incoming edges. */ \
175
      int32_t edges; /* pointer to incoming edges list. */ \
176
    } ccv_nnc_incoming_t; \
177
    int _i_, _j_; \
178
    /* Statistics of how many incoming edges for all nodes of a graph. */ \
179
    int _incoming_edges_ = 0; \
180
    for (_i_ = 0; _i_ < (node_size); _i_++) /* assuming it is all reached */ \
181
      _incoming_edges_ += ((nodes)[_i_].outgoings) ? (nodes)[_i_].outgoings->rnum : 0; \
182
    const int _heap_mem_ = (node_size + _incoming_edges_ > 1024); \
183
    ccv_nnc_incoming_t* _incomings_; \
184
    if (_heap_mem_) \
185
      _incomings_ = (ccv_nnc_incoming_t*)ccmalloc(sizeof(ccv_nnc_incoming_t) * (node_size) + sizeof(int32_t) * ((node_size) * 2 + _incoming_edges_)); \
186
    else \
187
      _incomings_ = (ccv_nnc_incoming_t*)alloca(sizeof(ccv_nnc_incoming_t) * (node_size) + sizeof(int32_t) * ((node_size) * 2 + _incoming_edges_)); \
188
    memset(_incomings_, 0, sizeof(ccv_nnc_incoming_t) * (node_size)); \
189
    int32_t* _exists_[2] = { \
190
      (int32_t*)(_incomings_ + (node_size)), \
191
      (int32_t*)(_incomings_ + (node_size)) + (node_size), \
192
    }; \
193
    int32_t* const _edges_ = _exists_[1] + (node_size); \
194
    for (_i_ = 0; _i_ < (source_size); _i_++) \
195
    { \
196
      assert((sources)[_i_].graph == _graph); \
197
      _exists_[0][_i_] = (sources)[_i_].d; \
198
    } \
199
    int _exist_size_[2] = { \
200
      (source_size), \
201
      0, \
202
    }; \
203
    int _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
204
    /* Gather statistics. */ \
205
    while (_exist_size_[_p_] > 0) \
206
    { \
207
      _exist_size_[_q_] = 0; \
208
      for (_i_ = 0; _i_ < _exist_size_[_p_]; _i_++) \
209
      { \
210
        const int32_t _idx_ = _exists_[_p_][_i_]; \
211
        if (_incomings_[_idx_].r == 1) \
212
          continue; \
213
        _incomings_[_idx_].r = 1; \
214
        /* mark as not reached */ \
215
        if ((nodes)[_idx_].outgoings) \
216
          for (_j_ = 0; _j_ < (nodes)[_idx_].outgoings->rnum; _j_++) \
217
          { \
218
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
219
            ++_incomings_[d].c; \
220
            _exists_[_q_][_exist_size_[_q_]] = d; \
221
            ++_exist_size_[_q_]; \
222
          } \
223
      } \
224
      /* swap p and q. */ \
225
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
226
    } \
227
    /* Fill incoming edges. */ \
228
    for (_i_ = 0; _i_ < (source_size); _i_++) \
229
    { \
230
      assert((sources)[_i_].graph == _graph); \
231
      _exists_[0][_i_] = (sources)[_i_].d; \
232
    } \
233
    _exist_size_[0] = (source_size); \
234
    _exist_size_[1] = 0; \
235
    _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
236
    int _bump_ = 1; \
237
    while (_exist_size_[_p_] > 0) \
238
    { \
239
      _exist_size_[_q_] = 0; \
240
      for (_i_ = 0; _i_ < _exist_size_[_p_]; _i_++) \
241
      { \
242
        const int32_t _idx_ = _exists_[_p_][_i_]; \
243
        if (_incomings_[_idx_].r == 2) \
244
          continue; \
245
        _incomings_[_idx_].r = 2; \
246
        /* mark as not reached */ \
247
        if ((nodes)[_idx_].outgoings) \
248
          for (_j_ = 0; _j_ < (nodes)[_idx_].outgoings->rnum; _j_++) \
249
          { \
250
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
251
            if (_incomings_[d].edges == 0) \
252
            { \
253
              _incomings_[d].edges = _bump_; \
254
              _bump_ += _incomings_[d].c; \
255
              _incomings_[d].c = 0; \
256
            } \
257
            _edges_[_incomings_[d].edges - 1 + _incomings_[d].c] = _idx_; \
258
            ++_incomings_[d].c; \
259
            _exists_[_q_][_exist_size_[_q_]] = d; \
260
            ++_exist_size_[_q_]; \
261
          } \
262
      } \
263
      /* swap p and q. */ \
264
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
265
    } \
266
    /* Traverse back and mark r if it can be marked */ \
267
    for (_i_ = 0; _i_ < (destination_size); _i_++) \
268
    { \
269
      assert((destinations)[_i_].graph == _graph); \
270
      _exists_[0][_i_] = (destinations)[_i_].d; \
271
    } \
272
    _exist_size_[0] = (destination_size); \
273
    _exist_size_[1] = 0; \
274
    _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
275
    while (_exist_size_[_p_] > 0) \
276
    { \
277
      _exist_size_[_q_] = 0; \
278
      for (_i_ = 0; _i_ < _exist_size_[_p_]; _i_++) \
279
      { \
280
        const int32_t _idx_ = _exists_[_p_][_i_]; \
281
        if (_incomings_[_idx_].r != 2) /* If cannot be traversed in forward pass, cannot in backward pass. */ \
282
          continue; \
283
        _incomings_[_idx_].r = 3; \
284
        /* mark as not reached */ \
285
        if (_incomings_[_idx_].edges > 0) \
286
          for (_j_ = 0; _j_ < _incomings_[_idx_].c; _j_++) \
287
          { \
288
            const int d = _edges_[_incomings_[_idx_].edges - 1 + _j_]; \
289
            _exists_[_q_][_exist_size_[_q_]] = d; \
290
            ++_exist_size_[_q_]; \
291
          } \
292
      } \
293
      /* swap p and q. */ \
294
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
295
    } \
296
    for (_i_ = 0; _i_ < (destination_size); _i_++) \
297
    { \
298
      assert((destinations)[_i_].graph == _graph); \
299
      /* tagging destination nodes. */ \
300
      _incomings_[(destinations)[_i_].d].d = 1; \
301
    } \
302
    for (_i_ = 0; _i_ < (source_size); _i_++) \
303
    { \
304
      assert((sources)[_i_].graph == _graph); \
305
      _exists_[0][_i_] = (sources)[_i_].d; \
306
    } \
307
    _p_ = 0; \
308
    _q_ = 1; \
309
    _exist_size_[0] = (source_size); \
310
    _exist_size_[1] = 0; \
311
    int _d_ = 0; \
312
    /* After we have that statistics, we can do topsort and run the command. */ \
313
    while (_exist_size_[_p_] > 0) \
314
    { \
315
      _exist_size_[_q_] = 0; \
316
      for (_i_ = 0; _i_ < _exist_size_[_p_];) \
317
      { \
318
        const int32_t _idx_ = _exists_[_p_][_i_]; \
319
        visitor(((nodes) + _idx_), (_idx_), (_incomings_[_idx_].d)); \
320
        /* mark as reached */ \
321
        if (_incomings_[_idx_].d) \
322
        { \
323
          ++_d_; \
324
          _incomings_[_idx_].r = 4; \
325
        } \
326
        if ((nodes)[_idx_].outgoings) \
327
        { \
328
          if ((nodes)[_idx_].outgoings->rnum == 1) \
329
          { \
330
            /* Optimizing for the case have only one child. Go through that directly. */ \
331
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, 0); \
332
            --_incomings_[d].c; \
333
            if (_incomings_[d].c == 0 && _incomings_[d].r == 3 && _d_ < (destination_size)) \
334
            { \
335
              _exists_[_p_][_i_] = d; \
336
              continue; \
337
            } \
338
          } else \
339
            for (_j_ = 0; _j_ < (nodes)[_idx_].outgoings->rnum; _j_++) \
340
            { \
341
              const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
342
              --_incomings_[d].c; \
343
              /* If all incoming edges are consumed, and not all destination node are computed, push it into next round */ \
344
              if (_incomings_[d].c == 0 && _incomings_[d].r == 3 && _d_ < (destination_size)) \
345
              { \
346
                _exists_[_q_][_exist_size_[_q_]] = d; \
347
                ++_exist_size_[_q_]; \
348
              } \
349
            } \
350
        } \
351
        ++_i_; \
352
      } \
353
      /* swap p and q. */ \
354
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
355
    } \
356
    for (_i_ = 0; _i_ < (destination_size); _i_++) \
357
    { \
358
      assert((destinations)[_i_].graph == _graph); \
359
      /* skip if this is already reached. */ \
360
      if (_incomings_[(destinations)[_i_].d].r == 4) \
361
        continue; \
362
      /* this destination node should have every incoming nodes consumed. */ \
363
      if (!(allow_subset)) \
364
        { assert(_incomings_[(destinations)[_i_].d].c == 0); } \
365
      else if (_incomings_[(destinations)[_i_].d].c > 0) /* Otherwise if incoming is not satisfied, no need to execute (allow subset to get executed, that is). */ \
366
        continue; \
367
      /* fetch the info for destination node and exec current node. */ \
368
      visitor(((nodes) + (destinations)[_i_].d), ((destinations)[_i_].d), (_incomings_[(destinations)[_i_].d].d)); \
369
    } \
370
    if (_heap_mem_) \
371
      ccfree(_incomings_); \
372
  } while (0);
373
374
typedef struct {
375
  int size;
376
  struct {
377
    int index;
378
    int term;
379
  } node[1];
380
} ccv_nnc_graph_visit_t;
381
382
static inline void ccv_nnc_graph_visit_free(ccv_nnc_graph_visit_t* graph_visit)
383
0
{
384
0
  ccfree(graph_visit);
385
0
}
Unexecuted instantiation: ccv_nnc_rand_uniform_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_rand_normal_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_conv_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_conv_cpu_opt.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_swish_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dropout_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_softmax_crossentropy_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_tanh_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sgd_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_max_pool_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_avg_pool_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_lssc_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_min_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_max_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_histogram_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_softmax_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_binary_crossentropy_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_categorical_crossentropy_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_mse_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_smooth_l1_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_relu_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_adam_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_nms_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_gemm_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_gemm_cpu_opt.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_add_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_mul_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_upsample_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_util_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_roi_align_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sigmoid_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_index_select_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_rmsprop_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_lamb_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_ew_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_reduce_sum_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_reduce_max_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_reduce_norm2_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_argmax_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_batch_norm_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_layer_norm_cpu_ref.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_rand.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_conv_cpu_4x4_3x3_winograd.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_conv_cpu_fft.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_conv_cpu_gemm.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_conv_cpu_opt.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_convolution.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_swish.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_lstm.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dropout.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_tanh.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sgd.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_pool.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_compression.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_cmp.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_histogram.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_softmax.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_binary_crossentropy.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_categorical_crossentropy.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_mse.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_smooth_l1.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_relu.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_adam.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_nms.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_blas.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_gemm_cpu_opt.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: _ccv_nnc_gemm_cpu_sys.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_upsample.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_comm.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_util.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_roi_align.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_sigmoid.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_index_select.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_rmsprop.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_lamb.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_ew.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_reduce.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_norm.c:ccv_nnc_graph_visit_free
386
387
#define CCV_NNC_GRAPH_VISIT_FOR1(graph_visit, nodes, _node_, _index_, _term_, ...) { \
388
  int _i_; \
389
  for (_i_ = 0; _i_ < (graph_visit)->size; _i_++) { \
390
    const int _index_ __attribute__((unused)) = (graph_visit)->node[_i_].index; \
391
    const int _term_ __attribute__((unused)) = (graph_visit)->node[_i_].term; \
392
    typeof ((nodes)) const _node_ __attribute__((unused)) = (nodes) + _index_; \
393
394
#define ccv_nnc_graph_visit_for(graph_visit, nodes, ...) \
395
  CCV_NNC_GRAPH_VISIT_FOR1(graph_visit, nodes, ##__VA_ARGS__, _node_unused_, _index_unused_, _term_unused_)
396
397
#define ccv_nnc_graph_visit_endfor } }
398
399
#define CCV_NNC_GRAPH_VISIT_NEW_VISITOR1(_, _index_, _term_) \
400
  _visit_->node[_visit_->size].index = (_index_); \
401
  _visit_->node[_visit_->size].term = (_term_); \
402
  ++_visit_->size;
403
404
#define ccv_nnc_graph_visit_new(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset) ({\
405
  ccv_nnc_graph_visit_t* _visit_ = (ccv_nnc_graph_visit_t*)ccmalloc(sizeof(ccv_nnc_graph_visit_t) + sizeof(_visit_->node[0]) * ((node_size) - 1)); \
406
  _visit_->size = 0; \
407
  CCV_NNC_GRAPH_VISIT(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset, CCV_NNC_GRAPH_VISIT_NEW_VISITOR1); \
408
  assert(_visit_->size <= (node_size)); \
409
  _visit_; \
410
})
411
412
#endif