Coverage Report

Created: 2021-09-21 22:26

/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
792
#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;
40
  ccv_nnc_cmd_autotune_f autotune;
41
} ccv_nnc_cmd_backend_registry_t;
42
43
static inline int ccv_nnc_tensor_hw(const ccv_nnc_tensor_param_t a, const int nd)
44
4.49k
{
45
4.49k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
4.49k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 262
CCV_NNC_MAX_DIM262
+ 1))
47
86
    return 0;
48
4.41k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 176
CCV_NNC_MAX_DIM176
+ 2) ||
49
4.41k
       
(4.23k
a.format == CCV_TENSOR_FORMAT_NCHW4.23k
&&
nd == 4.23k
CCV_NNC_MAX_DIM4.23k
+ 1))
50
180
    return 1;
51
4.23k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
4.23k
    return 2;
53
0
  return -1;
54
0
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_stream.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_micro.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_graph.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_parallel.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_nnc_tensor_hw
ccv_cnnp_dataframe_addons.c:ccv_nnc_tensor_hw
Line
Count
Source
44
27
{
45
27
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
27
    (a.format == CCV_TENSOR_FORMAT_NHWC && nd == CCV_NNC_MAX_DIM + 1))
47
27
    return 0;
48
0
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && nd == CCV_NNC_MAX_DIM + 2) ||
49
0
       (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 1))
50
0
    return 1;
51
0
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
0
    return 2;
53
0
  return -1;
54
0
}
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_cnnp_model.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_nnc_tensor_hw
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_nnc_tensor_hw
ccv_cnnp_model_addons.c:ccv_nnc_tensor_hw
Line
Count
Source
44
220
{
45
220
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
220
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 24
CCV_NNC_MAX_DIM24
+ 1))
47
0
    return 0;
48
220
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 24
CCV_NNC_MAX_DIM24
+ 2) ||
49
220
       
(196
a.format == CCV_TENSOR_FORMAT_NCHW196
&&
nd == 196
CCV_NNC_MAX_DIM196
+ 1))
50
24
    return 1;
51
196
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
196
    return 2;
53
0
  return -1;
54
0
}
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_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_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_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_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_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
44
2.17k
{
45
2.17k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
2.17k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 109
CCV_NNC_MAX_DIM109
+ 1))
47
38
    return 0;
48
2.13k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 71
CCV_NNC_MAX_DIM71
+ 2) ||
49
2.13k
       
(2.06k
a.format == CCV_TENSOR_FORMAT_NCHW2.06k
&&
nd == 2.06k
CCV_NNC_MAX_DIM2.06k
+ 1))
50
71
    return 1;
51
2.06k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
2.06k
    return 2;
53
0
  return -1;
54
0
}
Unexecuted instantiation: ccv_nnc_swish.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_sgd.c:ccv_nnc_tensor_hw
ccv_nnc_pool.c:ccv_nnc_tensor_hw
Line
Count
Source
44
2.06k
{
45
2.06k
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
2.06k
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 102
CCV_NNC_MAX_DIM102
+ 1))
47
21
    return 0;
48
2.04k
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 81
CCV_NNC_MAX_DIM81
+ 2) ||
49
2.04k
       
(1.96k
a.format == CCV_TENSOR_FORMAT_NCHW1.96k
&&
nd == 1.96k
CCV_NNC_MAX_DIM1.96k
+ 1))
50
83
    return 1;
51
1.96k
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
1.96k
    return 2;
53
0
  return -1;
54
0
}
Unexecuted instantiation: ccv_nnc_sigmoid_binary_crossentropy.c:ccv_nnc_tensor_hw
ccv_nnc_compression.c:ccv_nnc_tensor_hw
Line
Count
Source
44
10
{
45
10
  if ((a.format == CCV_TENSOR_FORMAT_CHWN) ||
46
10
    (a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 0
CCV_NNC_MAX_DIM0
+ 1))
47
0
    return 0;
48
10
  else if ((a.format == CCV_TENSOR_FORMAT_NHWC && 
nd == 0
CCV_NNC_MAX_DIM0
+ 2) ||
49
10
       (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 1))
50
2
    return 1;
51
8
  else if (a.format == CCV_TENSOR_FORMAT_NCHW && nd == CCV_NNC_MAX_DIM + 2)
52
8
    return 2;
53
0
  return -1;
54
0
}
Unexecuted instantiation: ccv_nnc_cmp.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_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_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
55
56
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)
57
3.30k
{
58
3.30k
  int i;
59
3.30k
  assert(a.format == b->format);
60
3.30k
  const int nd = ccv_nnc_tensor_nd(a.dim);
61
3.30k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
62
3.30k
  int hw = ccv_nnc_tensor_hw(a, nd);
63
3.30k
  assert(hw >= 0);
64
9.90k
  
for (i = 0; 3.30k
i < CCV_NNC_MAX_DIM;
i++6.60k
)
65
6.60k
  {
66
6.60k
    int stride = ccv_max(1, hint.stride.dim[i]);
67
6.60k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
68
6.60k
  }
69
3.30k
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_stream.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_micro.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_graph.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_parallel.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_model.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_nnc_hint_tensor_forward
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_nnc_hint_tensor_forward
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_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_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_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_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_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
57
2.17k
{
58
2.17k
  int i;
59
2.17k
  assert(a.format == b->format);
60
2.17k
  const int nd = ccv_nnc_tensor_nd(a.dim);
61
2.17k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
62
2.17k
  int hw = ccv_nnc_tensor_hw(a, nd);
63
2.17k
  assert(hw >= 0);
64
6.53k
  
for (i = 0; 2.17k
i < CCV_NNC_MAX_DIM;
i++4.35k
)
65
4.35k
  {
66
4.35k
    int stride = ccv_max(1, hint.stride.dim[i]);
67
4.35k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
68
4.35k
  }
69
2.17k
}
Unexecuted instantiation: ccv_nnc_swish.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_sgd.c:ccv_nnc_hint_tensor_forward
ccv_nnc_pool.c:ccv_nnc_hint_tensor_forward
Line
Count
Source
57
1.12k
{
58
1.12k
  int i;
59
1.12k
  assert(a.format == b->format);
60
1.12k
  const int nd = ccv_nnc_tensor_nd(a.dim);
61
1.12k
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
62
1.12k
  int hw = ccv_nnc_tensor_hw(a, nd);
63
1.12k
  assert(hw >= 0);
64
3.36k
  
for (i = 0; 1.12k
i < CCV_NNC_MAX_DIM;
i++2.24k
)
65
2.24k
  {
66
2.24k
    int stride = ccv_max(1, hint.stride.dim[i]);
67
2.24k
    b->dim[i + hw] = (a.dim[i + hw] + hint.border.begin[i] + hint.border.end[i] - cmd.size.dim[i]) / stride + 1;
68
2.24k
  }
69
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_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_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_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
70
71
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)
72
942
{
73
942
  int i;
74
942
  assert(a.format == b->format);
75
942
  const int nd = ccv_nnc_tensor_nd(a.dim);
76
942
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
77
942
  int hw = ccv_nnc_tensor_hw(a, nd);
78
942
  assert(hw >= 0);
79
2.82k
  
for (i = 0; 942
i < CCV_NNC_MAX_DIM;
i++1.88k
)
80
1.88k
  {
81
1.88k
    int stride = ccv_max(1, hint.stride.dim[i]);
82
1.88k
    b->dim[i + hw] = (a.dim[i + hw] - 1) * stride - hint.border.begin[i] - hint.border.end[i] + cmd.size.dim[i];
83
1.88k
  }
84
942
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_stream.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_micro.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_graph.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_parallel.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_model.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_nnc_hint_tensor_backward
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_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_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_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_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_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_dropout.c:ccv_nnc_hint_tensor_backward
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.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
72
942
{
73
942
  int i;
74
942
  assert(a.format == b->format);
75
942
  const int nd = ccv_nnc_tensor_nd(a.dim);
76
942
  assert(nd == CCV_NNC_MAX_DIM + 1 || nd == CCV_NNC_MAX_DIM + 2);
77
942
  int hw = ccv_nnc_tensor_hw(a, nd);
78
942
  assert(hw >= 0);
79
2.82k
  
for (i = 0; 942
i < CCV_NNC_MAX_DIM;
i++1.88k
)
80
1.88k
  {
81
1.88k
    int stride = ccv_max(1, hint.stride.dim[i]);
82
1.88k
    b->dim[i + hw] = (a.dim[i + hw] - 1) * stride - hint.border.begin[i] - hint.border.end[i] + cmd.size.dim[i];
83
1.88k
  }
84
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_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_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_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
85
86
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);
87
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);
88
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);
89
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);
90
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);
91
void ccv_nnc_print_tensor_info(const ccv_nnc_tensor_t* const tensor);
92
93
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])
94
1.13k
{
95
1.13k
  int i;
96
1.13k
  off_t offset = 0;
97
1.13k
  size_t step = CCV_GET_DATA_TYPE_SIZE(datatype);
98
1.13k
  const int nd = ccv_nnc_tensor_nd(inc);
99
2.41k
  for (i = nd - 1; i >= 0; 
i--1.27k
)
100
1.27k
  {
101
1.27k
    offset += ofs[i] * step;
102
1.27k
    step *= inc[i];
103
1.27k
  }
104
1.13k
  return offset;
105
1.13k
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_nnc_tensor_view_offset
ccv_nnc_tensor.c:ccv_nnc_tensor_view_offset
Line
Count
Source
94
138
{
95
138
  int i;
96
138
  off_t offset = 0;
97
138
  size_t step = CCV_GET_DATA_TYPE_SIZE(datatype);
98
138
  const int nd = ccv_nnc_tensor_nd(inc);
99
412
  for (i = nd - 1; i >= 0; 
i--274
)
100
274
  {
101
274
    offset += ofs[i] * step;
102
274
    step *= inc[i];
103
274
  }
104
138
  return offset;
105
138
}
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_stream.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_micro.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_graph.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_nnc_tensor_view_offset
ccv_nnc_symbolic_graph_compile.c:ccv_nnc_tensor_view_offset
Line
Count
Source
94
1.00k
{
95
1.00k
  int i;
96
1.00k
  off_t offset = 0;
97
1.00k
  size_t step = CCV_GET_DATA_TYPE_SIZE(datatype);
98
1.00k
  const int nd = ccv_nnc_tensor_nd(inc);
99
2.00k
  for (i = nd - 1; i >= 0; 
i--1.00k
)
100
1.00k
  {
101
1.00k
    offset += ofs[i] * step;
102
1.00k
    step *= inc[i];
103
1.00k
  }
104
1.00k
  return offset;
105
1.00k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_parallel.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_model.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_nnc_tensor_view_offset
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_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_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_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_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_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_dropout.c:ccv_nnc_tensor_view_offset
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.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_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_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_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
106
107
static inline void ccv_array_add_unique_int(ccv_array_t* ints, const int idx)
108
139k
{
109
139k
  int i;
110
554k
  for (i = 0; i < ints->rnum; 
i++414k
)
111
420k
    if (*(int*)ccv_array_get(ints, i) == idx)
112
5.74k
      return;
113
139k
  ccv_array_push(ints, &idx);
114
134k
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_stream.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_micro.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_array_add_unique_int
ccv_nnc_micro_simplify.c:ccv_array_add_unique_int
Line
Count
Source
108
204
{
109
204
  int i;
110
237
  for (i = 0; i < ints->rnum; 
i++33
)
111
33
    if (*(int*)ccv_array_get(ints, i) == idx)
112
0
      return;
113
204
  ccv_array_push(ints, &idx);
114
204
}
Unexecuted instantiation: ccv_nnc_graph.c:ccv_array_add_unique_int
ccv_nnc_symbolic_graph.c:ccv_array_add_unique_int
Line
Count
Source
108
26.3k
{
109
26.3k
  int i;
110
36.3k
  for (i = 0; i < ints->rnum; 
i++10.0k
)
111
10.1k
    if (*(int*)ccv_array_get(ints, i) == idx)
112
18
      return;
113
26.3k
  ccv_array_push(ints, &idx);
114
26.2k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_array_add_unique_int
ccv_nnc_symbolic_graph_compile.c:ccv_array_add_unique_int
Line
Count
Source
108
22.8k
{
109
22.8k
  int i;
110
23.5k
  for (i = 0; i < ints->rnum; 
i++677
)
111
679
    if (*(int*)ccv_array_get(ints, i) == idx)
112
2
      return;
113
22.8k
  ccv_array_push(ints, &idx);
114
22.8k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_array_add_unique_int
ccv_nnc_symbolic_graph_parallel.c:ccv_array_add_unique_int
Line
Count
Source
108
3.03k
{
109
3.03k
  int i;
110
375k
  for (i = 0; i < ints->rnum; 
i++372k
)
111
373k
    if (*(int*)ccv_array_get(ints, i) == idx)
112
1.31k
      return;
113
3.03k
  ccv_array_push(ints, &idx);
114
1.71k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_array_add_unique_int
ccv_nnc_dynamic_graph.c:ccv_array_add_unique_int
Line
Count
Source
108
87.0k
{
109
87.0k
  int i;
110
115k
  for (i = 0; i < ints->rnum; 
i++28.0k
)
111
32.2k
    if (*(int*)ccv_array_get(ints, i) == idx)
112
4.21k
      return;
113
87.0k
  ccv_array_push(ints, &idx);
114
82.7k
}
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_array_add_unique_int
ccv_cnnp_model.c:ccv_array_add_unique_int
Line
Count
Source
108
365
{
109
365
  int i;
110
4.08k
  for (i = 0; i < ints->rnum; 
i++3.72k
)
111
3.91k
    if (*(int*)ccv_array_get(ints, i) == idx)
112
194
      return;
113
365
  ccv_array_push(ints, &idx);
114
171
}
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_array_add_unique_int
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_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_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_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_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_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_dropout.c:ccv_array_add_unique_int
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.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_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_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_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
115
116
static inline void ccv_array_add_unique_uint(ccv_array_t* ints, const uint32_t idx)
117
5.61k
{
118
5.61k
  int i;
119
19.8k
  for (i = 0; i < ints->rnum; 
i++14.2k
)
120
16.6k
    if (*(uint32_t*)ccv_array_get(ints, i) == idx)
121
2.36k
      return;
122
5.61k
  ccv_array_push(ints, &idx);
123
3.25k
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_stream.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_micro.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_array_add_unique_uint
ccv_nnc_graph.c:ccv_array_add_unique_uint
Line
Count
Source
117
5.61k
{
118
5.61k
  int i;
119
19.8k
  for (i = 0; i < ints->rnum; 
i++14.2k
)
120
16.6k
    if (*(uint32_t*)ccv_array_get(ints, i) == idx)
121
2.36k
      return;
122
5.61k
  ccv_array_push(ints, &idx);
123
3.25k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_backward.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_parallel.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_simplify.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_model.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_array_add_unique_uint
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_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_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_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_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_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_dropout.c:ccv_array_add_unique_uint
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.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_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_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_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
124
125
#ifdef __cplusplus
126
#define REGISTER_COMMAND_BACKEND(x, y) extern "C" void _register_command_ ## x ## _backend_ ## y
127
#define REGISTER_COMMAND(x) extern "C" void _register_command_ ## x
128
#else
129
#define REGISTER_COMMAND_BACKEND(x, y) void _register_command_ ## x ## _backend_ ## y
130
#define REGISTER_COMMAND(x) void _register_command_ ## x
131
#endif
132
#define FIND_BACKEND(...)
133
#define FIND_FILE(...)
134
135
// x is the dimension.
136
// n[x] is the start point for the filter on y axis, so that we can avoid computing the padding.
137
// m[x] shows how long we should loop for filter on y axis, avoid computing the padding too.
138
#define SET_BORDER_OFFSET_SIZE_FOR(x, i, hint, wd, ad, n, m) \
139
120M
  do { \
140
120M
    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]); \
141
120M
    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])); \
142
120M
  } while (0)
143
144
// Defines common graph visit macros
145
146
// The visitor function / macro takes parameter visitor(node_type* node, int index, int term);
147
#define CCV_NNC_GRAPH_VISIT(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset, visitor) \
148
39.9k
  
do 15
{ \
149
39.9k
    /* Use the same data structure to do topological ordering. */ \
150
39.9k
    typedef struct { \
151
39.9k
      int8_t d; /* tag if this is the destination node. */ \
152
39.9k
      int8_t r; /* tag if this is reached as destination node. */ \
153
39.9k
      uint16_t c; /* number of incoming edges. */ \
154
39.9k
      int32_t edges; /* pointer to incoming edges list. */ \
155
39.9k
    } ccv_nnc_incoming_t; \
156
39.9k
    int _i_, _j_; \
157
39.9k
    /* Statistics of how many incoming edges for all nodes of a graph. */ \
158
39.9k
    int _incoming_edges_ = 0; \
159
240k
    for (_i_ = 0; _i_ < (node_size); 
_i_++200k
) /* assuming it is all reached */ \
160
200k
      _incoming_edges_ += ((nodes)[_i_].outgoings) ? 
(nodes)[_i_].outgoings->rnum148k
:
052.4k
; \
161
39.9k
    const int _heap_mem_ = (node_size + _incoming_edges_ > 1024); \
162
39.9k
    ccv_nnc_incoming_t* _incomings_; \
163
39.9k
    if (_heap_mem_) \
164
39.9k
      
_incomings_ = (ccv_nnc_incoming_t*)45
ccmalloc45
(sizeof(ccv_nnc_incoming_t) * (node_size) + sizeof(int32_t) * ((node_size) * 2 + _incoming_edges_)); \
165
39.9k
    else \
166
39.9k
      
_incomings_ = (ccv_nnc_incoming_t*)alloca39.8k
(sizeof(ccv_nnc_incoming_t) * (node_size) + sizeof(int32_t) * ((node_size) * 2 + _incoming_edges_)); \
167
39.9k
    memset(_incomings_, 0, sizeof(ccv_nnc_incoming_t) * (node_size)); \
168
39.9k
    int32_t* _exists_[2] = { \
169
39.9k
      (int32_t*)(_incomings_ + (node_size)), \
170
39.9k
      (int32_t*)(_incomings_ + (node_size)) + (node_size), \
171
39.9k
    }; \
172
39.9k
    int32_t* const _edges_ = _exists_[1] + (node_size); \
173
80.3k
    for (_i_ = 0; _i_ < (source_size); 
_i_++40.4k
) \
174
40.4k
    { \
175
40.4k
      assert((sources)[_i_].graph == _graph); \
176
40.4k
      _exists_[0][_i_] = (sources)[_i_].d; \
177
40.4k
    } \
178
39.9k
    int _exist_size_[2] = { \
179
39.9k
      (source_size), \
180
39.9k
      0, \
181
39.9k
    }; \
182
39.9k
    int _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
183
39.9k
    /* Gather statistics. */ \
184
173k
    while (_exist_size_[_p_] > 0) \
185
133k
    { \
186
133k
      _exist_size_[_q_] = 0; \
187
345k
      for (_i_ = 0; _i_ < _exist_size_[_p_]; 
_i_++211k
) \
188
211k
      { \
189
211k
        const int32_t _idx_ = _exists_[_p_][_i_]; \
190
211k
        if (_incomings_[_idx_].r == 1) \
191
211k
          
continue33.3k
; \
192
211k
        _incomings_[_idx_].r = 1; \
193
178k
        /* mark as not reached */ \
194
178k
        if ((nodes)[_idx_].outgoings) \
195
299k
          
for (_j_ = 0; 127k
_j_ < (nodes)[_idx_].outgoings->rnum;
_j_++171k
) \
196
171k
          { \
197
171k
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
198
171k
            ++_incomings_[d].c; \
199
171k
            _exists_[_q_][_exist_size_[_q_]] = d; \
200
171k
            ++_exist_size_[_q_]; \
201
171k
          } \
202
178k
      } \
203
133k
      /* swap p and q. */ \
204
133k
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
205
133k
    } \
206
39.9k
    /* Fill incoming edges. */ \
207
80.3k
    for (_i_ = 0; _i_ < (source_size); 
_i_++40.4k
) \
208
40.4k
    { \
209
40.4k
      assert((sources)[_i_].graph == _graph); \
210
40.4k
      _exists_[0][_i_] = (sources)[_i_].d; \
211
40.4k
    } \
212
39.9k
    _exist_size_[0] = (source_size); \
213
39.9k
    _exist_size_[1] = 0; \
214
39.9k
    _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
215
39.9k
    int _bump_ = 1; \
216
173k
    while (_exist_size_[_p_] > 0) \
217
133k
    { \
218
133k
      _exist_size_[_q_] = 0; \
219
345k
      for (_i_ = 0; _i_ < _exist_size_[_p_]; 
_i_++211k
) \
220
211k
      { \
221
211k
        const int32_t _idx_ = _exists_[_p_][_i_]; \
222
211k
        if (_incomings_[_idx_].r == 2) \
223
211k
          
continue33.3k
; \
224
211k
        _incomings_[_idx_].r = 2; \
225
178k
        /* mark as not reached */ \
226
178k
        if ((nodes)[_idx_].outgoings) \
227
299k
          
for (_j_ = 0; 127k
_j_ < (nodes)[_idx_].outgoings->rnum;
_j_++171k
) \
228
171k
          { \
229
171k
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
230
171k
            if (_incomings_[d].edges == 0) \
231
171k
            { \
232
137k
              _incomings_[d].edges = _bump_; \
233
137k
              _bump_ += _incomings_[d].c; \
234
137k
              _incomings_[d].c = 0; \
235
137k
            } \
236
171k
            _edges_[_incomings_[d].edges - 1 + _incomings_[d].c] = _idx_; \
237
171k
            ++_incomings_[d].c; \
238
171k
            _exists_[_q_][_exist_size_[_q_]] = d; \
239
171k
            ++_exist_size_[_q_]; \
240
171k
          } \
241
178k
      } \
242
133k
      /* swap p and q. */ \
243
133k
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
244
133k
    } \
245
39.9k
    /* Traverse back and mark r if it can be marked */ \
246
90.1k
    for (_i_ = 0; _i_ < (destination_size); 
_i_++50.2k
) \
247
50.2k
    { \
248
50.2k
      assert((destinations)[_i_].graph == _graph); \
249
50.2k
      _exists_[0][_i_] = (destinations)[_i_].d; \
250
50.2k
    } \
251
39.9k
    _exist_size_[0] = (destination_size); \
252
39.9k
    _exist_size_[1] = 0; \
253
39.9k
    _p_ = 0, _q_ = 1; /* ping, pong swap. */ \
254
169k
    while (_exist_size_[_p_] > 0) \
255
129k
    { \
256
129k
      _exist_size_[_q_] = 0; \
257
346k
      for (_i_ = 0; _i_ < _exist_size_[_p_]; 
_i_++216k
) \
258
216k
      { \
259
216k
        const int32_t _idx_ = _exists_[_p_][_i_]; \
260
216k
        if (_incomings_[_idx_].r != 2) /* If cannot be traversed in forward pass, cannot in backward pass. */ \
261
216k
          
continue40.5k
; \
262
216k
        _incomings_[_idx_].r = 3; \
263
176k
        /* mark as not reached */ \
264
176k
        if (_incomings_[_idx_].edges > 0) \
265
302k
          
for (_j_ = 0; 135k
_j_ < _incomings_[_idx_].c;
_j_++166k
) \
266
166k
          { \
267
166k
            const int d = _edges_[_incomings_[_idx_].edges - 1 + _j_]; \
268
166k
            _exists_[_q_][_exist_size_[_q_]] = d; \
269
166k
            ++_exist_size_[_q_]; \
270
166k
          } \
271
176k
      } \
272
129k
      /* swap p and q. */ \
273
129k
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
274
129k
    } \
275
90.1k
    for (_i_ = 0; _i_ < (destination_size); 
_i_++50.2k
) \
276
50.2k
    { \
277
50.2k
      assert((destinations)[_i_].graph == _graph); \
278
50.2k
      /* tagging destination nodes. */ \
279
50.2k
      _incomings_[(destinations)[_i_].d].d = 1; \
280
50.2k
    } \
281
80.3k
    
for (_i_ = 0; 39.9k
_i_ < (source_size);
_i_++40.4k
) \
282
40.4k
    { \
283
40.4k
      assert((sources)[_i_].graph == _graph); \
284
40.4k
      _exists_[0][_i_] = (sources)[_i_].d; \
285
40.4k
    } \
286
39.9k
    _p_ = 0; \
287
39.9k
    _q_ = 1; \
288
39.9k
    _exist_size_[0] = (source_size); \
289
39.9k
    _exist_size_[1] = 0; \
290
39.9k
    int _d_ = 0; \
291
39.9k
    /* After we have that statistics, we can do topsort and run the command. */ \
292
94.4k
    while (_exist_size_[_p_] > 0) \
293
54.5k
    { \
294
54.5k
      _exist_size_[_q_] = 0; \
295
230k
      for (_i_ = 0; _i_ < _exist_size_[_p_];) \
296
176k
      { \
297
176k
        const int32_t _idx_ = _exists_[_p_][_i_]; \
298
176k
        visitor(((nodes) + _idx_), (_idx_), (_incomings_[_idx_].d)); \
299
176k
        /* mark as reached */ \
300
176k
        if (_incomings_[_idx_].d) \
301
176k
        { \
302
50.2k
          ++_d_; \
303
50.2k
          _incomings_[_idx_].r = 4; \
304
50.2k
        } \
305
176k
        if ((nodes)[_idx_].outgoings) \
306
176k
        { \
307
126k
          if ((nodes)[_idx_].outgoings->rnum == 1) \
308
126k
          { \
309
101k
            /* Optimizing for the case have only one child. Go through that directly. */ \
310
101k
            const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, 0); \
311
101k
            --_incomings_[d].c; \
312
101k
            if (_incomings_[d].c == 0 && 
_incomings_[d].r == 398.6k
&&
_d_ < (destination_size)98.5k
) \
313
101k
            { \
314
98.5k
              _exists_[_p_][_i_] = d; \
315
98.5k
              continue; \
316
98.5k
            } \
317
101k
          } else \
318
126k
            
for (_j_ = 0; 24.4k
_j_ < (nodes)[_idx_].outgoings->rnum91.0k
;
_j_++66.6k
) \
319
66.6k
            { \
320
66.6k
              const int d = *(int*)ccv_array_get((nodes)[_idx_].outgoings, _j_); \
321
66.6k
              --_incomings_[d].c; \
322
66.6k
              /* If all incoming edges are consumed, and not all destination node are computed, push it into next round */ \
323
66.6k
              if (_incomings_[d].c == 0 && 
_incomings_[d].r == 337.3k
&&
_d_ < (destination_size)37.2k
) \
324
66.6k
              { \
325
37.2k
                _exists_[_q_][_exist_size_[_q_]] = d; \
326
37.2k
                ++_exist_size_[_q_]; \
327
37.2k
              } \
328
66.6k
            } \
329
126k
        } \
330
176k
        ++_i_; \
331
77.6k
      } \
332
54.5k
      /* swap p and q. */ \
333
54.5k
      CCV_SWAP(_p_, _q_, _i_ /* using i as temp holder */); \
334
54.5k
    } \
335
90.1k
    for (_i_ = 0; _i_ < (destination_size); 
_i_++50.2k
) \
336
50.2k
    { \
337
50.2k
      assert((destinations)[_i_].graph == _graph); \
338
50.2k
      /* skip if this is already reached. */ \
339
50.2k
      if (_incomings_[(destinations)[_i_].d].r == 4) \
340
50.2k
        
continue50.2k
; \
341
50.2k
      /* this destination node should have every incoming nodes consumed. */ \
342
50.2k
      
if (25
!(allow_subset)25
) \
343
25
        { assert(_incomings_[(destinations)[_i_].d].c == 0); } \
344
25
      else 
if (0
_incomings_[(destinations)[_i_].d].c > 00
) /* Otherwise if incoming is not satisfied, no need to execute (allow subset to get executed, that is). */ \
345
0
        continue; \
346
25
      /* fetch the info for destination node and exec current node. */ \
347
25
      visitor(((nodes) + (destinations)[_i_].d), ((destinations)[_i_].d), (_incomings_[(destinations)[_i_].d].d)); \
348
25
    } \
349
39.9k
    if (_heap_mem_) \
350
39.9k
      
ccfree45
(_incomings_)45
; \
351
39.9k
  } while (0);
352
353
typedef struct {
354
  int size;
355
  struct {
356
    int index;
357
    int term;
358
  } node[1];
359
} ccv_nnc_graph_visit_t;
360
361
static inline void ccv_nnc_graph_visit_free(ccv_nnc_graph_visit_t* graph_visit)
362
39.3k
{
363
39.3k
  ccfree(graph_visit);
364
39.3k
}
Unexecuted instantiation: ccv_nnc_cmd.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_tensor.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_tensor_io.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_stream.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_micro.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_micro_core.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_micro_interpret.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_micro_simplify.c:ccv_nnc_graph_visit_free
ccv_nnc_graph.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
6.46k
{
363
6.46k
  ccfree(graph_visit);
364
6.46k
}
ccv_nnc_symbolic_graph.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
8.84k
{
363
8.84k
  ccfree(graph_visit);
364
8.84k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:ccv_nnc_graph_visit_free
ccv_nnc_symbolic_graph_compile.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
6.10k
{
363
6.10k
  ccfree(graph_visit);
364
6.10k
}
ccv_nnc_symbolic_graph_backward.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
13.4k
{
363
13.4k
  ccfree(graph_visit);
364
13.4k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_while.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_graph_while.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_tensor_tape.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_symbolic_graph_case_of.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_graph_case_of.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_symbolic_graph_minimize.c:ccv_nnc_graph_visit_free
ccv_nnc_symbolic_graph_parallel.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
18
{
363
18
  ccfree(graph_visit);
364
18
}
ccv_nnc_symbolic_graph_simplify.c:ccv_nnc_graph_visit_free
Line
Count
Source
362
4.52k
{
363
4.52k
  ccfree(graph_visit);
364
4.52k
}
Unexecuted instantiation: ccv_nnc_symbolic_graph_memory_compression.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_graph_run.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_dataframe.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_model.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_model_io.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_model_core.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_cnnp_model_addons.c:ccv_nnc_graph_visit_free
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_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_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_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_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_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_dropout.c:ccv_nnc_graph_visit_free
Unexecuted instantiation: ccv_nnc_softmax_crossentropy.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_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_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_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
365
366
175k
#define CCV_NNC_GRAPH_VISIT_FOR1(graph_visit, nodes, _node_, _index_, _term_, ...) { \
367
175k
  int _i_; \
368
863k
  for (_i_ = 0; _i_ < (graph_visit)->size; 
_i_++688k
) { \
369
688k
    const int _index_ __attribute__((unused)) = (graph_visit)->node[_i_].index; \
370
688k
    const int _term_ __attribute__((unused)) = (graph_visit)->node[_i_].term; \
371
688k
    typeof ((nodes)) const _node_ __attribute__((unused)) = (nodes) + _index_; \
372
373
#define ccv_nnc_graph_visit_for(graph_visit, nodes, ...) \
374
175k
  CCV_NNC_GRAPH_VISIT_FOR1(graph_visit, nodes, ##__VA_ARGS__, _node_unused_, _index_unused_, _term_unused_)
375
376
675k
#define ccv_nnc_graph_visit_endfor } }
377
378
#define CCV_NNC_GRAPH_VISIT_NEW_VISITOR1(_, _index_, _term_) \
379
168k
  _visit_->node[_visit_->size].index = (_index_); \
380
168k
  _visit_->node[_visit_->size].term = (_term_); \
381
168k
  ++_visit_->size;
382
383
39.3k
#define ccv_nnc_graph_visit_new(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset) ({\
384
39.3k
  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)); \
385
39.3k
  _visit_->size = 0; \
386
168k
  
CCV_NNC_GRAPH_VISIT39.3k
(_graph, nodes, node_size, sources, source_size, destinations, destination_size, allow_subset, CCV_NNC_GRAPH_VISIT_NEW_VISITOR1); \
387
39.3k
  assert(_visit_->size <= (node_size)); \
388
39.3k
  _visit_; \
389
39.3k
})
390
391
#endif