Coverage Report

Created: 2021-04-12 03:25

/home/liu/buildslave/linux-x64-runtests/build/lib/3rdparty/khash/khash.h
Line
Count
Source (jump to first uncovered line)
1
/* The MIT License
2
3
   Copyright (c) 2008, 2009, 2011 by Attractive Chaos <attractor@live.co.uk>
4
5
   Permission is hereby granted, free of charge, to any person obtaining
6
   a copy of this software and associated documentation files (the
7
   "Software"), to deal in the Software without restriction, including
8
   without limitation the rights to use, copy, modify, merge, publish,
9
   distribute, sublicense, and/or sell copies of the Software, and to
10
   permit persons to whom the Software is furnished to do so, subject to
11
   the following conditions:
12
13
   The above copyright notice and this permission notice shall be
14
   included in all copies or substantial portions of the Software.
15
16
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
   SOFTWARE.
24
*/
25
26
/*
27
  An example:
28
29
#include "khash.h"
30
KHASH_MAP_INIT_INT(32, char)
31
int main() {
32
  int ret, is_missing;
33
  khiter_t k;
34
  khash_t(32) *h = kh_init(32);
35
  k = kh_put(32, h, 5, &ret);
36
  kh_value(h, k) = 10;
37
  k = kh_get(32, h, 10);
38
  is_missing = (k == kh_end(h));
39
  k = kh_get(32, h, 5);
40
  kh_del(32, h, k);
41
  for (k = kh_begin(h); k != kh_end(h); ++k)
42
    if (kh_exist(h, k)) kh_value(h, k) = 1;
43
  kh_destroy(32, h);
44
  return 0;
45
}
46
*/
47
48
/*
49
  2013-05-02 (0.2.8):
50
51
  * Use quadratic probing. When the capacity is power of 2, stepping function
52
    i*(i+1)/2 guarantees to traverse each bucket. It is better than double
53
    hashing on cache performance and is more robust than linear probing.
54
55
    In theory, double hashing should be more robust than quadratic probing.
56
    However, my implementation is probably not for large hash tables, because
57
    the second hash function is closely tied to the first hash function,
58
    which reduce the effectiveness of double hashing.
59
60
  Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php
61
62
  2011-12-29 (0.2.7):
63
64
    * Minor code clean up; no actual effect.
65
66
  2011-09-16 (0.2.6):
67
68
  * The capacity is a power of 2. This seems to dramatically improve the
69
    speed for simple keys. Thank Zilong Tan for the suggestion. Reference:
70
71
     - http://code.google.com/p/ulib/
72
     - http://nothings.org/computer/judy/
73
74
  * Allow to optionally use linear probing which usually has better
75
    performance for random input. Double hashing is still the default as it
76
    is more robust to certain non-random input.
77
78
  * Added Wang's integer hash function (not used by default). This hash
79
    function is more robust to certain non-random input.
80
81
  2011-02-14 (0.2.5):
82
83
    * Allow to declare global functions.
84
85
  2009-09-26 (0.2.4):
86
87
    * Improve portability
88
89
  2008-09-19 (0.2.3):
90
91
  * Corrected the example
92
  * Improved interfaces
93
94
  2008-09-11 (0.2.2):
95
96
  * Improved speed a little in kh_put()
97
98
  2008-09-10 (0.2.1):
99
100
  * Added kh_clear()
101
  * Fixed a compiling error
102
103
  2008-09-02 (0.2.0):
104
105
  * Changed to token concatenation which increases flexibility.
106
107
  2008-08-31 (0.1.2):
108
109
  * Fixed a bug in kh_get(), which has not been tested previously.
110
111
  2008-08-31 (0.1.1):
112
113
  * Added destructor
114
*/
115
116
117
#ifndef __AC_KHASH_H
118
#define __AC_KHASH_H
119
120
/*!
121
  @header
122
123
  Generic hash table library.
124
 */
125
126
#define AC_VERSION_KHASH_H "0.2.8"
127
128
#include <stdlib.h>
129
#include <string.h>
130
#include <limits.h>
131
132
/* compiler specific configuration */
133
134
#if UINT_MAX == 0xffffffffu
135
typedef unsigned int khint32_t;
136
#elif ULONG_MAX == 0xffffffffu
137
typedef unsigned long khint32_t;
138
#endif
139
140
#if ULONG_MAX == ULLONG_MAX
141
typedef unsigned long khint64_t;
142
#else
143
typedef unsigned long long khint64_t;
144
#endif
145
146
#ifndef kh_inline
147
#ifdef _MSC_VER
148
#define kh_inline __inline
149
#else
150
#define kh_inline inline
151
#endif
152
#endif /* kh_inline */
153
154
#ifndef klib_unused
155
#if (defined __clang__ && __clang_major__ >= 3) || (defined __GNUC__ && __GNUC__ >= 3)
156
#define klib_unused __attribute__ ((__unused__))
157
#else
158
#define klib_unused
159
#endif
160
#endif /* klib_unused */
161
162
typedef khint32_t khint_t;
163
typedef khint_t khiter_t;
164
165
10.5M
#define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2)
166
9.34M
#define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1)
167
3.16M
#define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3)
168
#define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1ul<<((i&0xfU)<<1)))
169
202k
#define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1)))
170
184k
#define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1)))
171
203k
#define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1))
172
173
3.49k
#define __ac_fsize(m) ((m) < 16? 
13.43k
:
(m)>>457
)
174
175
#ifndef kroundup32
176
3.49k
#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x))
177
#endif
178
179
#ifndef kcalloc
180
8.57k
#define kcalloc(N,Z) calloc(N,Z)
181
#endif
182
#ifndef kmalloc
183
3.49k
#define kmalloc(Z) malloc(Z)
184
#endif
185
#ifndef krealloc
186
6.98k
#define krealloc(P,Z) realloc(P,Z)
187
#endif
188
#ifndef kfree
189
37.8k
#define kfree(P) free(P)
190
#endif
191
192
static const double __ac_HASH_UPPER = 0.77;
193
194
#define __KHASH_TYPE(name, khkey_t, khval_t) \
195
  typedef struct kh_##name##_s { \
196
    khint_t n_buckets, size, n_occupied, upper_bound; \
197
    khint32_t *flags; \
198
    khkey_t *keys; \
199
    khval_t *vals; \
200
  } kh_##name##_t;
201
202
#define __KHASH_PROTOTYPES(name, khkey_t, khval_t)            \
203
  extern kh_##name##_t *kh_init_##name(void);             \
204
  extern void kh_destroy_##name(kh_##name##_t *h);          \
205
  extern void kh_clear_##name(kh_##name##_t *h);            \
206
  extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key);  \
207
  extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \
208
  extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \
209
  extern void kh_del_##name(kh_##name##_t *h, khint_t x);
210
211
#define __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
212
8.57k
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
8.57k
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
8.57k
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_init_stream_map
Unexecuted instantiation: tape.tests.c:kh_init_stream_map
imdb.tests.c:kh_init_vocab_map
Line
Count
Source
212
2
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
2
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
2
  }                                  \
Unexecuted instantiation: ccv_nnc_cmd.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_init_stream_map
ccv_nnc_micro.c:kh_init_ccv_nnc_ids
Line
Count
Source
212
3
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
3
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
3
  }                                  \
ccv_nnc_micro.c:kh_init_ccv_nnc_micro_bind_scalar
Line
Count
Source
212
3
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
3
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
3
  }                                  \
ccv_nnc_micro_simplify.c:kh_init_ccv_nnc_axis_id_group
Line
Count
Source
212
6
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
6
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
6
  }                                  \
Unexecuted instantiation: ccv_nnc_graph.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_init_stream_map
ccv_nnc_dynamic_graph.c:kh_init_dy_str
Line
Count
Source
212
41
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
41
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
41
  }                                  \
ccv_nnc_dynamic_graph.c:kh_init_dy_alloc
Line
Count
Source
212
41
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
41
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
41
  }                                  \
ccv_nnc_dynamic_graph.c:kh_init_stream_map
Line
Count
Source
212
10
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
10
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
10
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_init_dy_dev
ccv_nnc_dynamic_graph_alloc.c:kh_init_dy_dev
Line
Count
Source
212
18
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
18
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
18
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_init_ctx
Line
Count
Source
212
52
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
52
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
52
  }                                  \
ccv_cnnp_dataframe.c:kh_init_iter_ctx
Line
Count
Source
212
4
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
4
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
4
  }                                  \
ccv_cnnp_model.c:kh_init_ccv_cnnp_model_name_bank
Line
Count
Source
212
4.51k
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
4.51k
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
4.51k
  }                                  \
ccv_cnnp_model.c:kh_init_stream_map
Line
Count
Source
212
4
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
4
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
4
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_ccv_cnnp_model_name_bank
ccv_cnnp_model_core.c:kh_init_ccv_cnnp_model_name_bank
Line
Count
Source
212
2.86k
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
2.86k
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
2.86k
  }                                  \
ccv_cnnp_model_core.c:kh_init_model
Line
Count
Source
212
1.00k
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
1.00k
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
1.00k
  }                                  \
ccv_cnnp_model_core.c:kh_init_model_io
Line
Count
Source
212
8
  SCOPE kh_##name##_t *kh_init_##name(void) {             \
213
8
    return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
214
8
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_init_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_ccv_cnnp_model_name_bank
215
  SCOPE void kh_destroy_##name(kh_##name##_t *h)            \
216
8.57k
  {                                 \
217
8.57k
    if (h) {                           \
218
8.57k
      kfree((void *)h->keys); kfree(h->flags);         \
219
8.57k
      kfree((void *)h->vals);                    \
220
8.57k
      kfree(h);                          \
221
8.57k
    }                               \
222
8.57k
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_destroy_stream_map
Unexecuted instantiation: tape.tests.c:kh_destroy_stream_map
imdb.tests.c:kh_destroy_vocab_map
Line
Count
Source
216
2
  {                                 \
217
2
    if (h) {                           \
218
2
      kfree((void *)h->keys); kfree(h->flags);         \
219
2
      kfree((void *)h->vals);                    \
220
2
      kfree(h);                          \
221
2
    }                               \
222
2
  }                                  \
Unexecuted instantiation: ccv_nnc_cmd.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_destroy_stream_map
ccv_nnc_micro.c:kh_destroy_ccv_nnc_ids
Line
Count
Source
216
3
  {                                 \
217
3
    if (h) {                           \
218
3
      kfree((void *)h->keys); kfree(h->flags);         \
219
3
      kfree((void *)h->vals);                    \
220
3
      kfree(h);                          \
221
3
    }                               \
222
3
  }                                  \
ccv_nnc_micro.c:kh_destroy_ccv_nnc_micro_bind_scalar
Line
Count
Source
216
3
  {                                 \
217
3
    if (h) {                           \
218
3
      kfree((void *)h->keys); kfree(h->flags);         \
219
3
      kfree((void *)h->vals);                    \
220
3
      kfree(h);                          \
221
3
    }                               \
222
3
  }                                  \
ccv_nnc_micro_simplify.c:kh_destroy_ccv_nnc_axis_id_group
Line
Count
Source
216
6
  {                                 \
217
6
    if (h) {                           \
218
6
      kfree((void *)h->keys); kfree(h->flags);         \
219
6
      kfree((void *)h->vals);                    \
220
6
      kfree(h);                          \
221
6
    }                               \
222
6
  }                                  \
Unexecuted instantiation: ccv_nnc_graph.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_destroy_stream_map
ccv_nnc_dynamic_graph.c:kh_destroy_stream_map
Line
Count
Source
216
10
  {                                 \
217
10
    if (h) {                           \
218
10
      kfree((void *)h->keys); kfree(h->flags);         \
219
10
      kfree((void *)h->vals);                    \
220
10
      kfree(h);                          \
221
10
    }                               \
222
10
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_dy_alloc
ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_dev
Line
Count
Source
216
18
  {                                 \
217
18
    if (h) {                           \
218
18
      kfree((void *)h->keys); kfree(h->flags);         \
219
18
      kfree((void *)h->vals);                    \
220
18
      kfree(h);                          \
221
18
    }                               \
222
18
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_alloc
Line
Count
Source
216
41
  {                                 \
217
41
    if (h) {                           \
218
41
      kfree((void *)h->keys); kfree(h->flags);         \
219
41
      kfree((void *)h->vals);                    \
220
41
      kfree(h);                          \
221
41
    }                               \
222
41
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_str
Line
Count
Source
216
41
  {                                 \
217
41
    if (h) {                           \
218
41
      kfree((void *)h->keys); kfree(h->flags);         \
219
41
      kfree((void *)h->vals);                    \
220
41
      kfree(h);                          \
221
41
    }                               \
222
41
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_destroy_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_destroy_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_destroy_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_destroy_iter_ctx
Line
Count
Source
216
4
  {                                 \
217
4
    if (h) {                           \
218
4
      kfree((void *)h->keys); kfree(h->flags);         \
219
4
      kfree((void *)h->vals);                    \
220
4
      kfree(h);                          \
221
4
    }                               \
222
4
  }                                  \
ccv_cnnp_dataframe.c:kh_destroy_ctx
Line
Count
Source
216
52
  {                                 \
217
52
    if (h) {                           \
218
52
      kfree((void *)h->keys); kfree(h->flags);         \
219
52
      kfree((void *)h->vals);                    \
220
52
      kfree(h);                          \
221
52
    }                               \
222
52
  }                                  \
ccv_cnnp_model.c:kh_destroy_ccv_cnnp_model_name_bank
Line
Count
Source
216
4.51k
  {                                 \
217
4.51k
    if (h) {                           \
218
4.51k
      kfree((void *)h->keys); kfree(h->flags);         \
219
4.51k
      kfree((void *)h->vals);                    \
220
4.51k
      kfree(h);                          \
221
4.51k
    }                               \
222
4.51k
  }                                  \
ccv_cnnp_model.c:kh_destroy_stream_map
Line
Count
Source
216
4
  {                                 \
217
4
    if (h) {                           \
218
4
      kfree((void *)h->keys); kfree(h->flags);         \
219
4
      kfree((void *)h->vals);                    \
220
4
      kfree(h);                          \
221
4
    }                               \
222
4
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_ccv_cnnp_model_name_bank
ccv_cnnp_model_core.c:kh_destroy_ccv_cnnp_model_name_bank
Line
Count
Source
216
2.86k
  {                                 \
217
2.86k
    if (h) {                           \
218
2.86k
      kfree((void *)h->keys); kfree(h->flags);         \
219
2.86k
      kfree((void *)h->vals);                    \
220
2.86k
      kfree(h);                          \
221
2.86k
    }                               \
222
2.86k
  }                                  \
ccv_cnnp_model_core.c:kh_destroy_model
Line
Count
Source
216
1.00k
  {                                 \
217
1.00k
    if (h) {                           \
218
1.00k
      kfree((void *)h->keys); kfree(h->flags);         \
219
1.00k
      kfree((void *)h->vals);                    \
220
1.00k
      kfree(h);                          \
221
1.00k
    }                               \
222
1.00k
  }                                  \
ccv_cnnp_model_core.c:kh_destroy_model_io
Line
Count
Source
216
8
  {                                 \
217
8
    if (h) {                           \
218
8
      kfree((void *)h->keys); kfree(h->flags);         \
219
8
      kfree((void *)h->vals);                    \
220
8
      kfree(h);                          \
221
8
    }                               \
222
8
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_ccv_cnnp_model_name_bank
223
  SCOPE void kh_clear_##name(kh_##name##_t *h)            \
224
0
  {                                 \
225
0
    if (h && h->flags) {                      \
226
0
      memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \
227
0
      h->size = h->n_occupied = 0;                \
228
0
    }                               \
229
0
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_clear_stream_map
Unexecuted instantiation: tape.tests.c:kh_clear_stream_map
Unexecuted instantiation: imdb.tests.c:kh_clear_vocab_map
Unexecuted instantiation: ccv_nnc_cmd.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_micro.c:kh_clear_ccv_nnc_micro_bind_scalar
Unexecuted instantiation: ccv_nnc_micro.c:kh_clear_ccv_nnc_ids
Unexecuted instantiation: ccv_nnc_micro_simplify.c:kh_clear_ccv_nnc_axis_id_group
Unexecuted instantiation: ccv_nnc_graph.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_dataframe.c:kh_clear_ctx
Unexecuted instantiation: ccv_cnnp_dataframe.c:kh_clear_iter_ctx
Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_stream_map
Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_stream_map
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_model
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_model_io
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_clear_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_clear_ccv_cnnp_model_name_bank
230
  SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key)  \
231
2.53M
  {                                 \
232
2.53M
    if (h->n_buckets) {                       \
233
2.53M
      khint_t k, i, last, mask, step = 0; \
234
2.53M
      mask = h->n_buckets - 1;                  \
235
2.53M
      k = __hash_func(key); i = k & mask;              \
236
2.53M
      last = i; \
237
3.70M
      while (!__ac_isempty(h->flags, i) && 
(3.69M
__ac_isdel3.69M
(h->flags, i) ||
!3.69M
__hash_equal3.69M
(h->keys[i], key))) { \
238
1.16M
        i = (i + (++step)) & mask; \
239
1.16M
        if (i == last) 
return h->n_buckets0
; \
240
1.16M
      }                              \
241
2.53M
      return __ac_iseither(h->flags, i)? 
h->n_buckets6.35k
:
i2.52M
; \
242
2.53M
    } else 
return 0605
; \
243
2.53M
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_get_stream_map
Unexecuted instantiation: tape.tests.c:kh_get_stream_map
imdb.tests.c:kh_get_vocab_map
Line
Count
Source
231
123k
  {                                 \
232
123k
    if (h->n_buckets) {                       \
233
123k
      khint_t k, i, last, mask, step = 0; \
234
123k
      mask = h->n_buckets - 1;                  \
235
123k
      k = __hash_func(key); i = k & mask;              \
236
123k
      last = i; \
237
244k
      while (!__ac_isempty(h->flags, i) && 
(238k
__ac_isdel238k
(h->flags, i) ||
!238k
__hash_equal238k
(h->keys[i], key))) { \
238
120k
        i = (i + (++step)) & mask; \
239
120k
        if (i == last) 
return h->n_buckets0
; \
240
120k
      }                              \
241
123k
      return __ac_iseither(h->flags, i)? 
h->n_buckets5.40k
:
i117k
; \
242
123k
    } else 
return 00
; \
243
123k
  }                                  \
Unexecuted instantiation: ccv_nnc_cmd.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_get_stream_map
ccv_nnc_micro.c:kh_get_ccv_nnc_micro_bind_scalar
Line
Count
Source
231
10
  {                                 \
232
10
    if (h->n_buckets) {                       \
233
10
      khint_t k, i, last, mask, step = 0; \
234
10
      mask = h->n_buckets - 1;                  \
235
10
      k = __hash_func(key); i = k & mask;              \
236
10
      last = i; \
237
14
      while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
238
4
        i = (i + (++step)) & mask; \
239
4
        if (i == last) 
return h->n_buckets0
; \
240
4
      }                              \
241
10
      return __ac_iseither(h->flags, i)? 
h->n_buckets0
: i; \
242
10
    } else 
return 00
; \
243
10
  }                                  \
Unexecuted instantiation: ccv_nnc_micro.c:kh_get_ccv_nnc_ids
ccv_nnc_micro_simplify.c:kh_get_ccv_nnc_axis_id_group
Line
Count
Source
231
1.38k
  {                                 \
232
1.38k
    if (h->n_buckets) {                       \
233
923
      khint_t k, i, last, mask, step = 0; \
234
923
      mask = h->n_buckets - 1;                  \
235
923
      k = __hash_func(key); i = k & mask;              \
236
923
      last = i; \
237
1.11k
      while (!__ac_isempty(h->flags, i) && 
(244
__ac_isdel244
(h->flags, i) ||
!244
__hash_equal244
(h->keys[i], key))) { \
238
189
        i = (i + (++step)) & mask; \
239
189
        if (i == last) 
return h->n_buckets0
; \
240
189
      }                              \
241
923
      return __ac_iseither(h->flags, i)? 
h->n_buckets868
:
i55
; \
242
923
    } else 
return 0466
; \
243
1.38k
  }                                  \
Unexecuted instantiation: ccv_nnc_graph.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_dy_alloc
ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_dev
Line
Count
Source
231
678
  {                                 \
232
678
    if (h->n_buckets) {                       \
233
539
      khint_t k, i, last, mask, step = 0; \
234
539
      mask = h->n_buckets - 1;                  \
235
539
      k = __hash_func(key); i = k & mask;              \
236
539
      last = i; \
237
539
      while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
238
0
        i = (i + (++step)) & mask; \
239
0
        if (i == last) return h->n_buckets;           \
240
0
      }                              \
241
539
      return __ac_iseither(h->flags, i)? 
h->n_buckets0
: i; \
242
539
    } else 
return 0139
; \
243
678
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_str
Line
Count
Source
231
698
  {                                 \
232
698
    if (h->n_buckets) {                       \
233
698
      khint_t k, i, last, mask, step = 0; \
234
698
      mask = h->n_buckets - 1;                  \
235
698
      k = __hash_func(key); i = k & mask;              \
236
698
      last = i; \
237
1.14k
      while (!__ac_isempty(h->flags, i) && 
(1.10k
__ac_isdel1.10k
(h->flags, i) ||
!1.05k
__hash_equal1.05k
(h->keys[i], key))) { \
238
450
        i = (i + (++step)) & mask; \
239
450
        if (i == last) 
return h->n_buckets0
; \
240
450
      }                              \
241
698
      return __ac_iseither(h->flags, i)? 
h->n_buckets48
:
i650
; \
242
698
    } else 
return 00
; \
243
698
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_alloc
Line
Count
Source
231
696
  {                                 \
232
696
    if (h->n_buckets) {                       \
233
696
      khint_t k, i, last, mask, step = 0; \
234
696
      mask = h->n_buckets - 1;                  \
235
696
      k = __hash_func(key); i = k & mask;              \
236
696
      last = i; \
237
6.87k
      while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || 
!3.84k
__hash_equal3.84k
(h->keys[i], key))) { \
238
6.17k
        i = (i + (++step)) & mask; \
239
6.17k
        if (i == last) 
return h->n_buckets0
; \
240
6.17k
      }                              \
241
696
      return __ac_iseither(h->flags, i)? 
h->n_buckets0
: i; \
242
696
    } else 
return 00
; \
243
696
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_get_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_get_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_get_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_get_ctx
Line
Count
Source
231
2.40M
  {                                 \
232
2.40M
    if (h->n_buckets) {                       \
233
2.40M
      khint_t k, i, last, mask, step = 0; \
234
2.40M
      mask = h->n_buckets - 1;                  \
235
2.40M
      k = __hash_func(key); i = k & mask;              \
236
2.40M
      last = i; \
237
3.44M
      while (!__ac_isempty(h->flags, i) && 
(3.44M
__ac_isdel3.44M
(h->flags, i) ||
!3.44M
__hash_equal3.44M
(h->keys[i], key))) { \
238
1.03M
        i = (i + (++step)) & mask; \
239
1.03M
        if (i == last) 
return h->n_buckets0
; \
240
1.03M
      }                              \
241
2.40M
      return __ac_iseither(h->flags, i)? 
h->n_buckets40
:
i2.40M
; \
242
2.40M
    } else 
return 00
; \
243
2.40M
  }                                  \
Unexecuted instantiation: ccv_cnnp_dataframe.c:kh_get_iter_ctx
Unexecuted instantiation: ccv_cnnp_model.c:kh_get_stream_map
Unexecuted instantiation: ccv_cnnp_model.c:kh_get_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_get_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_get_ccv_cnnp_model_name_bank
ccv_cnnp_model_core.c:kh_get_model
Line
Count
Source
231
1
  {                                 \
232
1
    if (h->n_buckets) {                       \
233
1
      khint_t k, i, last, mask, step = 0; \
234
1
      mask = h->n_buckets - 1;                  \
235
1
      k = __hash_func(key); i = k & mask;              \
236
1
      last = i; \
237
5
      while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
238
4
        i = (i + (++step)) & mask; \
239
4
        if (i == last) 
return h->n_buckets0
; \
240
4
      }                              \
241
1
      return __ac_iseither(h->flags, i)? 
h->n_buckets0
: i; \
242
1
    } else 
return 00
; \
243
1
  }                                  \
ccv_cnnp_model_core.c:kh_get_model_io
Line
Count
Source
231
100
  {                                 \
232
100
    if (h->n_buckets) {                       \
233
100
      khint_t k, i, last, mask, step = 0; \
234
100
      mask = h->n_buckets - 1;                  \
235
100
      k = __hash_func(key); i = k & mask;              \
236
100
      last = i; \
237
378
      while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
238
278
        i = (i + (++step)) & mask; \
239
278
        if (i == last) 
return h->n_buckets0
; \
240
278
      }                              \
241
100
      return __ac_iseither(h->flags, i)? 
h->n_buckets0
: i; \
242
100
    } else 
return 00
; \
243
100
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_get_stream_map
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_get_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_get_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_get_ccv_cnnp_model_name_bank
244
  SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \
245
3.49k
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
3.49k
    khint32_t *new_flags = 0;                   \
247
3.49k
    khint_t j = 1;                          \
248
3.49k
    {                               \
249
3.49k
      kroundup32(new_n_buckets);                  \
250
3.49k
      if (new_n_buckets < 4) 
new_n_buckets = 43.39k
; \
251
3.49k
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
3.49k
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
3.49k
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
3.49k
        if (!new_flags) 
return -10
; \
255
3.49k
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
3.49k
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
3.49k
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
3.49k
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
3.49k
          h->keys = new_keys;                 \
260
3.49k
          if (kh_is_map) {                 \
261
3.49k
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
3.49k
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
3.49k
            h->vals = new_vals;               \
264
3.49k
          }                          \
265
3.49k
        } /* otherwise shrink */               \
266
3.49k
      }                             \
267
3.49k
    }                               \
268
3.49k
    if (j) { /* rehashing is needed */               \
269
266k
      for (j = 0; j != h->n_buckets; 
++j262k
) { \
270
262k
        if (__ac_iseither(h->flags, j) == 0) {         \
271
202k
          khkey_t key = h->keys[j];             \
272
202k
          khval_t val;                    \
273
202k
          khint_t new_mask;                 \
274
202k
          new_mask = new_n_buckets - 1;             \
275
202k
          if (kh_is_map) val = h->vals[j];         \
276
202k
          __ac_set_isdel_true(h->flags, j);          \
277
202k
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
202k
            khint_t k, i, step = 0; \
279
202k
            k = __hash_func(key);              \
280
202k
            i = k & new_mask;               \
281
269k
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask67.5k
; \
282
202k
            __ac_set_isempty_false(new_flags, i);     \
283
202k
            if (i < h->n_buckets && 
__ac_iseither100k
(h->flags, i) == 0100k
) { /* kick out the existing element */ \
284
205
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
205
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
205
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
202k
            } else { /* write the element and jump out of the loop */ \
288
202k
              h->keys[i] = key;             \
289
202k
              if (kh_is_map) h->vals[i] = val;     \
290
202k
              break;                    \
291
202k
            }                        \
292
202k
          }                          \
293
202k
        }                            \
294
262k
      }                              \
295
3.49k
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
3.49k
      kfree(h->flags); /* free the working space */        \
300
3.49k
      h->flags = new_flags;                   \
301
3.49k
      h->n_buckets = new_n_buckets;               \
302
3.49k
      h->n_occupied = h->size;                  \
303
3.49k
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
3.49k
    }                               \
305
3.49k
    return 0;                           \
306
3.49k
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_resize_stream_map
Unexecuted instantiation: tape.tests.c:kh_resize_stream_map
imdb.tests.c:kh_resize_vocab_map
Line
Count
Source
245
32
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
32
    khint32_t *new_flags = 0;                   \
247
32
    khint_t j = 1;                          \
248
32
    {                               \
249
32
      kroundup32(new_n_buckets);                  \
250
32
      if (new_n_buckets < 4) 
new_n_buckets = 42
; \
251
32
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
32
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
32
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
32
        if (!new_flags) 
return -10
; \
255
32
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
32
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
32
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
32
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
32
          h->keys = new_keys;                 \
260
32
          if (kh_is_map) {                 \
261
32
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
32
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
32
            h->vals = new_vals;               \
264
32
          }                          \
265
32
        } /* otherwise shrink */                \
266
32
      }                             \
267
32
    }                               \
268
32
    if (j) { /* rehashing is needed */               \
269
262k
      for (j = 0; j != h->n_buckets; 
++j262k
) { \
270
262k
        if (__ac_iseither(h->flags, j) == 0) {         \
271
201k
          khkey_t key = h->keys[j];             \
272
201k
          khval_t val;                    \
273
201k
          khint_t new_mask;                 \
274
201k
          new_mask = new_n_buckets - 1;             \
275
201k
          if (kh_is_map) val = h->vals[j];         \
276
201k
          __ac_set_isdel_true(h->flags, j);          \
277
201k
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
201k
            khint_t k, i, step = 0; \
279
201k
            k = __hash_func(key);              \
280
201k
            i = k & new_mask;               \
281
266k
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask64.9k
; \
282
201k
            __ac_set_isempty_false(new_flags, i);     \
283
201k
            if (i < h->n_buckets && 
__ac_iseither100k
(h->flags, i) == 0100k
) { /* kick out the existing element */ \
284
116
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
116
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
116
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
201k
            } else { /* write the element and jump out of the loop */ \
288
201k
              h->keys[i] = key;             \
289
201k
              if (kh_is_map) h->vals[i] = val;     \
290
201k
              break;                    \
291
201k
            }                        \
292
201k
          }                          \
293
201k
        }                            \
294
262k
      }                              \
295
32
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
32
      kfree(h->flags); /* free the working space */        \
300
32
      h->flags = new_flags;                   \
301
32
      h->n_buckets = new_n_buckets;               \
302
32
      h->n_occupied = h->size;                  \
303
32
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
32
    }                               \
305
32
    return 0;                           \
306
32
  }                                  \
Unexecuted instantiation: ccv_nnc_cmd.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_resize_stream_map
ccv_nnc_micro.c:kh_resize_ccv_nnc_ids
Line
Count
Source
245
3
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
3
    khint32_t *new_flags = 0;                   \
247
3
    khint_t j = 1;                          \
248
3
    {                               \
249
3
      kroundup32(new_n_buckets);                  \
250
3
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
3
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
3
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
3
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
3
        if (!new_flags) 
return -10
; \
255
3
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
3
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
3
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
3
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
3
          h->keys = new_keys;                 \
260
3
          if (kh_is_map) {                 \
261
0
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
0
            if (!new_vals) { kfree(new_flags); return -1; } \
263
0
            h->vals = new_vals;               \
264
0
          }                          \
265
3
        } /* otherwise shrink */                \
266
3
      }                             \
267
3
    }                               \
268
3
    if (j) { /* rehashing is needed */               \
269
3
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
3
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
3
      kfree(h->flags); /* free the working space */        \
300
3
      h->flags = new_flags;                   \
301
3
      h->n_buckets = new_n_buckets;               \
302
3
      h->n_occupied = h->size;                  \
303
3
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
3
    }                               \
305
3
    return 0;                           \
306
3
  }                                  \
ccv_nnc_micro.c:kh_resize_ccv_nnc_micro_bind_scalar
Line
Count
Source
245
1
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
1
    khint32_t *new_flags = 0;                   \
247
1
    khint_t j = 1;                          \
248
1
    {                               \
249
1
      kroundup32(new_n_buckets);                  \
250
1
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
1
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
1
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
1
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
1
        if (!new_flags) 
return -10
; \
255
1
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
1
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
1
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
1
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
1
          h->keys = new_keys;                 \
260
1
          if (kh_is_map) {                 \
261
1
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
1
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
1
            h->vals = new_vals;               \
264
1
          }                          \
265
1
        } /* otherwise shrink */                \
266
1
      }                             \
267
1
    }                               \
268
1
    if (j) { /* rehashing is needed */               \
269
1
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
1
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
1
      kfree(h->flags); /* free the working space */        \
300
1
      h->flags = new_flags;                   \
301
1
      h->n_buckets = new_n_buckets;               \
302
1
      h->n_occupied = h->size;                  \
303
1
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
1
    }                               \
305
1
    return 0;                           \
306
1
  }                                  \
ccv_nnc_micro_simplify.c:kh_resize_ccv_nnc_axis_id_group
Line
Count
Source
245
4
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
4
    khint32_t *new_flags = 0;                   \
247
4
    khint_t j = 1;                          \
248
4
    {                               \
249
4
      kroundup32(new_n_buckets);                  \
250
4
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
4
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
4
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
4
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
4
        if (!new_flags) 
return -10
; \
255
4
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
4
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
4
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
4
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
4
          h->keys = new_keys;                 \
260
4
          if (kh_is_map) {                 \
261
4
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
4
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
4
            h->vals = new_vals;               \
264
4
          }                          \
265
4
        } /* otherwise shrink */                \
266
4
      }                             \
267
4
    }                               \
268
4
    if (j) { /* rehashing is needed */               \
269
4
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
4
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
4
      kfree(h->flags); /* free the working space */        \
300
4
      h->flags = new_flags;                   \
301
4
      h->n_buckets = new_n_buckets;               \
302
4
      h->n_occupied = h->size;                  \
303
4
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
4
    }                               \
305
4
    return 0;                           \
306
4
  }                                  \
Unexecuted instantiation: ccv_nnc_graph.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_resize_stream_map
ccv_nnc_dynamic_graph.c:kh_resize_stream_map
Line
Count
Source
245
12
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
12
    khint32_t *new_flags = 0;                   \
247
12
    khint_t j = 1;                          \
248
12
    {                               \
249
12
      kroundup32(new_n_buckets);                  \
250
12
      if (new_n_buckets < 4) 
new_n_buckets = 410
; \
251
12
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
12
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
12
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
12
        if (!new_flags) 
return -10
; \
255
12
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
12
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
12
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
12
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
12
          h->keys = new_keys;                 \
260
12
          if (kh_is_map) {                 \
261
12
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
12
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
12
            h->vals = new_vals;               \
264
12
          }                          \
265
12
        } /* otherwise shrink */                \
266
12
      }                             \
267
12
    }                               \
268
12
    if (j) { /* rehashing is needed */               \
269
20
      for (j = 0; j != h->n_buckets; 
++j8
) { \
270
8
        if (__ac_iseither(h->flags, j) == 0) {         \
271
2
          khkey_t key = h->keys[j];             \
272
2
          khval_t val;                    \
273
2
          khint_t new_mask;                 \
274
2
          new_mask = new_n_buckets - 1;             \
275
2
          if (kh_is_map) val = h->vals[j];         \
276
2
          __ac_set_isdel_true(h->flags, j);          \
277
6
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
6
            khint_t k, i, step = 0; \
279
6
            k = __hash_func(key);              \
280
6
            i = k & new_mask;               \
281
12
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask6
; \
282
6
            __ac_set_isempty_false(new_flags, i);     \
283
6
            if (i < h->n_buckets && 
__ac_iseither4
(h->flags, i) == 04
) { /* kick out the existing element */ \
284
4
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
4
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
4
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
4
            } else { /* write the element and jump out of the loop */ \
288
2
              h->keys[i] = key;             \
289
2
              if (kh_is_map) h->vals[i] = val;     \
290
2
              break;                    \
291
2
            }                        \
292
6
          }                          \
293
2
        }                            \
294
8
      }                              \
295
12
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
12
      kfree(h->flags); /* free the working space */        \
300
12
      h->flags = new_flags;                   \
301
12
      h->n_buckets = new_n_buckets;               \
302
12
      h->n_occupied = h->size;                  \
303
12
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
12
    }                               \
305
12
    return 0;                           \
306
12
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_dy_alloc
ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_str
Line
Count
Source
245
11
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
11
    khint32_t *new_flags = 0;                   \
247
11
    khint_t j = 1;                          \
248
11
    {                               \
249
11
      kroundup32(new_n_buckets);                  \
250
11
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
11
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
11
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
11
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
11
        if (!new_flags) 
return -10
; \
255
11
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
11
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
11
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
11
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
11
          h->keys = new_keys;                 \
260
11
          if (kh_is_map) {                 \
261
11
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
11
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
11
            h->vals = new_vals;               \
264
11
          }                          \
265
11
        } /* otherwise shrink */                \
266
11
      }                             \
267
11
    }                               \
268
11
    if (j) { /* rehashing is needed */               \
269
11
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
11
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
11
      kfree(h->flags); /* free the working space */        \
300
11
      h->flags = new_flags;                   \
301
11
      h->n_buckets = new_n_buckets;               \
302
11
      h->n_occupied = h->size;                  \
303
11
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
11
    }                               \
305
11
    return 0;                           \
306
11
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_alloc
Line
Count
Source
245
34
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
34
    khint32_t *new_flags = 0;                   \
247
34
    khint_t j = 1;                          \
248
34
    {                               \
249
34
      kroundup32(new_n_buckets);                  \
250
34
      if (new_n_buckets < 4) 
new_n_buckets = 411
; \
251
34
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
34
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
34
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
34
        if (!new_flags) 
return -10
; \
255
34
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
34
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
32
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
32
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
32
          h->keys = new_keys;                 \
260
32
          if (kh_is_map) {                 \
261
32
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
32
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
32
            h->vals = new_vals;               \
264
32
          }                          \
265
32
        } /* otherwise shrink */               \
266
34
      }                             \
267
34
    }                               \
268
34
    if (j) { /* rehashing is needed */               \
269
374
      for (j = 0; j != h->n_buckets; 
++j340
) { \
270
340
        if (__ac_iseither(h->flags, j) == 0) {         \
271
196
          khkey_t key = h->keys[j];             \
272
196
          khval_t val;                    \
273
196
          khint_t new_mask;                 \
274
196
          new_mask = new_n_buckets - 1;             \
275
196
          if (kh_is_map) val = h->vals[j];         \
276
196
          __ac_set_isdel_true(h->flags, j);          \
277
247
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
247
            khint_t k, i, step = 0; \
279
247
            k = __hash_func(key);              \
280
247
            i = k & new_mask;               \
281
2.39k
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask2.14k
; \
282
247
            __ac_set_isempty_false(new_flags, i);     \
283
247
            if (i < h->n_buckets && 
__ac_iseither105
(h->flags, i) == 0105
) { /* kick out the existing element */ \
284
51
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
51
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
51
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
196
            } else { /* write the element and jump out of the loop */ \
288
196
              h->keys[i] = key;             \
289
196
              if (kh_is_map) h->vals[i] = val;     \
290
196
              break;                    \
291
196
            }                        \
292
247
          }                          \
293
196
        }                            \
294
340
      }                              \
295
34
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
34
      kfree(h->flags); /* free the working space */        \
300
34
      h->flags = new_flags;                   \
301
34
      h->n_buckets = new_n_buckets;               \
302
34
      h->n_occupied = h->size;                  \
303
34
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
34
    }                               \
305
34
    return 0;                           \
306
34
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_dev
Line
Count
Source
245
22
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
22
    khint32_t *new_flags = 0;                   \
247
22
    khint_t j = 1;                          \
248
22
    {                               \
249
22
      kroundup32(new_n_buckets);                  \
250
22
      if (new_n_buckets < 4) 
new_n_buckets = 418
; \
251
22
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
22
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
22
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
22
        if (!new_flags) 
return -10
; \
255
22
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
22
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
22
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
22
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
22
          h->keys = new_keys;                 \
260
22
          if (kh_is_map) {                 \
261
22
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
22
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
22
            h->vals = new_vals;               \
264
22
          }                          \
265
22
        } /* otherwise shrink */                \
266
22
      }                             \
267
22
    }                               \
268
22
    if (j) { /* rehashing is needed */               \
269
38
      for (j = 0; j != h->n_buckets; 
++j16
) { \
270
16
        if (__ac_iseither(h->flags, j) == 0) {         \
271
12
          khkey_t key = h->keys[j];             \
272
12
          khval_t val;                    \
273
12
          khint_t new_mask;                 \
274
12
          new_mask = new_n_buckets - 1;             \
275
12
          if (kh_is_map) val = h->vals[j];         \
276
12
          __ac_set_isdel_true(h->flags, j);          \
277
12
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
12
            khint_t k, i, step = 0; \
279
12
            k = __hash_func(key);              \
280
12
            i = k & new_mask;               \
281
12
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask0
; \
282
12
            __ac_set_isempty_false(new_flags, i);     \
283
12
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
12
            } else { /* write the element and jump out of the loop */ \
288
12
              h->keys[i] = key;             \
289
12
              if (kh_is_map) h->vals[i] = val;     \
290
12
              break;                    \
291
12
            }                       \
292
12
          }                         \
293
12
        }                            \
294
16
      }                              \
295
22
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
22
      kfree(h->flags); /* free the working space */        \
300
22
      h->flags = new_flags;                   \
301
22
      h->n_buckets = new_n_buckets;               \
302
22
      h->n_occupied = h->size;                  \
303
22
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
22
    }                               \
305
22
    return 0;                           \
306
22
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_resize_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_resize_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_resize_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_resize_ctx
Line
Count
Source
245
52
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
52
    khint32_t *new_flags = 0;                   \
247
52
    khint_t j = 1;                          \
248
52
    {                               \
249
52
      kroundup32(new_n_buckets);                  \
250
52
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
52
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
52
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
52
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
52
        if (!new_flags) 
return -10
; \
255
52
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
52
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
52
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
52
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
52
          h->keys = new_keys;                 \
260
52
          if (kh_is_map) {                 \
261
52
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
52
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
52
            h->vals = new_vals;               \
264
52
          }                          \
265
52
        } /* otherwise shrink */                \
266
52
      }                             \
267
52
    }                               \
268
52
    if (j) { /* rehashing is needed */               \
269
52
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
52
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
52
      kfree(h->flags); /* free the working space */        \
300
52
      h->flags = new_flags;                   \
301
52
      h->n_buckets = new_n_buckets;               \
302
52
      h->n_occupied = h->size;                  \
303
52
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
52
    }                               \
305
52
    return 0;                           \
306
52
  }                                  \
ccv_cnnp_dataframe.c:kh_resize_iter_ctx
Line
Count
Source
245
4
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
4
    khint32_t *new_flags = 0;                   \
247
4
    khint_t j = 1;                          \
248
4
    {                               \
249
4
      kroundup32(new_n_buckets);                  \
250
4
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
4
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
4
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
4
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
4
        if (!new_flags) 
return -10
; \
255
4
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
4
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
4
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
4
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
4
          h->keys = new_keys;                 \
260
4
          if (kh_is_map) {                 \
261
4
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
4
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
4
            h->vals = new_vals;               \
264
4
          }                          \
265
4
        } /* otherwise shrink */                \
266
4
      }                             \
267
4
    }                               \
268
4
    if (j) { /* rehashing is needed */               \
269
4
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
4
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
4
      kfree(h->flags); /* free the working space */        \
300
4
      h->flags = new_flags;                   \
301
4
      h->n_buckets = new_n_buckets;               \
302
4
      h->n_occupied = h->size;                  \
303
4
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
4
    }                               \
305
4
    return 0;                           \
306
4
  }                                  \
ccv_cnnp_model.c:kh_resize_ccv_cnnp_model_name_bank
Line
Count
Source
245
1.21k
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
1.21k
    khint32_t *new_flags = 0;                   \
247
1.21k
    khint_t j = 1;                          \
248
1.21k
    {                               \
249
1.21k
      kroundup32(new_n_buckets);                  \
250
1.21k
      if (new_n_buckets < 4) new_n_buckets = 4;         \
251
1.21k
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
1.21k
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
1.21k
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
1.21k
        if (!new_flags) 
return -10
; \
255
1.21k
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
1.21k
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
1.21k
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
1.21k
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
1.21k
          h->keys = new_keys;                 \
260
1.21k
          if (kh_is_map) {                 \
261
1.21k
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
1.21k
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
1.21k
            h->vals = new_vals;               \
264
1.21k
          }                          \
265
1.21k
        } /* otherwise shrink */                \
266
1.21k
      }                             \
267
1.21k
    }                               \
268
1.21k
    if (j) { /* rehashing is needed */               \
269
1.21k
      for (j = 0; j != h->n_buckets; 
++j0
) { \
270
0
        if (__ac_iseither(h->flags, j) == 0) {         \
271
0
          khkey_t key = h->keys[j];             \
272
0
          khval_t val;                    \
273
0
          khint_t new_mask;                 \
274
0
          new_mask = new_n_buckets - 1;             \
275
0
          if (kh_is_map) val = h->vals[j];         \
276
0
          __ac_set_isdel_true(h->flags, j);          \
277
0
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
0
            khint_t k, i, step = 0; \
279
0
            k = __hash_func(key);              \
280
0
            i = k & new_mask;               \
281
0
            while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \
282
0
            __ac_set_isempty_false(new_flags, i);     \
283
0
            if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \
284
0
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
0
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
0
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
0
            } else { /* write the element and jump out of the loop */ \
288
0
              h->keys[i] = key;             \
289
0
              if (kh_is_map) h->vals[i] = val;     \
290
0
              break;                    \
291
0
            }                       \
292
0
          }                         \
293
0
        }                           \
294
0
      }                              \
295
1.21k
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
1.21k
      kfree(h->flags); /* free the working space */        \
300
1.21k
      h->flags = new_flags;                   \
301
1.21k
      h->n_buckets = new_n_buckets;               \
302
1.21k
      h->n_occupied = h->size;                  \
303
1.21k
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
1.21k
    }                               \
305
1.21k
    return 0;                           \
306
1.21k
  }                                  \
ccv_cnnp_model.c:kh_resize_stream_map
Line
Count
Source
245
8
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
8
    khint32_t *new_flags = 0;                   \
247
8
    khint_t j = 1;                          \
248
8
    {                               \
249
8
      kroundup32(new_n_buckets);                  \
250
8
      if (new_n_buckets < 4) 
new_n_buckets = 44
; \
251
8
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
8
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
8
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
8
        if (!new_flags) 
return -10
; \
255
8
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
8
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
8
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
8
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
8
          h->keys = new_keys;                 \
260
8
          if (kh_is_map) {                 \
261
8
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
8
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
8
            h->vals = new_vals;               \
264
8
          }                          \
265
8
        } /* otherwise shrink */                \
266
8
      }                             \
267
8
    }                               \
268
8
    if (j) { /* rehashing is needed */               \
269
24
      for (j = 0; j != h->n_buckets; 
++j16
) { \
270
16
        if (__ac_iseither(h->flags, j) == 0) {         \
271
4
          khkey_t key = h->keys[j];             \
272
4
          khval_t val;                    \
273
4
          khint_t new_mask;                 \
274
4
          new_mask = new_n_buckets - 1;             \
275
4
          if (kh_is_map) val = h->vals[j];         \
276
4
          __ac_set_isdel_true(h->flags, j);          \
277
12
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
12
            khint_t k, i, step = 0; \
279
12
            k = __hash_func(key);              \
280
12
            i = k & new_mask;               \
281
24
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask12
; \
282
12
            __ac_set_isempty_false(new_flags, i);     \
283
12
            if (i < h->n_buckets && 
__ac_iseither8
(h->flags, i) == 08
) { /* kick out the existing element */ \
284
8
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
8
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
8
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
8
            } else { /* write the element and jump out of the loop */ \
288
4
              h->keys[i] = key;             \
289
4
              if (kh_is_map) h->vals[i] = val;     \
290
4
              break;                    \
291
4
            }                        \
292
12
          }                          \
293
4
        }                            \
294
16
      }                              \
295
8
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
8
      kfree(h->flags); /* free the working space */        \
300
8
      h->flags = new_flags;                   \
301
8
      h->n_buckets = new_n_buckets;               \
302
8
      h->n_occupied = h->size;                  \
303
8
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
8
    }                               \
305
8
    return 0;                           \
306
8
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_ccv_cnnp_model_name_bank
ccv_cnnp_model_core.c:kh_resize_ccv_cnnp_model_name_bank
Line
Count
Source
245
1.06k
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
1.06k
    khint32_t *new_flags = 0;                   \
247
1.06k
    khint_t j = 1;                          \
248
1.06k
    {                               \
249
1.06k
      kroundup32(new_n_buckets);                  \
250
1.06k
      if (new_n_buckets < 4) 
new_n_buckets = 41.04k
; \
251
1.06k
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
1.06k
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
1.06k
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
1.06k
        if (!new_flags) 
return -10
; \
255
1.06k
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
1.06k
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
1.06k
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
1.06k
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
1.06k
          h->keys = new_keys;                 \
260
1.06k
          if (kh_is_map) {                 \
261
1.06k
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
1.06k
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
1.06k
            h->vals = new_vals;               \
264
1.06k
          }                          \
265
1.06k
        } /* otherwise shrink */                \
266
1.06k
      }                             \
267
1.06k
    }                               \
268
1.06k
    if (j) { /* rehashing is needed */               \
269
1.12k
      for (j = 0; j != h->n_buckets; 
++j68
) { \
270
68
        if (__ac_iseither(h->flags, j) == 0) {         \
271
48
          khkey_t key = h->keys[j];             \
272
48
          khval_t val;                    \
273
48
          khint_t new_mask;                 \
274
48
          new_mask = new_n_buckets - 1;             \
275
48
          if (kh_is_map) val = h->vals[j];         \
276
48
          __ac_set_isdel_true(h->flags, j);          \
277
51
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
51
            khint_t k, i, step = 0; \
279
51
            k = __hash_func(key);              \
280
51
            i = k & new_mask;               \
281
57
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask6
; \
282
51
            __ac_set_isempty_false(new_flags, i);     \
283
51
            if (i < h->n_buckets && 
__ac_iseither20
(h->flags, i) == 020
) { /* kick out the existing element */ \
284
3
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
3
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
3
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
48
            } else { /* write the element and jump out of the loop */ \
288
48
              h->keys[i] = key;             \
289
48
              if (kh_is_map) h->vals[i] = val;     \
290
48
              break;                    \
291
48
            }                        \
292
51
          }                          \
293
48
        }                            \
294
68
      }                              \
295
1.06k
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
1.06k
      kfree(h->flags); /* free the working space */        \
300
1.06k
      h->flags = new_flags;                   \
301
1.06k
      h->n_buckets = new_n_buckets;               \
302
1.06k
      h->n_occupied = h->size;                  \
303
1.06k
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
1.06k
    }                               \
305
1.06k
    return 0;                           \
306
1.06k
  }                                  \
ccv_cnnp_model_core.c:kh_resize_model
Line
Count
Source
245
1.02k
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
1.02k
    khint32_t *new_flags = 0;                   \
247
1.02k
    khint_t j = 1;                          \
248
1.02k
    {                               \
249
1.02k
      kroundup32(new_n_buckets);                  \
250
1.02k
      if (new_n_buckets < 4) 
new_n_buckets = 41.00k
; \
251
1.02k
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
1.02k
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
1.02k
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
1.02k
        if (!new_flags) 
return -10
; \
255
1.02k
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
1.02k
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
1.02k
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
1.02k
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
1.02k
          h->keys = new_keys;                 \
260
1.02k
          if (kh_is_map) {                 \
261
1.02k
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
1.02k
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
1.02k
            h->vals = new_vals;               \
264
1.02k
          }                          \
265
1.02k
        } /* otherwise shrink */                \
266
1.02k
      }                             \
267
1.02k
    }                               \
268
1.02k
    if (j) { /* rehashing is needed */               \
269
1.17k
      for (j = 0; j != h->n_buckets; 
++j148
) { \
270
148
        if (__ac_iseither(h->flags, j) == 0) {         \
271
93
          khkey_t key = h->keys[j];             \
272
93
          khval_t val;                    \
273
93
          khint_t new_mask;                 \
274
93
          new_mask = new_n_buckets - 1;             \
275
93
          if (kh_is_map) val = h->vals[j];         \
276
93
          __ac_set_isdel_true(h->flags, j);          \
277
112
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
112
            khint_t k, i, step = 0; \
279
112
            k = __hash_func(key);              \
280
112
            i = k & new_mask;               \
281
375
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask263
; \
282
112
            __ac_set_isempty_false(new_flags, i);     \
283
112
            if (i < h->n_buckets && 
__ac_iseither72
(h->flags, i) == 072
) { /* kick out the existing element */ \
284
19
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
19
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
19
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
93
            } else { /* write the element and jump out of the loop */ \
288
93
              h->keys[i] = key;             \
289
93
              if (kh_is_map) h->vals[i] = val;     \
290
93
              break;                    \
291
93
            }                        \
292
112
          }                          \
293
93
        }                            \
294
148
      }                              \
295
1.02k
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
1.02k
      kfree(h->flags); /* free the working space */        \
300
1.02k
      h->flags = new_flags;                   \
301
1.02k
      h->n_buckets = new_n_buckets;               \
302
1.02k
      h->n_occupied = h->size;                  \
303
1.02k
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
1.02k
    }                               \
305
1.02k
    return 0;                           \
306
1.02k
  }                                  \
ccv_cnnp_model_core.c:kh_resize_model_io
Line
Count
Source
245
18
  { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
246
18
    khint32_t *new_flags = 0;                   \
247
18
    khint_t j = 1;                          \
248
18
    {                               \
249
18
      kroundup32(new_n_buckets);                  \
250
18
      if (new_n_buckets < 4) 
new_n_buckets = 48
; \
251
18
      if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) 
j = 00
; /* requested size is too small */ \
252
18
      else { /* hash table size to be changed (shrink or expand); rehash */ \
253
18
        new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
254
18
        if (!new_flags) 
return -10
; \
255
18
        memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
256
18
        if (h->n_buckets < new_n_buckets) { /* expand */    \
257
18
          khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
258
18
          if (!new_keys) 
{ 0
kfree0
(new_flags); return -1; } \
259
18
          h->keys = new_keys;                 \
260
18
          if (kh_is_map) {                 \
261
18
            khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
262
18
            if (!new_vals) 
{ 0
kfree0
(new_flags); return -1; } \
263
18
            h->vals = new_vals;               \
264
18
          }                          \
265
18
        } /* otherwise shrink */                \
266
18
      }                             \
267
18
    }                               \
268
18
    if (j) { /* rehashing is needed */               \
269
78
      for (j = 0; j != h->n_buckets; 
++j60
) { \
270
60
        if (__ac_iseither(h->flags, j) == 0) {         \
271
41
          khkey_t key = h->keys[j];             \
272
41
          khval_t val;                    \
273
41
          khint_t new_mask;                 \
274
41
          new_mask = new_n_buckets - 1;             \
275
41
          if (kh_is_map) val = h->vals[j];         \
276
41
          __ac_set_isdel_true(h->flags, j);          \
277
45
          while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
278
45
            khint_t k, i, step = 0; \
279
45
            k = __hash_func(key);              \
280
45
            i = k & new_mask;               \
281
130
            while (!__ac_isempty(new_flags, i)) 
i = (i + (++step)) & new_mask85
; \
282
45
            __ac_set_isempty_false(new_flags, i);     \
283
45
            if (i < h->n_buckets && 
__ac_iseither35
(h->flags, i) == 035
) { /* kick out the existing element */ \
284
4
              { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
285
4
              if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
286
4
              __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
287
41
            } else { /* write the element and jump out of the loop */ \
288
41
              h->keys[i] = key;             \
289
41
              if (kh_is_map) h->vals[i] = val;     \
290
41
              break;                    \
291
41
            }                        \
292
45
          }                          \
293
41
        }                            \
294
60
      }                              \
295
18
      if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \
296
0
        h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
297
0
        if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
298
0
      }                              \
299
18
      kfree(h->flags); /* free the working space */        \
300
18
      h->flags = new_flags;                   \
301
18
      h->n_buckets = new_n_buckets;               \
302
18
      h->n_occupied = h->size;                  \
303
18
      h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
304
18
    }                               \
305
18
    return 0;                           \
306
18
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_resize_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_ccv_cnnp_model_name_bank
307
  SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
308
370k
  {                                 \
309
370k
    khint_t x;                            \
310
370k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
3.49k
      if (h->n_buckets > (h->size<<1)) {             \
312
2
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
3.49k
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
3.49k
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
370k
    {                               \
320
370k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
370k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
370k
      if (__ac_isempty(h->flags, i)) 
x = i81.2k
; /* for speed up */ \
323
370k
      else {                           \
324
289k
        last = i; \
325
753k
        while (!__ac_isempty(h->flags, i) && 
(650k
__ac_isdel650k
(h->flags, i) ||
!648k
__hash_equal648k
(h->keys[i], key))) { \
326
463k
          if (__ac_isdel(h->flags, i)) 
site = i1.73k
; \
327
463k
          i = (i + (++step)) & mask; \
328
463k
          if (i == last) 
{ x = site; break; }0
\
329
463k
        }                            \
330
289k
        if (x == h->n_buckets) {               \
331
289k
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets103k
)
x = site451
; \
332
289k
          else 
x = i289k
; \
333
289k
        }                           \
334
289k
      }                              \
335
370k
    }                               \
336
370k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
183k
      h->keys[x] = key;                     \
338
183k
      __ac_set_isboth_false(h->flags, x);              \
339
183k
      ++h->size; ++h->n_occupied;                 \
340
183k
      *ret = 1;                         \
341
186k
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
451
      h->keys[x] = key;                     \
343
451
      __ac_set_isboth_false(h->flags, x);              \
344
451
      ++h->size;                          \
345
451
      *ret = 2;                         \
346
186k
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
370k
    return x;                           \
348
370k
  }                                  \
Unexecuted instantiation: while.backward.tests.c:kh_put_stream_map
Unexecuted instantiation: tape.tests.c:kh_put_stream_map
imdb.tests.c:kh_put_vocab_map
Line
Count
Source
308
179k
  {                                 \
309
179k
    khint_t x;                            \
310
179k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
32
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
32
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
32
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
179k
    {                               \
320
179k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
179k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
179k
      if (__ac_isempty(h->flags, i)) 
x = i77.7k
; /* for speed up */ \
323
179k
      else {                           \
324
101k
        last = i; \
325
480k
        while (!__ac_isempty(h->flags, i) && 
(379k
__ac_isdel379k
(h->flags, i) ||
!379k
__hash_equal379k
(h->keys[i], key))) { \
326
379k
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
379k
          i = (i + (++step)) & mask; \
328
379k
          if (i == last) 
{ x = site; break; }0
\
329
379k
        }                            \
330
101k
        if (x == h->n_buckets) {               \
331
101k
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) 
x = site0
; \
332
101k
          else x = i;                     \
333
101k
        }                           \
334
101k
      }                              \
335
179k
    }                               \
336
179k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
179k
      h->keys[x] = key;                     \
338
179k
      __ac_set_isboth_false(h->flags, x);              \
339
179k
      ++h->size; ++h->n_occupied;                 \
340
179k
      *ret = 1;                         \
341
179k
    } else 
if (0
__ac_isdel0
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
0
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
179k
    return x;                           \
348
179k
  }                                  \
Unexecuted instantiation: ccv_nnc_cmd.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_put_stream_map
ccv_nnc_micro.c:kh_put_ccv_nnc_ids
Line
Count
Source
308
9
  {                                 \
309
9
    khint_t x;                            \
310
9
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
3
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
3
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
3
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
9
    {                               \
320
9
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
9
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
9
      if (__ac_isempty(h->flags, i)) 
x = i3
; /* for speed up */ \
323
9
      else {                           \
324
6
        last = i; \
325
15
        while (!__ac_isempty(h->flags, i) && 
(9
__ac_isdel9
(h->flags, i) ||
!9
__hash_equal9
(h->keys[i], key))) { \
326
9
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
9
          i = (i + (++step)) & mask; \
328
9
          if (i == last) 
{ x = site; break; }0
\
329
9
        }                            \
330
6
        if (x == h->n_buckets) {               \
331
6
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) 
x = site0
; \
332
6
          else x = i;                     \
333
6
        }                           \
334
6
      }                              \
335
9
    }                               \
336
9
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
9
      h->keys[x] = key;                     \
338
9
      __ac_set_isboth_false(h->flags, x);              \
339
9
      ++h->size; ++h->n_occupied;                 \
340
9
      *ret = 1;                         \
341
9
    } else 
if (0
__ac_isdel0
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
0
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
9
    return x;                           \
348
9
  }                                  \
ccv_nnc_micro.c:kh_put_ccv_nnc_micro_bind_scalar
Line
Count
Source
308
3
  {                                 \
309
3
    khint_t x;                            \
310
3
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
1
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
1
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
1
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
3
    {                               \
320
3
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
3
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
3
      if (__ac_isempty(h->flags, i)) 
x = i2
; /* for speed up */ \
323
3
      else {                           \
324
1
        last = i; \
325
3
        while (!__ac_isempty(h->flags, i) && 
(2
__ac_isdel2
(h->flags, i) ||
!2
__hash_equal2
(h->keys[i], key))) { \
326
2
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
2
          i = (i + (++step)) & mask; \
328
2
          if (i == last) 
{ x = site; break; }0
\
329
2
        }                            \
330
1
        if (x == h->n_buckets) {               \
331
1
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) 
x = site0
; \
332
1
          else x = i;                     \
333
1
        }                           \
334
1
      }                              \
335
3
    }                               \
336
3
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
3
      h->keys[x] = key;                     \
338
3
      __ac_set_isboth_false(h->flags, x);              \
339
3
      ++h->size; ++h->n_occupied;                 \
340
3
      *ret = 1;                         \
341
3
    } else 
if (0
__ac_isdel0
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
0
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
3
    return x;                           \
348
3
  }                                  \
ccv_nnc_micro_simplify.c:kh_put_ccv_nnc_axis_id_group
Line
Count
Source
308
4
  {                                 \
309
4
    khint_t x;                            \
310
4
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
4
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
4
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
4
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
4
    {                               \
320
4
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
4
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
4
      if (__ac_isempty(h->flags, i)) x = i; /* for speed up */  \
323
4
      else {                           \
324
0
        last = i; \
325
0
        while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
326
0
          if (__ac_isdel(h->flags, i)) site = i;       \
327
0
          i = (i + (++step)) & mask; \
328
0
          if (i == last) { x = site; break; }          \
329
0
        }                           \
330
0
        if (x == h->n_buckets) {               \
331
0
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site; \
332
0
          else x = i;                     \
333
0
        }                           \
334
0
      }                              \
335
4
    }                               \
336
4
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
4
      h->keys[x] = key;                     \
338
4
      __ac_set_isboth_false(h->flags, x);              \
339
4
      ++h->size; ++h->n_occupied;                 \
340
4
      *ret = 1;                         \
341
4
    } else 
if (0
__ac_isdel0
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
0
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
4
    return x;                           \
348
4
  }                                  \
Unexecuted instantiation: ccv_nnc_graph.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_put_stream_map
ccv_nnc_dynamic_graph.c:kh_put_stream_map
Line
Count
Source
308
72
  {                                 \
309
72
    khint_t x;                            \
310
72
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
12
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
12
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
12
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
72
    {                               \
320
72
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
72
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
72
      if (__ac_isempty(h->flags, i)) 
x = i10
; /* for speed up */ \
323
72
      else {                           \
324
62
        last = i; \
325
153
        while (!__ac_isempty(h->flags, i) && 
(140
__ac_isdel140
(h->flags, i) ||
!140
__hash_equal140
(h->keys[i], key))) { \
326
91
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
91
          i = (i + (++step)) & mask; \
328
91
          if (i == last) 
{ x = site; break; }0
\
329
91
        }                            \
330
62
        if (x == h->n_buckets) {               \
331
62
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets13
)
x = site0
; \
332
62
          else x = i;                     \
333
62
        }                           \
334
62
      }                              \
335
72
    }                               \
336
72
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
23
      h->keys[x] = key;                     \
338
23
      __ac_set_isboth_false(h->flags, x);              \
339
23
      ++h->size; ++h->n_occupied;                 \
340
23
      *ret = 1;                         \
341
49
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
49
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
72
    return x;                           \
348
72
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_dy_alloc
ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_str
Line
Count
Source
308
696
  {                                 \
309
696
    khint_t x;                            \
310
696
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
11
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
11
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
11
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
696
    {                               \
320
696
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
696
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
696
      if (__ac_isempty(h->flags, i)) 
x = i11
; /* for speed up */ \
323
696
      else {                           \
324
685
        last = i; \
325
1.08k
        while (!__ac_isempty(h->flags, i) && 
(1.07k
__ac_isdel1.07k
(h->flags, i) ||
!1.07k
__hash_equal1.07k
(h->keys[i], key))) { \
326
400
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
400
          i = (i + (++step)) & mask; \
328
400
          if (i == last) 
{ x = site; break; }0
\
329
400
        }                            \
330
685
        if (x == h->n_buckets) {               \
331
685
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets7
)
x = site0
; \
332
685
          else x = i;                     \
333
685
        }                           \
334
685
      }                              \
335
696
    }                               \
336
696
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
18
      h->keys[x] = key;                     \
338
18
      __ac_set_isboth_false(h->flags, x);              \
339
18
      ++h->size; ++h->n_occupied;                 \
340
18
      *ret = 1;                         \
341
678
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
678
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
696
    return x;                           \
348
696
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_alloc
Line
Count
Source
308
696
  {                                 \
309
696
    khint_t x;                            \
310
696
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
34
      if (h->n_buckets > (h->size<<1)) {             \
312
2
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
32
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
34
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
696
    {                               \
320
696
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
696
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
696
      if (__ac_isempty(h->flags, i)) 
x = i19
; /* for speed up */ \
323
696
      else {                           \
324
677
        last = i; \
325
8.05k
        while (!__ac_isempty(h->flags, i) && 
(7.37k
__ac_isdel7.37k
(h->flags, i) ||
!5.64k
__hash_equal5.64k
(h->keys[i], key))) { \
326
7.37k
          if (__ac_isdel(h->flags, i)) 
site = i1.73k
; \
327
7.37k
          i = (i + (++step)) & mask; \
328
7.37k
          if (i == last) 
{ x = site; break; }0
\
329
7.37k
        }                            \
330
677
        if (x == h->n_buckets) {               \
331
677
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) 
x = site451
; \
332
677
          else 
x = i226
; \
333
677
        }                           \
334
677
      }                              \
335
696
    }                               \
336
696
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
245
      h->keys[x] = key;                     \
338
245
      __ac_set_isboth_false(h->flags, x);              \
339
245
      ++h->size; ++h->n_occupied;                 \
340
245
      *ret = 1;                         \
341
451
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
451
      h->keys[x] = key;                     \
343
451
      __ac_set_isboth_false(h->flags, x);              \
344
451
      ++h->size;                          \
345
451
      *ret = 2;                         \
346
451
    } else 
*ret = 00
; /* Don't touch h->keys[x] if present and not deleted */ \
347
696
    return x;                           \
348
696
  }                                  \
ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_dev
Line
Count
Source
308
648
  {                                 \
309
648
    khint_t x;                            \
310
648
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
22
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
22
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
22
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
648
    {                               \
320
648
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
648
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
648
      if (__ac_isempty(h->flags, i)) 
x = i41
; /* for speed up */ \
323
648
      else {                           \
324
607
        last = i; \
325
607
        while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
326
0
          if (__ac_isdel(h->flags, i)) site = i;       \
327
0
          i = (i + (++step)) & mask; \
328
0
          if (i == last) { x = site; break; }          \
329
0
        }                            \
330
607
        if (x == h->n_buckets) {               \
331
607
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets0
)
x = site0
; \
332
607
          else x = i;                     \
333
607
        }                           \
334
607
      }                              \
335
648
    }                               \
336
648
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
41
      h->keys[x] = key;                     \
338
41
      __ac_set_isboth_false(h->flags, x);              \
339
41
      ++h->size; ++h->n_occupied;                 \
340
41
      *ret = 1;                         \
341
607
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
607
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
648
    return x;                           \
348
648
  }                                  \
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_put_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_put_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_put_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_put_ctx
Line
Count
Source
308
181k
  {                                 \
309
181k
    khint_t x;                            \
310
181k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
52
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
52
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
52
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
181k
    {                               \
320
181k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
181k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
181k
      if (__ac_isempty(h->flags, i)) 
x = i52
; /* for speed up */ \
323
181k
      else {                           \
324
181k
        last = i; \
325
256k
        while (!__ac_isempty(h->flags, i) && 
(256k
__ac_isdel256k
(h->flags, i) ||
!256k
__hash_equal256k
(h->keys[i], key))) { \
326
74.5k
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
74.5k
          i = (i + (++step)) & mask; \
328
74.5k
          if (i == last) 
{ x = site; break; }0
\
329
74.5k
        }                            \
330
181k
        if (x == h->n_buckets) {               \
331
181k
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets6
)
x = site0
; \
332
181k
          else x = i;                     \
333
181k
        }                           \
334
181k
      }                              \
335
181k
    }                               \
336
181k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
58
      h->keys[x] = key;                     \
338
58
      __ac_set_isboth_false(h->flags, x);              \
339
58
      ++h->size; ++h->n_occupied;                 \
340
58
      *ret = 1;                         \
341
181k
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
181k
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
181k
    return x;                           \
348
181k
  }                                  \
ccv_cnnp_dataframe.c:kh_put_iter_ctx
Line
Count
Source
308
603
  {                                 \
309
603
    khint_t x;                            \
310
603
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
4
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
4
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
4
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
603
    {                               \
320
603
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
603
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
603
      if (__ac_isempty(h->flags, i)) 
x = i4
; /* for speed up */ \
323
603
      else {                           \
324
599
        last = i; \
325
887
        while (!__ac_isempty(h->flags, i) && 
(885
__ac_isdel885
(h->flags, i) ||
!885
__hash_equal885
(h->keys[i], key))) { \
326
288
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
288
          i = (i + (++step)) & mask; \
328
288
          if (i == last) 
{ x = site; break; }0
\
329
288
        }                            \
330
599
        if (x == h->n_buckets) {               \
331
599
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets2
)
x = site0
; \
332
599
          else x = i;                     \
333
599
        }                           \
334
599
      }                              \
335
603
    }                               \
336
603
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
6
      h->keys[x] = key;                     \
338
6
      __ac_set_isboth_false(h->flags, x);              \
339
6
      ++h->size; ++h->n_occupied;                 \
340
6
      *ret = 1;                         \
341
597
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
597
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
603
    return x;                           \
348
603
  }                                  \
ccv_cnnp_model.c:kh_put_ccv_cnnp_model_name_bank
Line
Count
Source
308
2.25k
  {                                 \
309
2.25k
    khint_t x;                            \
310
2.25k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
1.21k
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
1.21k
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
1.21k
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
2.25k
    {                               \
320
2.25k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
2.25k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
2.25k
      if (__ac_isempty(h->flags, i)) 
x = i1.21k
; /* for speed up */ \
323
2.25k
      else {                           \
324
1.03k
        last = i; \
325
1.04k
        while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
326
10
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
10
          i = (i + (++step)) & mask; \
328
10
          if (i == last) 
{ x = site; break; }0
\
329
10
        }                            \
330
1.03k
        if (x == h->n_buckets) {               \
331
1.03k
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets0
)
x = site0
; \
332
1.03k
          else x = i;                     \
333
1.03k
        }                           \
334
1.03k
      }                              \
335
2.25k
    }                               \
336
2.25k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
1.21k
      h->keys[x] = key;                     \
338
1.21k
      __ac_set_isboth_false(h->flags, x);              \
339
1.21k
      ++h->size; ++h->n_occupied;                 \
340
1.21k
      *ret = 1;                         \
341
1.21k
    } else 
if (1.03k
__ac_isdel1.03k
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
1.03k
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
2.25k
    return x;                           \
348
2.25k
  }                                  \
ccv_cnnp_model.c:kh_put_stream_map
Line
Count
Source
308
24
  {                                 \
309
24
    khint_t x;                            \
310
24
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
8
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
8
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
8
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
24
    {                               \
320
24
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
24
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
24
      if (__ac_isempty(h->flags, i)) 
x = i4
; /* for speed up */ \
323
24
      else {                           \
324
20
        last = i; \
325
56
        while (!__ac_isempty(h->flags, i) && 
(44
__ac_isdel44
(h->flags, i) ||
!44
__hash_equal44
(h->keys[i], key))) { \
326
36
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
36
          i = (i + (++step)) & mask; \
328
36
          if (i == last) 
{ x = site; break; }0
\
329
36
        }                            \
330
20
        if (x == h->n_buckets) {               \
331
20
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets12
)
x = site0
; \
332
20
          else x = i;                     \
333
20
        }                           \
334
20
      }                              \
335
24
    }                               \
336
24
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
16
      h->keys[x] = key;                     \
338
16
      __ac_set_isboth_false(h->flags, x);              \
339
16
      ++h->size; ++h->n_occupied;                 \
340
16
      *ret = 1;                         \
341
16
    } else 
if (8
__ac_isdel8
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
8
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
24
    return x;                           \
348
24
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_ccv_cnnp_model_name_bank
ccv_cnnp_model_core.c:kh_put_ccv_cnnp_model_name_bank
Line
Count
Source
308
2.86k
  {                                 \
309
2.86k
    khint_t x;                            \
310
2.86k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
1.06k
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
1.06k
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
1.06k
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
2.86k
    {                               \
320
2.86k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
2.86k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
2.86k
      if (__ac_isempty(h->flags, i)) 
x = i1.08k
; /* for speed up */ \
323
2.86k
      else {                           \
324
1.77k
        last = i; \
325
1.82k
        while (!__ac_isempty(h->flags, i) && 
(1.80k
__ac_isdel1.80k
(h->flags, i) ||
!1.80k
__hash_equal1.80k
(h->keys[i], key))) { \
326
46
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
46
          i = (i + (++step)) & mask; \
328
46
          if (i == last) 
{ x = site; break; }0
\
329
46
        }                            \
330
1.77k
        if (x == h->n_buckets) {               \
331
1.77k
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets23
)
x = site0
; \
332
1.77k
          else x = i;                     \
333
1.77k
        }                           \
334
1.77k
      }                              \
335
2.86k
    }                               \
336
2.86k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
1.11k
      h->keys[x] = key;                     \
338
1.11k
      __ac_set_isboth_false(h->flags, x);              \
339
1.11k
      ++h->size; ++h->n_occupied;                 \
340
1.11k
      *ret = 1;                         \
341
1.75k
    } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
1.75k
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
2.86k
    return x;                           \
348
2.86k
  }                                  \
ccv_cnnp_model_core.c:kh_put_model
Line
Count
Source
308
2.09k
  {                                 \
309
2.09k
    khint_t x;                            \
310
2.09k
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
1.02k
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
1.02k
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
1.02k
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
2.09k
    {                               \
320
2.09k
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
2.09k
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
2.09k
      if (__ac_isempty(h->flags, i)) 
x = i1.00k
; /* for speed up */ \
323
2.09k
      else {                           \
324
1.09k
        last = i; \
325
2.67k
        while (!__ac_isempty(h->flags, i) && 
(1.58k
__ac_isdel1.58k
(h->flags, i) ||
!1.58k
__hash_equal1.58k
(h->keys[i], key))) { \
326
1.58k
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
1.58k
          i = (i + (++step)) & mask; \
328
1.58k
          if (i == last) 
{ x = site; break; }0
\
329
1.58k
        }                            \
330
1.09k
        if (x == h->n_buckets) {               \
331
1.09k
          if (__ac_isempty(h->flags, i) && 
site != h->n_buckets1.09k
)
x = site0
; \
332
1.09k
          else x = i;                     \
333
1.09k
        }                           \
334
1.09k
      }                              \
335
2.09k
    }                               \
336
2.09k
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
2.09k
      h->keys[x] = key;                     \
338
2.09k
      __ac_set_isboth_false(h->flags, x);              \
339
2.09k
      ++h->size; ++h->n_occupied;                 \
340
2.09k
      *ret = 1;                         \
341
2.09k
    } else 
if (1
__ac_isdel1
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
1
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
2.09k
    return x;                           \
348
2.09k
  }                                  \
ccv_cnnp_model_core.c:kh_put_model_io
Line
Count
Source
308
50
  {                                 \
309
50
    khint_t x;                            \
310
50
    if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
311
18
      if (h->n_buckets > (h->size<<1)) {             \
312
0
        if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
313
0
          *ret = -1; return h->n_buckets;           \
314
0
        }                            \
315
18
      } else if (kh_resize_##name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
316
0
        *ret = -1; return h->n_buckets;             \
317
0
      }                              \
318
18
    } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
319
50
    {                               \
320
50
      khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
321
50
      x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
322
50
      if (__ac_isempty(h->flags, i)) 
x = i8
; /* for speed up */ \
323
50
      else {                           \
324
42
        last = i; \
325
200
        while (!__ac_isempty(h->flags, i) && 
(158
__ac_isdel158
(h->flags, i) ||
!158
__hash_equal158
(h->keys[i], key))) { \
326
158
          if (__ac_isdel(h->flags, i)) 
site = i0
; \
327
158
          i = (i + (++step)) & mask; \
328
158
          if (i == last) 
{ x = site; break; }0
\
329
158
        }                            \
330
42
        if (x == h->n_buckets) {               \
331
42
          if (__ac_isempty(h->flags, i) && site != h->n_buckets) 
x = site0
; \
332
42
          else x = i;                     \
333
42
        }                           \
334
42
      }                              \
335
50
    }                               \
336
50
    if (__ac_isempty(h->flags, x)) { /* not present at all */    \
337
50
      h->keys[x] = key;                     \
338
50
      __ac_set_isboth_false(h->flags, x);              \
339
50
      ++h->size; ++h->n_occupied;                 \
340
50
      *ret = 1;                         \
341
50
    } else 
if (0
__ac_isdel0
(h->flags, x)) { /* deleted */ \
342
0
      h->keys[x] = key;                     \
343
0
      __ac_set_isboth_false(h->flags, x);              \
344
0
      ++h->size;                          \
345
0
      *ret = 2;                         \
346
0
    } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
347
50
    return x;                           \
348
50
  }                                  \
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_put_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_ccv_cnnp_model_name_bank
349
  SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)       \
350
743
  {                                 \
351
743
    if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
352
743
      __ac_set_isdel_true(h->flags, x);              \
353
743
      --h->size;                          \
354
743
    }                               \
355
743
  }
Unexecuted instantiation: while.backward.tests.c:kh_del_stream_map
Unexecuted instantiation: tape.tests.c:kh_del_stream_map
Unexecuted instantiation: imdb.tests.c:kh_del_vocab_map
Unexecuted instantiation: ccv_nnc_cmd.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_tensor.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_tensor_io.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_stream.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_micro.c:kh_del_ccv_nnc_micro_bind_scalar
Unexecuted instantiation: ccv_nnc_micro.c:kh_del_ccv_nnc_ids
Unexecuted instantiation: ccv_nnc_micro_simplify.c:kh_del_ccv_nnc_axis_id_group
Unexecuted instantiation: ccv_nnc_graph.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_graph_while.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_tensor_tape.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_graph_case_of.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_graph_run.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_dy_alloc
ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_str
Line
Count
Source
350
2
  {                                 \
351
2
    if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
352
2
      __ac_set_isdel_true(h->flags, x);              \
353
2
      --h->size;                          \
354
2
    }                               \
355
2
  }
ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_alloc
Line
Count
Source
350
696
  {                                 \
351
696
    if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
352
696
      __ac_set_isdel_true(h->flags, x);              \
353
696
      --h->size;                          \
354
696
    }                               \
355
696
  }
ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_dev
Line
Count
Source
350
41
  {                                 \
351
41
    if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
352
41
      __ac_set_isdel_true(h->flags, x);              \
353
41
      --h->size;                          \
354
41
    }                               \
355
41
  }
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_del_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_del_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_del_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_stream_map
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_stateful_exec
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_dy_dev
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_dy_str
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_dy_alloc
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_ccv_cnnp_model_name_bank
ccv_cnnp_dataframe.c:kh_del_ctx
Line
Count
Source
350
4
  {                                 \
351
4
    if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
352
4
      __ac_set_isdel_true(h->flags, x);              \
353
4
      --h->size;                          \
354
4
    }                               \
355
4
  }
Unexecuted instantiation: ccv_cnnp_dataframe.c:kh_del_iter_ctx
Unexecuted instantiation: ccv_cnnp_model.c:kh_del_stream_map
Unexecuted instantiation: ccv_cnnp_model.c:kh_del_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_stream_map
Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_stream_map
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_ccv_cnnp_model_name_bank
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_model
Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_model_io
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_del_stream_map
Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_del_ccv_cnnp_model_name_bank
356
357
#define KHASH_DECLARE(name, khkey_t, khval_t)             \
358
  __KHASH_TYPE(name, khkey_t, khval_t)                \
359
  __KHASH_PROTOTYPES(name, khkey_t, khval_t)
360
361
#define KHASH_INIT2(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
362
  __KHASH_TYPE(name, khkey_t, khval_t)                \
363
  __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
364
365
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
366
  KHASH_INIT2(name, static kh_inline klib_unused, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
367
368
/* --- BEGIN OF HASH FUNCTIONS --- */
369
370
/*! @function
371
  @abstract     Integer hash function
372
  @param  key   The integer [khint32_t]
373
  @return       The hash value [khint_t]
374
 */
375
2.24k
#define kh_int_hash_func(key) (khint32_t)(key)
376
/*! @function
377
  @abstract     Integer comparison function
378
 */
379
1.57k
#define kh_int_hash_equal(a, b) ((a) == (b))
380
/*! @function
381
  @abstract     64-bit integer hash function
382
  @param  key   The integer [khint64_t]
383
  @return       The hash value [khint_t]
384
 */
385
2.59M
#define kh_int64_hash_func(key) (khint32_t)((key)>>33^(key)^(key)<<11)
386
/*! @function
387
  @abstract     64-bit integer comparison function
388
 */
389
3.71M
#define kh_int64_hash_equal(a, b) ((a) == (b))
390
/*! @function
391
  @abstract     const char* hash function
392
  @param  s     Pointer to a null terminated string
393
  @return       The hash value
394
 */
395
static kh_inline khint_t __ac_X31_hash_string(const char *s)
396
509k
{
397
509k
  khint_t h = (khint_t)*s;
398
3.52M
  if (
h509k
)
for (++s ; 504k
*s;
++s3.02M
)
h = (h << 5) - h + (khint_t)*s3.02M
;
399
509k
  return h;
400
509k
}
Unexecuted instantiation: while.backward.tests.c:__ac_X31_hash_string
Unexecuted instantiation: tape.tests.c:__ac_X31_hash_string
imdb.tests.c:__ac_X31_hash_string
Line
Count
Source
396
504k
{
397
504k
  khint_t h = (khint_t)*s;
398
3.52M
  if (
h504k
)
for (++s ; 504k
*s;
++s3.02M
)
h = (h << 5) - h + (khint_t)*s3.02M
;
399
504k
  return h;
400
504k
}
Unexecuted instantiation: ccv_nnc_cmd.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_tensor.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_tensor_io.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_stream.c:__ac_X31_hash_string
ccv_nnc_micro.c:__ac_X31_hash_string
Line
Count
Source
396
13
{
397
13
  khint_t h = (khint_t)*s;
398
39
  if (
h13
)
for (++s ; 13
*s;
++s26
)
h = (h << 5) - h + (khint_t)*s26
;
399
13
  return h;
400
13
}
Unexecuted instantiation: ccv_nnc_micro_core.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_micro_simplify.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_graph.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_graph_while.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_tensor_tape.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_graph_case_of.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_graph_run.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:__ac_X31_hash_string
Unexecuted instantiation: ccv_cnnp_dataframe.c:__ac_X31_hash_string
ccv_cnnp_model.c:__ac_X31_hash_string
Line
Count
Source
396
2.25k
{
397
2.25k
  khint_t h = (khint_t)*s;
398
2.25k
  if (h) 
for (++s ; 10
*s60
;
++s50
)
h = (h << 5) - h + (khint_t)*s50
;
399
2.25k
  return h;
400
2.25k
}
Unexecuted instantiation: ccv_cnnp_model_io.c:__ac_X31_hash_string
ccv_cnnp_model_core.c:__ac_X31_hash_string
Line
Count
Source
396
2.91k
{
397
2.91k
  khint_t h = (khint_t)*s;
398
2.91k
  if (h) 
for (++s ; 149
*s883
;
++s734
)
h = (h << 5) - h + (khint_t)*s734
;
399
2.91k
  return h;
400
2.91k
}
Unexecuted instantiation: ccv_cnnp_model_addons.c:__ac_X31_hash_string
401
/*! @function
402
  @abstract     Another interface to const char* hash function
403
  @param  key   Pointer to a null terminated string [const char*]
404
  @return       The hash value [khint_t]
405
 */
406
509k
#define kh_str_hash_func(key) __ac_X31_hash_string(key)
407
/*! @function
408
  @abstract     Const char* comparison function
409
 */
410
620k
#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0)
411
412
static kh_inline khint_t __ac_Wang_hash(khint_t key)
413
0
{
414
0
    key += ~(key << 15);
415
0
    key ^=  (key >> 10);
416
0
    key +=  (key << 3);
417
0
    key ^=  (key >> 6);
418
0
    key += ~(key << 11);
419
0
    key ^=  (key >> 16);
420
0
    return key;
421
0
}
Unexecuted instantiation: while.backward.tests.c:__ac_Wang_hash
Unexecuted instantiation: tape.tests.c:__ac_Wang_hash
Unexecuted instantiation: imdb.tests.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_cmd.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_tensor.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_tensor_io.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_stream.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_micro.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_micro_core.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_micro_simplify.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_graph.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_symbolic_graph_io.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_symbolic_graph_compile.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_graph_while.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_tensor_tape.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_graph_case_of.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_graph_run.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:__ac_Wang_hash
Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:__ac_Wang_hash
Unexecuted instantiation: ccv_cnnp_dataframe.c:__ac_Wang_hash
Unexecuted instantiation: ccv_cnnp_model.c:__ac_Wang_hash
Unexecuted instantiation: ccv_cnnp_model_io.c:__ac_Wang_hash
Unexecuted instantiation: ccv_cnnp_model_core.c:__ac_Wang_hash
Unexecuted instantiation: ccv_cnnp_model_addons.c:__ac_Wang_hash
422
#define kh_int_hash_func2(key) __ac_Wang_hash((khint_t)key)
423
424
/* --- END OF HASH FUNCTIONS --- */
425
426
/* Other convenient macros... */
427
428
/*!
429
  @abstract Type of the hash table.
430
  @param  name  Name of the hash table [symbol]
431
 */
432
2.60M
#define khash_t(name) kh_##name##_t
433
434
/*! @function
435
  @abstract     Initiate a hash table.
436
  @param  name  Name of the hash table [symbol]
437
  @return       Pointer to the hash table [khash_t(name)*]
438
 */
439
8.59k
#define kh_init(name) kh_init_
##name()1.00k
440
441
/*! @function
442
  @abstract     Destroy a hash table.
443
  @param  name  Name of the hash table [symbol]
444
  @param  h     Pointer to the hash table [khash_t(name)*]
445
 */
446
8.59k
#define kh_destroy(name, h) kh_destroy_
##name(h)1.07k
447
448
/*! @function
449
  @abstract     Reset a hash table without deallocating memory.
450
  @param  name  Name of the hash table [symbol]
451
  @param  h     Pointer to the hash table [khash_t(name)*]
452
 */
453
#define kh_clear(name, h) kh_clear_##name(h)
454
455
/*! @function
456
  @abstract     Resize a hash table.
457
  @param  name  Name of the hash table [symbol]
458
  @param  h     Pointer to the hash table [khash_t(name)*]
459
  @param  s     New size [khint_t]
460
 */
461
#define kh_resize(name, h, s) kh_resize_##name(h, s)
462
463
/*! @function
464
  @abstract     Insert a key to the hash table.
465
  @param  name  Name of the hash table [symbol]
466
  @param  h     Pointer to the hash table [khash_t(name)*]
467
  @param  k     Key [type of keys]
468
  @param  r     Extra return code: -1 if the operation failed;
469
                0 if the key is present in the hash table;
470
                1 if the bucket is empty (never used); 2 if the element in
471
        the bucket has been deleted [int*]
472
  @return       Iterator to the inserted element [khint_t]
473
 */
474
370k
#define kh_put(name, h, k, r) kh_put_##name(h, 
k5.12k
, r)
475
476
/*! @function
477
  @abstract     Retrieve a key from the hash table.
478
  @param  name  Name of the hash table [symbol]
479
  @param  h     Pointer to the hash table [khash_t(name)*]
480
  @param  k     Key [type of keys]
481
  @return       Iterator to the found element, or kh_end(h) if the element is absent [khint_t]
482
 */
483
2.53M
#define kh_get(name, h, k) kh_get_##name(h, k)
484
485
/*! @function
486
  @abstract     Remove a key from the hash table.
487
  @param  name  Name of the hash table [symbol]
488
  @param  h     Pointer to the hash table [khash_t(name)*]
489
  @param  k     Iterator to the element to be deleted [khint_t]
490
 */
491
743
#define kh_del(name, h, k) kh_del_##name(h, k)
492
493
/*! @function
494
  @abstract     Test whether a bucket contains data.
495
  @param  h     Pointer to the hash table [khash_t(name)*]
496
  @param  x     Iterator to the bucket [khint_t]
497
  @return       1 if containing data; 0 otherwise [int]
498
 */
499
262k
#define kh_exist(h, x) (!__ac_iseither((h)->flags, (x)))
500
501
/*! @function
502
  @abstract     Get key given an iterator
503
  @param  h     Pointer to the hash table [khash_t(name)*]
504
  @param  x     Iterator to the bucket [khint_t]
505
  @return       Key [type of keys]
506
 */
507
179k
#define kh_key(h, x) ((h)->keys[x])
508
509
/*! @function
510
  @abstract     Get value given an iterator
511
  @param  h     Pointer to the hash table [khash_t(name)*]
512
  @param  x     Iterator to the bucket [khint_t]
513
  @return       Value [type of values]
514
  @discussion   For hash sets, calling this results in segfault.
515
 */
516
2.71M
#define kh_val(h, x) ((h)->vals[x])
517
518
/*! @function
519
  @abstract     Alias of kh_val()
520
 */
521
#define kh_value(h, x) ((h)->vals[x])
522
523
/*! @function
524
  @abstract     Get the start iterator
525
  @param  h     Pointer to the hash table [khash_t(name)*]
526
  @return       The start iterator [khint_t]
527
 */
528
172
#define kh_begin(h) (khint_t)(0)
529
530
/*! @function
531
  @abstract     Get the end iterator
532
  @param  h     Pointer to the hash table [khash_t(name)*]
533
  @return       The end iterator [khint_t]
534
 */
535
2.79M
#define kh_end(h) ((h)->n_buckets)
536
537
/*! @function
538
  @abstract     Get the number of elements in the hash table
539
  @param  h     Pointer to the hash table [khash_t(name)*]
540
  @return       Number of elements in the hash table [khint_t]
541
 */
542
#define kh_size(h) ((h)->size)
543
544
/*! @function
545
  @abstract     Get the number of buckets in the hash table
546
  @param  h     Pointer to the hash table [khash_t(name)*]
547
  @return       Number of buckets in the hash table [khint_t]
548
 */
549
#define kh_n_buckets(h) ((h)->n_buckets)
550
551
/*! @function
552
  @abstract     Iterate over the entries in the hash table
553
  @param  h     Pointer to the hash table [khash_t(name)*]
554
  @param  kvar  Variable to which key will be assigned
555
  @param  vvar  Variable to which value will be assigned
556
  @param  code  Block of code to execute
557
 */
558
#define kh_foreach(h, kvar, vvar, code) { khint_t __i;    \
559
  for (__i = kh_begin(h); __i != kh_end(h); ++__i) {    \
560
    if (!kh_exist(h,__i)) continue;           \
561
    (kvar) = kh_key(h,__i);               \
562
    (vvar) = kh_val(h,__i);               \
563
    code;                       \
564
  } }
565
566
/*! @function
567
  @abstract     Iterate over the values in the hash table
568
  @param  h     Pointer to the hash table [khash_t(name)*]
569
  @param  vvar  Variable to which value will be assigned
570
  @param  code  Block of code to execute
571
 */
572
#define kh_foreach_value(h, vvar, code) { khint_t __i;    \
573
  for (__i = kh_begin(h); __i != kh_end(h); ++__i) {    \
574
    if (!kh_exist(h,__i)) continue;           \
575
    (vvar) = kh_val(h,__i);               \
576
    code;                       \
577
  } }
578
579
/* More convenient interfaces */
580
581
/*! @function
582
  @abstract     Instantiate a hash set containing integer keys
583
  @param  name  Name of the hash table [symbol]
584
 */
585
#define KHASH_SET_INIT_INT(name)                    \
586
  KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal)
587
588
/*! @function
589
  @abstract     Instantiate a hash map containing integer keys
590
  @param  name  Name of the hash table [symbol]
591
  @param  khval_t  Type of values [type]
592
 */
593
#define KHASH_MAP_INIT_INT(name, khval_t)               \
594
2.24k
  KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, 
kh_int_hash_equal1.57k
)
595
596
/*! @function
597
  @abstract     Instantiate a hash set containing 64-bit integer keys
598
  @param  name  Name of the hash table [symbol]
599
 */
600
#define KHASH_SET_INIT_INT64(name)                    \
601
9
  KHASH_INIT(name, khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal)
602
603
/*! @function
604
  @abstract     Instantiate a hash map containing 64-bit integer keys
605
  @param  name  Name of the hash table [symbol]
606
  @param  khval_t  Type of values [type]
607
 */
608
#define KHASH_MAP_INIT_INT64(name, khval_t)               \
609
3.71M
  KHASH_INIT(name, khint64_t, khval_t, 1, 
kh_int64_hash_func2.59M
, kh_int64_hash_equal)
610
611
typedef const char *kh_cstr_t;
612
/*! @function
613
  @abstract     Instantiate a hash map containing const char* keys
614
  @param  name  Name of the hash table [symbol]
615
 */
616
#define KHASH_SET_INIT_STR(name)                    \
617
  KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal)
618
619
/*! @function
620
  @abstract     Instantiate a hash map containing const char* keys
621
  @param  name  Name of the hash table [symbol]
622
  @param  khval_t  Type of values [type]
623
 */
624
#define KHASH_MAP_INIT_STR(name, khval_t)               \
625
620k
  KHASH_INIT(name, kh_cstr_t, khval_t, 1, 
kh_str_hash_func509k
, kh_str_hash_equal)
626
627
#endif /* __AC_KHASH_H */