## Coverage Report

#### Created: 2026-05-04 15:30

next uncovered line (L), next uncovered region (R), next uncovered branch (B)

    /home/liu/actions-runner/_work/ccv/ccv/lib/3rdparty/khash/khash.h

    Line
    Count
    Source
    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
    11.6M
    #define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2)
    166
    10.1M
    #define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1)
    167
    3.57M
    #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
    303k
    #define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1)))
    170
    275k
    #define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1)))
    171
    305k
    #define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1))
    172
    173
    3.76k
    #define __ac_fsize(m) ((m) < 16? 13.67k : (m)>>487)
    174
    175
    #ifndef kroundup32
    176
    3.76k
    #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
    11.0k
    #define kcalloc(N,Z) calloc(N,Z)
    181
    #endif
    182
    #ifndef kmalloc
    183
    7.52k
    #define kmalloc(Z) malloc(3.76kZ)
    184
    #endif
    185
    #ifndef krealloc
    186
    7.30k
    #define krealloc(P,Z) realloc(P,Z)
    187
    #endif
    188
    #ifndef kfree
    189
    48.1k
    #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
    11.0k
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    11.0k
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    11.0k
      }                                  \

    imdb.tests.c:kh_init_vocab_map

    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
      }                                  \
    Unexecuted instantiation: mpsblas.tests.c:kh_init_stream_map
    Unexecuted instantiation: tape.tests.c:kh_init_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_init_stream_map

    ccv_nnc_cmd.c:kh_init_autotune_executable_cache

    Line
    Count
    Source
    212
    1
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    1
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    1
      }                                  \
    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_symbolic_graph_compile.c:kh_init_obj_ptr
    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_xpu_alloc.c:kh_init_dy_dev

    Line
    Count
    Source
    212
    19
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    19
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    19
      }                                  \
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_init_stream_map
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_init_dy_str
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_init_dy_alloc

    ccv_nnc_dynamic_graph.c:kh_init_dy_str

    Line
    Count
    Source
    212
    61
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    61
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    61
      }                                  \

    ccv_nnc_dynamic_graph.c:kh_init_dy_alloc

    Line
    Count
    Source
    212
    61
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    61
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    61
      }                                  \

    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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_init_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_init_dy_dev
    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_alloc.c:kh_init_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_init_stream_map
    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_backward.c:kh_init_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_init_stream_map
    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_apply_gradients.c:kh_init_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_init_stream_map
    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_minimize.c:kh_init_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_init_stream_map
    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_stateful_exec
    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
    56
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    56
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    56
      }                                  \

    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
    3.57k
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    3.57k
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    3.57k
      }                                  \

    ccv_cnnp_model.c:kh_init_dy_str

    Line
    Count
    Source
    212
    2.31k
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    2.31k
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    2.31k
      }                                  \

    ccv_cnnp_model.c:kh_init_dy_alloc

    Line
    Count
    Source
    212
    2.31k
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    2.31k
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    2.31k
      }                                  \

    ccv_cnnp_model.c:kh_init_ccv_cnnp_parameter_id

    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_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.c:kh_init_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_init_dy_alloc
    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
    1.52k
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    1.52k
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    1.52k
      }                                  \

    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_io_node

    Line
    Count
    Source
    212
    109
      SCOPE kh_##name##_t *kh_init_##name(void) {             \
    213
    109
        return (kh_##name##_t*)kcalloc(1, sizeof(kh_##name##_t));   \
    214
    109
      }                                  \

    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_core.c:kh_init_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_init_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_init_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_stream_map
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_init_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_init_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_init_ccv_cnnp_tensor_symbol_set

    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_gradient_checkpointing.c:kh_init_ccv_cnnp_tensor_symbol_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
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_init_ccv_cnnp_model_name_bank

    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_cnnp_model_gradient_checkpointing.c:kh_init_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_init_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_init_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_init_dy_alloc
    215
      SCOPE void kh_destroy_##name(kh_##name##_t *h)            \
    216
    11.0k
      {                                 \
    217
    11.0k
        if (h) {                           \
    218
    11.0k
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    11.0k
          kfree((void *)h->vals);                    \
    220
    11.0k
          kfree(h);                          \
    221
    11.0k
        }                               \
    222
    11.0k
      }                                  \

    imdb.tests.c:kh_destroy_vocab_map

    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
      }                                  \
    Unexecuted instantiation: mpsblas.tests.c:kh_destroy_stream_map
    Unexecuted instantiation: tape.tests.c:kh_destroy_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_destroy_autotune_executable_cache
    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_symbolic_graph_compile.c:kh_destroy_obj_ptr
    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_xpu_alloc.c:kh_destroy_dy_alloc

    Line
    Count
    Source
    216
    2.37k
      {                                 \
    217
    2.37k
        if (h) {                           \
    218
    2.37k
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    2.37k
          kfree((void *)h->vals);                    \
    220
    2.37k
          kfree(h);                          \
    221
    2.37k
        }                               \
    222
    2.37k
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_destroy_dy_dev

    Line
    Count
    Source
    216
    19
      {                                 \
    217
    19
        if (h) {                           \
    218
    19
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    19
          kfree((void *)h->vals);                    \
    220
    19
          kfree(h);                          \
    221
    19
        }                               \
    222
    19
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_destroy_dy_str

    Line
    Count
    Source
    216
    2.37k
      {                                 \
    217
    2.37k
        if (h) {                           \
    218
    2.37k
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    2.37k
          kfree((void *)h->vals);                    \
    220
    2.37k
          kfree(h);                          \
    221
    2.37k
        }                               \
    222
    2.37k
      }                                  \
    Unexecuted instantiation: ccv_nnc_xpu_alloc.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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_destroy_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_destroy_dy_alloc
    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_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_backward.c:kh_destroy_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_destroy_stream_map
    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_apply_gradients.c:kh_destroy_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_destroy_stream_map
    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_minimize.c:kh_destroy_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_destroy_stream_map
    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_stateful_exec
    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
    56
      {                                 \
    217
    56
        if (h) {                           \
    218
    56
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    56
          kfree((void *)h->vals);                    \
    220
    56
          kfree(h);                          \
    221
    56
        }                               \
    222
    56
      }                                  \

    ccv_cnnp_model.c:kh_destroy_ccv_cnnp_model_name_bank

    Line
    Count
    Source
    216
    3.57k
      {                                 \
    217
    3.57k
        if (h) {                           \
    218
    3.57k
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    3.57k
          kfree((void *)h->vals);                    \
    220
    3.57k
          kfree(h);                          \
    221
    3.57k
        }                               \
    222
    3.57k
      }                                  \

    ccv_cnnp_model.c:kh_destroy_ccv_cnnp_parameter_id

    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_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.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_destroy_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_destroy_dy_alloc
    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
    1.52k
      {                                 \
    217
    1.52k
        if (h) {                           \
    218
    1.52k
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    1.52k
          kfree((void *)h->vals);                    \
    220
    1.52k
          kfree(h);                          \
    221
    1.52k
        }                               \
    222
    1.52k
      }                                  \

    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_io_node

    Line
    Count
    Source
    216
    109
      {                                 \
    217
    109
        if (h) {                           \
    218
    109
          kfree((void *)h->keys); kfree(h->flags);         \
    219
    109
          kfree((void *)h->vals);                    \
    220
    109
          kfree(h);                          \
    221
    109
        }                               \
    222
    109
      }                                  \

    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_core.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_destroy_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_destroy_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_destroy_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_ccv_cnnp_model_name_bank

    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
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_ccv_cnnp_tensor_symbol_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
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_ccv_cnnp_tensor_symbol_set

    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_gradient_checkpointing.c:kh_destroy_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_destroy_dy_alloc
    223
      SCOPE void kh_clear_##name(kh_##name##_t *h)            \
    224
    6
      {                                 \
    225
    6
        if (h && h->flags) {                     \
    226
    2
          memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \
    227
    2
          h->size = h->n_occupied = 0;                \
    228
    2
        }                                \
    229
    6
      }                                  \
    Unexecuted instantiation: imdb.tests.c:kh_clear_vocab_map
    Unexecuted instantiation: mpsblas.tests.c:kh_clear_stream_map
    Unexecuted instantiation: tape.tests.c:kh_clear_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_clear_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_clear_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_clear_autotune_executable_cache
    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_symbolic_graph_compile.c:kh_clear_obj_ptr
    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_xpu_alloc.c:kh_clear_stream_map
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_clear_dy_dev
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_nnc_xpu_alloc.c:kh_clear_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_clear_stream_map
    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.c:kh_clear_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_clear_stream_map
    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_alloc.c:kh_clear_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_backward.c:kh_clear_stream_map
    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_backward.c:kh_clear_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_clear_stream_map
    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_apply_gradients.c:kh_clear_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_clear_stream_map
    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_minimize.c:kh_clear_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_clear_stream_map
    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_stateful_exec
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_cnnp_model.c:kh_clear_ccv_cnnp_parameter_id
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_clear_dy_alloc
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_clear_dy_alloc
    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_io_node
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_clear_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_clear_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_clear_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_clear_ccv_cnnp_tensor_symbol_set

    Line
    Count
    Source
    224
    4
      {                                 \
    225
    4
        if (h && h->flags) {                     \
    226
    2
          memset(h->flags, 0xaa, __ac_fsize(h->n_buckets) * sizeof(khint32_t)); \
    227
    2
          h->size = h->n_occupied = 0;                \
    228
    2
        }                                \
    229
    4
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_clear_ccv_cnnp_tensor_symbol_map

    Line
    Count
    Source
    224
    2
      {                                 \
    225
    2
        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
    2
      }                                  \
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_clear_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_clear_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_clear_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_clear_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.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.60M
      {                                 \
    232
    2.60M
        if (h->n_buckets) {                       \
    233
    2.60M
          khint_t k, i, last, mask, step = 0; \
    234
    2.60M
          mask = h->n_buckets - 1;                  \
    235
    2.60M
          k = __hash_func(key); i = k & mask;              \
    236
    2.60M
          last = i; \
    237
    3.82M
          while (!__ac_isempty(h->flags, i) && (3.81M__ac_isdel3.81M(h->flags, i) || !3.81M__hash_equal3.81M(h->keys[i], key))) { \
    238
    1.22M
            i = (i + (++step)) & mask; \
    239
    1.22M
            if (i == last) return h->n_buckets0;           \
    240
    1.22M
          }                              \
    241
    2.60M
          return __ac_iseither(h->flags, i)? h->n_buckets9.20k : i2.59M;   \
    242
    2.60M
        } else return 0612;                       \
    243
    2.60M
      }                                  \

    imdb.tests.c:kh_get_vocab_map

    Line
    Count
    Source
    231
    184k
      {                                 \
    232
    184k
        if (h->n_buckets) {                       \
    233
    184k
          khint_t k, i, last, mask, step = 0; \
    234
    184k
          mask = h->n_buckets - 1;                  \
    235
    184k
          k = __hash_func(key); i = k & mask;              \
    236
    184k
          last = i; \
    237
    366k
          while (!__ac_isempty(h->flags, i) && (358k__ac_isdel358k(h->flags, i) || !358k__hash_equal358k(h->keys[i], key))) { \
    238
    181k
            i = (i + (++step)) & mask; \
    239
    181k
            if (i == last) return h->n_buckets0;           \
    240
    181k
          }                              \
    241
    184k
          return __ac_iseither(h->flags, i)? h->n_buckets8.10k : i176k;   \
    242
    184k
        } else return 00;                       \
    243
    184k
      }                                  \
    Unexecuted instantiation: mpsblas.tests.c:kh_get_stream_map
    Unexecuted instantiation: tape.tests.c:kh_get_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_get_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_get_stream_map
    Unexecuted instantiation: ccv_nnc_cmd.c:kh_get_autotune_executable_cache
    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_symbolic_graph_compile.c:kh_get_obj_ptr
    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

    ccv_nnc_xpu_alloc.c:kh_get_dy_dev

    Line
    Count
    Source
    231
    704
      {                                 \
    232
    704
        if (h->n_buckets) {                       \
    233
    558
          khint_t k, i, last, mask, step = 0; \
    234
    558
          mask = h->n_buckets - 1;                  \
    235
    558
          k = __hash_func(key); i = k & mask;              \
    236
    558
          last = i; \
    237
    558
          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
    558
          return __ac_iseither(h->flags, i)? h->n_buckets0 : i;   \
    242
    558
        } else return 0146;                       \
    243
    704
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_get_dy_alloc

    Line
    Count
    Source
    231
    723
      {                                 \
    232
    723
        if (h->n_buckets) {                       \
    233
    723
          khint_t k, i, last, mask, step = 0; \
    234
    723
          mask = h->n_buckets - 1;                  \
    235
    723
          k = __hash_func(key); i = k & mask;              \
    236
    723
          last = i; \
    237
    7.37k
          while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !4.43k__hash_equal4.43k(h->keys[i], key))) { \
    238
    6.64k
            i = (i + (++step)) & mask; \
    239
    6.64k
            if (i == last) return h->n_buckets0;           \
    240
    6.64k
          }                              \
    241
    723
          return __ac_iseither(h->flags, i)? h->n_buckets0 : i;   \
    242
    723
        } else return 00;                       \
    243
    723
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_get_dy_str

    Line
    Count
    Source
    231
    725
      {                                 \
    232
    725
        if (h->n_buckets) {                       \
    233
    725
          khint_t k, i, last, mask, step = 0; \
    234
    725
          mask = h->n_buckets - 1;                  \
    235
    725
          k = __hash_func(key); i = k & mask;              \
    236
    725
          last = i; \
    237
    969
          while (!__ac_isempty(h->flags, i) && (921__ac_isdel921(h->flags, i) || !873__hash_equal873(h->keys[i], key))) { \
    238
    244
            i = (i + (++step)) & mask; \
    239
    244
            if (i == last) return h->n_buckets0;           \
    240
    244
          }                              \
    241
    725
          return __ac_iseither(h->flags, i)? h->n_buckets48 : i677;   \
    242
    725
        } else return 00;                       \
    243
    725
      }                                  \
    Unexecuted instantiation: ccv_nnc_xpu_alloc.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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_get_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_get_dy_alloc
    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_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_backward.c:kh_get_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_get_stream_map
    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_apply_gradients.c:kh_get_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_get_stream_map
    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_minimize.c:kh_get_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_get_stream_map
    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_stateful_exec
    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.41M
      {                                 \
    232
    2.41M
        if (h->n_buckets) {                       \
    233
    2.41M
          khint_t k, i, last, mask, step = 0; \
    234
    2.41M
          mask = h->n_buckets - 1;                  \
    235
    2.41M
          k = __hash_func(key); i = k & mask;              \
    236
    2.41M
          last = i; \
    237
    3.45M
          while (!__ac_isempty(h->flags, i) && (3.45M__ac_isdel3.45M(h->flags, i) || !3.45M__hash_equal3.45M(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.41M
          return __ac_iseither(h->flags, i)? h->n_buckets40 : i2.41M;   \
    242
    2.41M
        } else return 00;                       \
    243
    2.41M
      }                                  \
    Unexecuted instantiation: ccv_cnnp_dataframe.c:kh_get_iter_ctx

    ccv_cnnp_model.c:kh_get_ccv_cnnp_parameter_id

    Line
    Count
    Source
    231
    5
      {                                 \
    232
    5
        if (h->n_buckets) {                       \
    233
    5
          khint_t k, i, last, mask, step = 0; \
    234
    5
          mask = h->n_buckets - 1;                  \
    235
    5
          k = __hash_func(key); i = k & mask;              \
    236
    5
          last = i; \
    237
    5
          while (!__ac_isempty(h->flags, i) && (3__ac_isdel3(h->flags, i) || !3__hash_equal3(h->keys[i], key))) { \
    238
    0
            i = (i + (++step)) & mask; \
    239
    0
            if (i == last) return h->n_buckets;           \
    240
    0
          }                              \
    241
    5
          return __ac_iseither(h->flags, i)? h->n_buckets2 : i3;   \
    242
    5
        } else return 00;                       \
    243
    5
      }                                  \
    Unexecuted instantiation: ccv_cnnp_model.c:kh_get_stream_map
    Unexecuted instantiation: ccv_cnnp_model.c:kh_get_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_get_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_get_dy_alloc
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_get_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_get_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_get_ccv_cnnp_model_name_bank

    ccv_cnnp_model_core.c:kh_get_io_node

    Line
    Count
    Source
    231
    3
      {                                 \
    232
    3
        if (h->n_buckets) {                       \
    233
    3
          khint_t k, i, last, mask, step = 0; \
    234
    3
          mask = h->n_buckets - 1;                  \
    235
    3
          k = __hash_func(key); i = k & mask;              \
    236
    3
          last = i; \
    237
    4
          while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
    238
    1
            i = (i + (++step)) & mask; \
    239
    1
            if (i == last) return h->n_buckets0;           \
    240
    1
          }                              \
    241
    3
          return __ac_iseither(h->flags, i)? h->n_buckets0 : i;   \
    242
    3
        } else return 00;                       \
    243
    3
      }                                  \

    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
    363
          while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \
    238
    263
            i = (i + (++step)) & mask; \
    239
    263
            if (i == last) return h->n_buckets0;           \
    240
    263
          }                              \
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_get_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_get_dy_alloc
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_get_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_get_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_get_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_get_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_get_ccv_cnnp_tensor_symbol_set

    Line
    Count
    Source
    231
    144
      {                                 \
    232
    144
        if (h->n_buckets) {                       \
    233
    144
          khint_t k, i, last, mask, step = 0; \
    234
    144
          mask = h->n_buckets - 1;                  \
    235
    144
          k = __hash_func(key); i = k & mask;              \
    236
    144
          last = i; \
    237
    294
          while (!__ac_isempty(h->flags, i) && (174__ac_isdel174(h->flags, i) || !174__hash_equal174(h->keys[i], key))) { \
    238
    150
            i = (i + (++step)) & mask; \
    239
    150
            if (i == last) return h->n_buckets0;           \
    240
    150
          }                              \
    241
    144
          return __ac_iseither(h->flags, i)? h->n_buckets120 : i24;   \
    242
    144
        } else return 00;                       \
    243
    144
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_get_ccv_cnnp_tensor_symbol_map

    Line
    Count
    Source
    231
    32
      {                                 \
    232
    32
        if (h->n_buckets) {                       \
    233
    32
          khint_t k, i, last, mask, step = 0; \
    234
    32
          mask = h->n_buckets - 1;                  \
    235
    32
          k = __hash_func(key); i = k & mask;              \
    236
    32
          last = i; \
    237
    51
          while (!__ac_isempty(h->flags, i) && (27__ac_isdel27(h->flags, i) || !27__hash_equal27(h->keys[i], key))) { \
    238
    19
            i = (i + (++step)) & mask; \
    239
    19
            if (i == last) return h->n_buckets0;           \
    240
    19
          }                              \
    241
    32
          return __ac_iseither(h->flags, i)? h->n_buckets24 : i8;   \
    242
    32
        } else return 00;                       \
    243
    32
      }                                  \
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_get_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_get_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_get_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_get_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.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.76k
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    3.76k
        khint32_t *new_flags = 0;                   \
    247
    3.76k
        khint_t j = 1;                          \
    248
    3.76k
        {                               \
    249
    3.76k
          kroundup32(new_n_buckets);                  \
    250
    3.76k
          if (new_n_buckets < 4) new_n_buckets = 43.51k;         \
    251
    3.76k
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    3.76k
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    3.76k
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    3.76k
            if (!new_flags) return -10;               \
    255
    3.76k
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    3.76k
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    3.66k
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    3.66k
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    3.66k
              h->keys = new_keys;                 \
    260
    3.66k
              if (kh_is_map) {                 \
    261
    3.64k
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    3.64k
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    3.64k
                h->vals = new_vals;               \
    264
    3.64k
              }                          \
    265
    3.66k
            } /* otherwise shrink */               \
    266
    3.76k
          }                             \
    267
    3.76k
        }                               \
    268
    3.76k
        if (j) { /* rehashing is needed */               \
    269
    398k
          for (j = 0; j != h->n_buckets; ++j395k) {           \
    270
    395k
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    303k
              khkey_t key = h->keys[j];             \
    272
    303k
              khval_t val;                    \
    273
    303k
              khint_t new_mask;                 \
    274
    303k
              new_mask = new_n_buckets - 1;             \
    275
    303k
              if (kh_is_map) val = h->vals[j]303k;         \
    276
    303k
              __ac_set_isdel_true(h->flags, j);          \
    277
    303k
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    303k
                khint_t k, i, step = 0; \
    279
    303k
                k = __hash_func303k(key);              \
    280
    303k
                i = k & new_mask;               \
    281
    402k
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask99.3k; \
    282
    303k
                __ac_set_isempty_false(new_flags, i);     \
    283
    303k
                if (i < h->n_buckets && __ac_iseither151k(h->flags, i) == 0151k) { /* kick out the existing element */ \
    284
    289
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    289
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    289
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    303k
                } else { /* write the element and jump out of the loop */ \
    288
    303k
                  h->keys[i] = key;             \
    289
    303k
                  if (kh_is_map) h->vals[i] = val303k;     \
    290
    303k
                  break;                    \
    291
    303k
                }                        \
    292
    303k
              }                          \
    293
    303k
            }                            \
    294
    395k
          }                              \
    295
    3.76k
          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.76k
          kfree(h->flags); /* free the working space */        \
    300
    3.76k
          h->flags = new_flags;                   \
    301
    3.76k
          h->n_buckets = new_n_buckets;               \
    302
    3.76k
          h->n_occupied = h->size;                  \
    303
    3.76k
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    3.76k
        }                               \
    305
    3.76k
        return 0;                           \
    306
    3.76k
      }                                  \

    imdb.tests.c:kh_resize_vocab_map

    Line
    Count
    Source
    245
    48
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    48
        khint32_t *new_flags = 0;                   \
    247
    48
        khint_t j = 1;                          \
    248
    48
        {                               \
    249
    48
          kroundup32(new_n_buckets);                  \
    250
    48
          if (new_n_buckets < 4) new_n_buckets = 43;         \
    251
    48
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    48
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    48
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    48
            if (!new_flags) return -10;               \
    255
    48
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    48
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    48
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    48
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    48
              h->keys = new_keys;                 \
    260
    48
              if (kh_is_map) {                 \
    261
    48
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    48
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    48
                h->vals = new_vals;               \
    264
    48
              }                          \
    265
    48
            } /* otherwise shrink */                \
    266
    48
          }                             \
    267
    48
        }                               \
    268
    48
        if (j) { /* rehashing is needed */               \
    269
    393k
          for (j = 0; j != h->n_buckets; ++j393k) {           \
    270
    393k
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    302k
              khkey_t key = h->keys[j];             \
    272
    302k
              khval_t val;                    \
    273
    302k
              khint_t new_mask;                 \
    274
    302k
              new_mask = new_n_buckets - 1;             \
    275
    302k
              if (kh_is_map) val = h->vals[j];         \
    276
    302k
              __ac_set_isdel_true(h->flags, j);          \
    277
    302k
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    302k
                khint_t k, i, step = 0; \
    279
    302k
                k = __hash_func(key);              \
    280
    302k
                i = k & new_mask;               \
    281
    400k
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask97.4k; \
    282
    302k
                __ac_set_isempty_false(new_flags, i);     \
    283
    302k
                if (i < h->n_buckets && __ac_iseither150k(h->flags, i) == 0150k) { /* kick out the existing element */ \
    284
    174
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    174
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    174
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    302k
                } else { /* write the element and jump out of the loop */ \
    288
    302k
                  h->keys[i] = key;             \
    289
    302k
                  if (kh_is_map) h->vals[i] = val;     \
    290
    302k
                  break;                    \
    291
    302k
                }                        \
    292
    302k
              }                          \
    293
    302k
            }                            \
    294
    393k
          }                              \
    295
    48
          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
    48
          kfree(h->flags); /* free the working space */        \
    300
    48
          h->flags = new_flags;                   \
    301
    48
          h->n_buckets = new_n_buckets;               \
    302
    48
          h->n_occupied = h->size;                  \
    303
    48
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    48
        }                               \
    305
    48
        return 0;                           \
    306
    48
      }                                  \
    Unexecuted instantiation: mpsblas.tests.c:kh_resize_stream_map
    Unexecuted instantiation: tape.tests.c:kh_resize_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_resize_stream_map

    ccv_nnc_cmd.c:kh_resize_autotune_executable_cache

    Line
    Count
    Source
    245
    10
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    10
        khint32_t *new_flags = 0;                   \
    247
    10
        khint_t j = 1;                          \
    248
    10
        {                               \
    249
    10
          kroundup32(new_n_buckets);                  \
    250
    10
          if (new_n_buckets < 4) new_n_buckets = 41;         \
    251
    10
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    10
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    10
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    10
            if (!new_flags) return -10;               \
    255
    10
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    10
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    6
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    6
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    6
              h->keys = new_keys;                 \
    260
    6
              if (kh_is_map) {                 \
    261
    6
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    6
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    6
                h->vals = new_vals;               \
    264
    6
              }                          \
    265
    6
            } /* otherwise shrink */               \
    266
    10
          }                             \
    267
    10
        }                               \
    268
    10
        if (j) { /* rehashing is needed */               \
    269
    646
          for (j = 0; j != h->n_buckets; ++j636) {           \
    270
    636
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    174
              khkey_t key = h->keys[j];             \
    272
    174
              khval_t val;                    \
    273
    174
              khint_t new_mask;                 \
    274
    174
              new_mask = new_n_buckets - 1;             \
    275
    174
              if (kh_is_map) val = h->vals[j];         \
    276
    174
              __ac_set_isdel_true(h->flags, j);          \
    277
    175
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    175
                khint_t k, i, step = 0; \
    279
    175
                k = __hash_func(key);             \
    280
    175
                i = k & new_mask;               \
    281
    197
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask22; \
    282
    175
                __ac_set_isempty_false(new_flags, i);     \
    283
    175
                if (i < h->n_buckets && __ac_iseither123(h->flags, i) == 0123) { /* kick out the existing element */ \
    284
    1
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    1
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    1
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    174
                } else { /* write the element and jump out of the loop */ \
    288
    174
                  h->keys[i] = key;             \
    289
    174
                  if (kh_is_map) h->vals[i] = val;     \
    290
    174
                  break;                    \
    291
    174
                }                        \
    292
    175
              }                          \
    293
    174
            }                            \
    294
    636
          }                              \
    295
    10
          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
    10
          kfree(h->flags); /* free the working space */        \
    300
    10
          h->flags = new_flags;                   \
    301
    10
          h->n_buckets = new_n_buckets;               \
    302
    10
          h->n_occupied = h->size;                  \
    303
    10
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    10
        }                               \
    305
    10
        return 0;                           \
    306
    10
      }                                  \
    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) { 0kfree0(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) { 0kfree0(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) { 0kfree0(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) { 0kfree0(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) { 0kfree0(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_symbolic_graph_compile.c:kh_resize_obj_ptr
    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_xpu_alloc.c:kh_resize_dy_str

    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 = 4;         \
    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) { 0kfree0(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) { 0kfree0(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
    12
          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
    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
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_resize_dy_alloc

    Line
    Count
    Source
    245
    135
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    135
        khint32_t *new_flags = 0;                   \
    247
    135
        khint_t j = 1;                          \
    248
    135
        {                               \
    249
    135
          kroundup32(new_n_buckets);                  \
    250
    135
          if (new_n_buckets < 4) new_n_buckets = 412;         \
    251
    135
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    135
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    135
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    135
            if (!new_flags) return -10;               \
    255
    135
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    135
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    35
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    35
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    35
              h->keys = new_keys;                 \
    260
    35
              if (kh_is_map) {                 \
    261
    35
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    35
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    35
                h->vals = new_vals;               \
    264
    35
              }                          \
    265
    35
            } /* otherwise shrink */               \
    266
    135
          }                             \
    267
    135
        }                               \
    268
    135
        if (j) { /* rehashing is needed */               \
    269
    879
          for (j = 0; j != h->n_buckets; ++j744) {           \
    270
    744
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    194
              khkey_t key = h->keys[j];             \
    272
    194
              khval_t val;                    \
    273
    194
              khint_t new_mask;                 \
    274
    194
              new_mask = new_n_buckets - 1;             \
    275
    194
              if (kh_is_map) val = h->vals[j];         \
    276
    194
              __ac_set_isdel_true(h->flags, j);          \
    277
    257
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    257
                khint_t k, i, step = 0; \
    279
    257
                k = __hash_func(key);              \
    280
    257
                i = k & new_mask;               \
    281
    1.67k
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask1.41k; \
    282
    257
                __ac_set_isempty_false(new_flags, i);     \
    283
    257
                if (i < h->n_buckets && __ac_iseither125(h->flags, i) == 0125) { /* kick out the existing element */ \
    284
    63
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    63
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    63
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    194
                } else { /* write the element and jump out of the loop */ \
    288
    194
                  h->keys[i] = key;             \
    289
    194
                  if (kh_is_map) h->vals[i] = val;     \
    290
    194
                  break;                    \
    291
    194
                }                        \
    292
    257
              }                          \
    293
    194
            }                            \
    294
    744
          }                              \
    295
    135
          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
    135
          kfree(h->flags); /* free the working space */        \
    300
    135
          h->flags = new_flags;                   \
    301
    135
          h->n_buckets = new_n_buckets;               \
    302
    135
          h->n_occupied = h->size;                  \
    303
    135
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    135
        }                               \
    305
    135
        return 0;                           \
    306
    135
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_resize_dy_dev

    Line
    Count
    Source
    245
    23
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    23
        khint32_t *new_flags = 0;                   \
    247
    23
        khint_t j = 1;                          \
    248
    23
        {                               \
    249
    23
          kroundup32(new_n_buckets);                  \
    250
    23
          if (new_n_buckets < 4) new_n_buckets = 419;         \
    251
    23
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    23
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    23
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    23
            if (!new_flags) return -10;               \
    255
    23
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    23
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    23
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    23
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    23
              h->keys = new_keys;                 \
    260
    23
              if (kh_is_map) {                 \
    261
    23
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    23
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    23
                h->vals = new_vals;               \
    264
    23
              }                          \
    265
    23
            } /* otherwise shrink */                \
    266
    23
          }                             \
    267
    23
        }                               \
    268
    23
        if (j) { /* rehashing is needed */               \
    269
    39
          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
    23
          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
    23
          kfree(h->flags); /* free the working space */        \
    300
    23
          h->flags = new_flags;                   \
    301
    23
          h->n_buckets = new_n_buckets;               \
    302
    23
          h->n_occupied = h->size;                  \
    303
    23
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    23
        }                               \
    305
    23
        return 0;                           \
    306
    23
      }                                  \
    Unexecuted instantiation: ccv_nnc_xpu_alloc.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) { 0kfree0(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) { 0kfree0(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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_resize_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_resize_dy_alloc
    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_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_backward.c:kh_resize_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_resize_stream_map
    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_apply_gradients.c:kh_resize_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_resize_stream_map
    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_minimize.c:kh_resize_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_resize_stream_map
    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_stateful_exec
    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
    56
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    56
        khint32_t *new_flags = 0;                   \
    247
    56
        khint_t j = 1;                          \
    248
    56
        {                               \
    249
    56
          kroundup32(new_n_buckets);                  \
    250
    56
          if (new_n_buckets < 4) new_n_buckets = 4;         \
    251
    56
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    56
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    56
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    56
            if (!new_flags) return -10;               \
    255
    56
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    56
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    56
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    56
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    56
              h->keys = new_keys;                 \
    260
    56
              if (kh_is_map) {                 \
    261
    56
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    56
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    56
                h->vals = new_vals;               \
    264
    56
              }                          \
    265
    56
            } /* otherwise shrink */                \
    266
    56
          }                             \
    267
    56
        }                               \
    268
    56
        if (j) { /* rehashing is needed */               \
    269
    56
          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
    56
          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
    56
          kfree(h->flags); /* free the working space */        \
    300
    56
          h->flags = new_flags;                   \
    301
    56
          h->n_buckets = new_n_buckets;               \
    302
    56
          h->n_occupied = h->size;                  \
    303
    56
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    56
        }                               \
    305
    56
        return 0;                           \
    306
    56
      }                                  \

    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) { 0kfree0(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) { 0kfree0(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.25k
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    1.25k
        khint32_t *new_flags = 0;                   \
    247
    1.25k
        khint_t j = 1;                          \
    248
    1.25k
        {                               \
    249
    1.25k
          kroundup32(new_n_buckets);                  \
    250
    1.25k
          if (new_n_buckets < 4) new_n_buckets = 4;         \
    251
    1.25k
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    1.25k
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    1.25k
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    1.25k
            if (!new_flags) return -10;               \
    255
    1.25k
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    1.25k
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    1.25k
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    1.25k
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    1.25k
              h->keys = new_keys;                 \
    260
    1.25k
              if (kh_is_map) {                 \
    261
    1.25k
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    1.25k
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    1.25k
                h->vals = new_vals;               \
    264
    1.25k
              }                          \
    265
    1.25k
            } /* otherwise shrink */                \
    266
    1.25k
          }                             \
    267
    1.25k
        }                               \
    268
    1.25k
        if (j) { /* rehashing is needed */               \
    269
    1.25k
          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.25k
          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.25k
          kfree(h->flags); /* free the working space */        \
    300
    1.25k
          h->flags = new_flags;                   \
    301
    1.25k
          h->n_buckets = new_n_buckets;               \
    302
    1.25k
          h->n_occupied = h->size;                  \
    303
    1.25k
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    1.25k
        }                               \
    305
    1.25k
        return 0;                           \
    306
    1.25k
      }                                  \

    ccv_cnnp_model.c:kh_resize_ccv_cnnp_parameter_id

    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) { 0kfree0(new_flags); return -1; }    \
    259
    3
              h->keys = new_keys;                 \
    260
    3
              if (kh_is_map) {                 \
    261
    3
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    3
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    3
                h->vals = new_vals;               \
    264
    3
              }                          \
    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_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) { 0kfree0(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) { 0kfree0(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.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_resize_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_resize_dy_alloc
    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.13k
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    1.13k
        khint32_t *new_flags = 0;                   \
    247
    1.13k
        khint_t j = 1;                          \
    248
    1.13k
        {                               \
    249
    1.13k
          kroundup32(new_n_buckets);                  \
    250
    1.13k
          if (new_n_buckets < 4) new_n_buckets = 41.10k;         \
    251
    1.13k
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    1.13k
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    1.13k
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    1.13k
            if (!new_flags) return -10;               \
    255
    1.13k
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    1.13k
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    1.13k
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    1.13k
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    1.13k
              h->keys = new_keys;                 \
    260
    1.13k
              if (kh_is_map) {                 \
    261
    1.13k
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    1.13k
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    1.13k
                h->vals = new_vals;               \
    264
    1.13k
              }                          \
    265
    1.13k
            } /* otherwise shrink */                \
    266
    1.13k
          }                             \
    267
    1.13k
        }                               \
    268
    1.13k
        if (j) { /* rehashing is needed */               \
    269
    1.25k
          for (j = 0; j != h->n_buckets; ++j124) {           \
    270
    124
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    89
              khkey_t key = h->keys[j];             \
    272
    89
              khval_t val;                    \
    273
    89
              khint_t new_mask;                 \
    274
    89
              new_mask = new_n_buckets - 1;             \
    275
    89
              if (kh_is_map) val = h->vals[j];         \
    276
    89
              __ac_set_isdel_true(h->flags, j);          \
    277
    93
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    93
                khint_t k, i, step = 0; \
    279
    93
                k = __hash_func(key);              \
    280
    93
                i = k & new_mask;               \
    281
    97
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask4; \
    282
    93
                __ac_set_isempty_false(new_flags, i);     \
    283
    93
                if (i < h->n_buckets && __ac_iseither42(h->flags, i) == 042) { /* 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
    89
                } else { /* write the element and jump out of the loop */ \
    288
    89
                  h->keys[i] = key;             \
    289
    89
                  if (kh_is_map) h->vals[i] = val;     \
    290
    89
                  break;                    \
    291
    89
                }                        \
    292
    93
              }                          \
    293
    89
            }                            \
    294
    124
          }                              \
    295
    1.13k
          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.13k
          kfree(h->flags); /* free the working space */        \
    300
    1.13k
          h->flags = new_flags;                   \
    301
    1.13k
          h->n_buckets = new_n_buckets;               \
    302
    1.13k
          h->n_occupied = h->size;                  \
    303
    1.13k
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    1.13k
        }                               \
    305
    1.13k
        return 0;                           \
    306
    1.13k
      }                                  \

    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) { 0kfree0(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) { 0kfree0(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
    84
              khkey_t key = h->keys[j];             \
    272
    84
              khval_t val;                    \
    273
    84
              khint_t new_mask;                 \
    274
    84
              new_mask = new_n_buckets - 1;             \
    275
    84
              if (kh_is_map) val = h->vals[j];         \
    276
    84
              __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
    377
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask265; \
    282
    112
                __ac_set_isempty_false(new_flags, i);     \
    283
    112
                if (i < h->n_buckets && __ac_iseither60(h->flags, i) == 060) { /* kick out the existing element */ \
    284
    28
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    28
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    28
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    84
                } else { /* write the element and jump out of the loop */ \
    288
    84
                  h->keys[i] = key;             \
    289
    84
                  if (kh_is_map) h->vals[i] = val;     \
    290
    84
                  break;                    \
    291
    84
                }                        \
    292
    112
              }                          \
    293
    84
            }                            \
    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_io_node

    Line
    Count
    Source
    245
    2
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    2
        khint32_t *new_flags = 0;                   \
    247
    2
        khint_t j = 1;                          \
    248
    2
        {                               \
    249
    2
          kroundup32(new_n_buckets);                  \
    250
    2
          if (new_n_buckets < 4) new_n_buckets = 4;         \
    251
    2
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    2
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    2
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    2
            if (!new_flags) return -10;               \
    255
    2
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    2
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    2
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    2
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    2
              h->keys = new_keys;                 \
    260
    2
              if (kh_is_map) {                 \
    261
    2
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    2
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    2
                h->vals = new_vals;               \
    264
    2
              }                          \
    265
    2
            } /* otherwise shrink */                \
    266
    2
          }                             \
    267
    2
        }                               \
    268
    2
        if (j) { /* rehashing is needed */               \
    269
    2
          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
    2
          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
    2
          kfree(h->flags); /* free the working space */        \
    300
    2
          h->flags = new_flags;                   \
    301
    2
          h->n_buckets = new_n_buckets;               \
    302
    2
          h->n_occupied = h->size;                  \
    303
    2
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    2
        }                               \
    305
    2
        return 0;                           \
    306
    2
      }                                  \

    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) { 0kfree0(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) { 0kfree0(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
    38
              khkey_t key = h->keys[j];             \
    272
    38
              khval_t val;                    \
    273
    38
              khint_t new_mask;                 \
    274
    38
              new_mask = new_n_buckets - 1;             \
    275
    38
              if (kh_is_map) val = h->vals[j];         \
    276
    38
              __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_iseither22(h->flags, i) == 022) { /* kick out the existing element */ \
    284
    7
                  { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \
    285
    7
                  if (kh_is_map) { khval_t tmp = h->vals[i]; h->vals[i] = val; val = tmp; } \
    286
    7
                  __ac_set_isdel_true(h->flags, i); /* mark it as deleted in the old hash table */ \
    287
    38
                } else { /* write the element and jump out of the loop */ \
    288
    38
                  h->keys[i] = key;             \
    289
    38
                  if (kh_is_map) h->vals[i] = val;     \
    290
    38
                  break;                    \
    291
    38
                }                        \
    292
    45
              }                          \
    293
    38
            }                            \
    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_core.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_resize_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_stream_map
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_resize_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_resize_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_resize_ccv_cnnp_tensor_symbol_set

    Line
    Count
    Source
    245
    10
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    10
        khint32_t *new_flags = 0;                   \
    247
    10
        khint_t j = 1;                          \
    248
    10
        {                               \
    249
    10
          kroundup32(new_n_buckets);                  \
    250
    10
          if (new_n_buckets < 4) new_n_buckets = 44;         \
    251
    10
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    10
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    10
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    10
            if (!new_flags) return -10;               \
    255
    10
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    10
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    10
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    10
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    10
              h->keys = new_keys;                 \
    260
    10
              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
    10
            } /* otherwise shrink */                \
    266
    10
          }                             \
    267
    10
        }                               \
    268
    10
        if (j) { /* rehashing is needed */               \
    269
    54
          for (j = 0; j != h->n_buckets; ++j44) {           \
    270
    44
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    33
              khkey_t key = h->keys[j];             \
    272
    33
              khval_t val;                    \
    273
    33
              khint_t new_mask;                 \
    274
    33
              new_mask = new_n_buckets - 1;             \
    275
    33
              if (kh_is_map) val = h->vals[j]0;         \
    276
    33
              __ac_set_isdel_true(h->flags, j);          \
    277
    33
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    33
                khint_t k, i, step = 0; \
    279
    33
                k = __hash_func(key);              \
    280
    33
                i = k & new_mask;               \
    281
    33
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask0; \
    282
    33
                __ac_set_isempty_false(new_flags, i);     \
    283
    33
                if (i < h->n_buckets && __ac_iseither20(h->flags, i) == 020) { /* 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
    33
                } else { /* write the element and jump out of the loop */ \
    288
    33
                  h->keys[i] = key;             \
    289
    33
                  if (kh_is_map) h->vals[i] = val0;     \
    290
    33
                  break;                    \
    291
    33
                }                       \
    292
    33
              }                         \
    293
    33
            }                            \
    294
    44
          }                              \
    295
    10
          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
    10
          kfree(h->flags); /* free the working space */        \
    300
    10
          h->flags = new_flags;                   \
    301
    10
          h->n_buckets = new_n_buckets;               \
    302
    10
          h->n_occupied = h->size;                  \
    303
    10
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    10
        }                               \
    305
    10
        return 0;                           \
    306
    10
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_resize_ccv_cnnp_tensor_symbol_map

    Line
    Count
    Source
    245
    5
      { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \
    246
    5
        khint32_t *new_flags = 0;                   \
    247
    5
        khint_t j = 1;                          \
    248
    5
        {                               \
    249
    5
          kroundup32(new_n_buckets);                  \
    250
    5
          if (new_n_buckets < 4) new_n_buckets = 42;         \
    251
    5
          if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 00; /* requested size is too small */ \
    252
    5
          else { /* hash table size to be changed (shrink or expand); rehash */ \
    253
    5
            new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t));  \
    254
    5
            if (!new_flags) return -10;               \
    255
    5
            memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \
    256
    5
            if (h->n_buckets < new_n_buckets) { /* expand */    \
    257
    5
              khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \
    258
    5
              if (!new_keys) { 0kfree0(new_flags); return -1; }    \
    259
    5
              h->keys = new_keys;                 \
    260
    5
              if (kh_is_map) {                 \
    261
    5
                khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \
    262
    5
                if (!new_vals) { 0kfree0(new_flags); return -1; }  \
    263
    5
                h->vals = new_vals;               \
    264
    5
              }                          \
    265
    5
            } /* otherwise shrink */                \
    266
    5
          }                             \
    267
    5
        }                               \
    268
    5
        if (j) { /* rehashing is needed */               \
    269
    33
          for (j = 0; j != h->n_buckets; ++j28) {           \
    270
    28
            if (__ac_iseither(h->flags, j) == 0) {         \
    271
    21
              khkey_t key = h->keys[j];             \
    272
    21
              khval_t val;                    \
    273
    21
              khint_t new_mask;                 \
    274
    21
              new_mask = new_n_buckets - 1;             \
    275
    21
              if (kh_is_map) val = h->vals[j];         \
    276
    21
              __ac_set_isdel_true(h->flags, j);          \
    277
    21
              while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \
    278
    21
                khint_t k, i, step = 0; \
    279
    21
                k = __hash_func(key);              \
    280
    21
                i = k & new_mask;               \
    281
    21
                while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask0; \
    282
    21
                __ac_set_isempty_false(new_flags, i);     \
    283
    21
                if (i < h->n_buckets && __ac_iseither13(h->flags, i) == 013) { /* 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
    21
                } else { /* write the element and jump out of the loop */ \
    288
    21
                  h->keys[i] = key;             \
    289
    21
                  if (kh_is_map) h->vals[i] = val;     \
    290
    21
                  break;                    \
    291
    21
                }                       \
    292
    21
              }                         \
    293
    21
            }                            \
    294
    28
          }                              \
    295
    5
          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
    5
          kfree(h->flags); /* free the working space */        \
    300
    5
          h->flags = new_flags;                   \
    301
    5
          h->n_buckets = new_n_buckets;               \
    302
    5
          h->n_occupied = h->size;                  \
    303
    5
          h->upper_bound = (khint_t)(h->n_buckets * __ac_HASH_UPPER + 0.5); \
    304
    5
        }                               \
    305
    5
        return 0;                           \
    306
    5
      }                                  \
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_resize_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_resize_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_resize_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_resize_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.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
    461k
      {                                 \
    309
    461k
        khint_t x;                            \
    310
    461k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    3.76k
          if (h->n_buckets > (h->size<<1)) {             \
    312
    104
            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.66k
          } 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.76k
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    461k
        {                               \
    320
    461k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    461k
          x = site = h->n_buckets; k = __hash_func458k(key); i = k & mask; \
    322
    461k
          if (__ac_isempty(h->flags, i)) x = i120k; /* for speed up */  \
    323
    461k
          else {                           \
    324
    340k
            last = i; \
    325
    996k
            while (!__ac_isempty(h->flags, i) && (842k__ac_isdel842k(h->flags, i) || !835k__hash_equal835k(h->keys[i], key))) { \
    326
    656k
              if (__ac_isdel(h->flags, i)) site = i3.62k;       \
    327
    656k
              i = (i + (++step)) & mask; \
    328
    656k
              if (i == last) { x = site; break; }0          \
    329
    656k
            }                            \
    330
    340k
            if (x == h->n_buckets) {               \
    331
    340k
              if (__ac_isempty(h->flags, i) && site != h->n_buckets154k) x = site772; \
    332
    340k
              else x = i339k;                     \
    333
    340k
            }                           \
    334
    340k
          }                              \
    335
    461k
        }                               \
    336
    461k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    274k
          h->keys[x] = key;                     \
    338
    274k
          __ac_set_isboth_false(h->flags, x);              \
    339
    274k
          ++h->size; ++h->n_occupied;                 \
    340
    274k
          *ret = 1;                         \
    341
    274k
        } else if (186k__ac_isdel186k(h->flags, x)) { /* deleted */       \
    342
    772
          h->keys[x] = key;                     \
    343
    772
          __ac_set_isboth_false(h->flags, x);              \
    344
    772
          ++h->size;                          \
    345
    772
          *ret = 2;                         \
    346
    186k
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    461k
        return x;                           \
    348
    461k
      }                                  \

    imdb.tests.c:kh_put_vocab_map

    Line
    Count
    Source
    308
    268k
      {                                 \
    309
    268k
        khint_t x;                            \
    310
    268k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    48
          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
    48
          } 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
    48
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    268k
        {                               \
    320
    268k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    268k
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    268k
          if (__ac_isempty(h->flags, i)) x = i116k; /* for speed up */  \
    323
    268k
          else {                           \
    324
    151k
            last = i; \
    325
    720k
            while (!__ac_isempty(h->flags, i) && (568k__ac_isdel568k(h->flags, i) || !568k__hash_equal568k(h->keys[i], key))) { \
    326
    568k
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    568k
              i = (i + (++step)) & mask; \
    328
    568k
              if (i == last) { x = site; break; }0          \
    329
    568k
            }                            \
    330
    151k
            if (x == h->n_buckets) {               \
    331
    151k
              if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site0; \
    332
    151k
              else x = i;                     \
    333
    151k
            }                           \
    334
    151k
          }                              \
    335
    268k
        }                               \
    336
    268k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    268k
          h->keys[x] = key;                     \
    338
    268k
          __ac_set_isboth_false(h->flags, x);              \
    339
    268k
          ++h->size; ++h->n_occupied;                 \
    340
    268k
          *ret = 1;                         \
    341
    268k
        } 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
    268k
        return x;                           \
    348
    268k
      }                                  \
    Unexecuted instantiation: mpsblas.tests.c:kh_put_stream_map
    Unexecuted instantiation: tape.tests.c:kh_put_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_put_stream_map

    ccv_nnc_cmd.c:kh_put_autotune_executable_cache

    Line
    Count
    Source
    308
    2.69k
      {                                 \
    309
    2.69k
        khint_t x;                            \
    310
    2.69k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    10
          if (h->n_buckets > (h->size<<1)) {             \
    312
    4
            if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
    313
    0
              *ret = -1; return h->n_buckets;           \
    314
    0
            }                            \
    315
    6
          } 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
    10
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    2.69k
        {                               \
    320
    2.69k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    2.69k
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    2.69k
          if (__ac_isempty(h->flags, i)) x = i240; /* for speed up */  \
    323
    2.69k
          else {                           \
    324
    2.45k
            last = i; \
    325
    6.00k
            while (!__ac_isempty(h->flags, i) && (5.31k__ac_isdel5.31k(h->flags, i) || !__hash_equal(h->keys[i], key)2.86k)) { \
    326
    3.54k
              if (__ac_isdel(h->flags, i)) site = i2.45k;       \
    327
    3.54k
              i = (i + (++step)) & mask; \
    328
    3.54k
              if (i == last) { x = site; break; }0          \
    329
    3.54k
            }                            \
    330
    2.45k
            if (x == h->n_buckets) {               \
    331
    2.45k
              if (__ac_isempty(h->flags, i) && site != h->n_buckets694) x = site600; \
    332
    2.45k
              else x = i1.85k;                     \
    333
    2.45k
            }                           \
    334
    2.45k
          }                              \
    335
    2.69k
        }                               \
    336
    2.69k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    334
          h->keys[x] = key;                     \
    338
    334
          __ac_set_isboth_false(h->flags, x);              \
    339
    334
          ++h->size; ++h->n_occupied;                 \
    340
    334
          *ret = 1;                         \
    341
    2.36k
        } else if (__ac_isdel(h->flags, x)) { /* deleted */       \
    342
    600
          h->keys[x] = key;                     \
    343
    600
          __ac_set_isboth_false(h->flags, x);              \
    344
    600
          ++h->size;                          \
    345
    600
          *ret = 2;                         \
    346
    1.76k
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    2.69k
        return x;                           \
    348
    2.69k
      }                                  \
    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_symbolic_graph_compile.c:kh_put_obj_ptr
    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_xpu_alloc.c:kh_put_dy_str

    Line
    Count
    Source
    308
    723
      {                                 \
    309
    723
        khint_t x;                            \
    310
    723
        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
    723
        {                               \
    320
    723
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    723
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    723
          if (__ac_isempty(h->flags, i)) x = i18; /* for speed up */  \
    323
    723
          else {                           \
    324
    705
            last = i; \
    325
    901
            while (!__ac_isempty(h->flags, i) && (900__ac_isdel900(h->flags, i) || !900__hash_equal900(h->keys[i], key))) { \
    326
    196
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    196
              i = (i + (++step)) & mask; \
    328
    196
              if (i == last) { x = site; break; }0          \
    329
    196
            }                            \
    330
    705
            if (x == h->n_buckets) {               \
    331
    705
              if (__ac_isempty(h->flags, i) && site != h->n_buckets1) x = site0; \
    332
    705
              else x = i;                     \
    333
    705
            }                           \
    334
    705
          }                              \
    335
    723
        }                               \
    336
    723
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    19
          h->keys[x] = key;                     \
    338
    19
          __ac_set_isboth_false(h->flags, x);              \
    339
    19
          ++h->size; ++h->n_occupied;                 \
    340
    19
          *ret = 1;                         \
    341
    704
        } 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
    704
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    723
        return x;                           \
    348
    723
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_put_dy_alloc

    Line
    Count
    Source
    308
    723
      {                                 \
    309
    723
        khint_t x;                            \
    310
    723
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    135
          if (h->n_buckets > (h->size<<1)) {             \
    312
    100
            if (kh_resize_##name(h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \
    313
    0
              *ret = -1; return h->n_buckets;           \
    314
    0
            }                            \
    315
    100
          } else if (35kh_resize_35##35name(h, h->n_buckets + 1) < 0) { /* expand the hash table */ \
    316
    0
            *ret = -1; return h->n_buckets;             \
    317
    0
          }                              \
    318
    135
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    723
        {                               \
    320
    723
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    723
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    723
          if (__ac_isempty(h->flags, i)) x = i115; /* for speed up */  \
    323
    723
          else {                           \
    324
    608
            last = i; \
    325
    7.86k
            while (!__ac_isempty(h->flags, i) && (7.25k__ac_isdel7.25k(h->flags, i) || !6.07k__hash_equal6.07k(h->keys[i], key))) { \
    326
    7.25k
              if (__ac_isdel(h->flags, i)) site = i1.17k;       \
    327
    7.25k
              i = (i + (++step)) & mask; \
    328
    7.25k
              if (i == last) { x = site; break; }0          \
    329
    7.25k
            }                            \
    330
    608
            if (x == h->n_buckets) {               \
    331
    608
              if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site172; \
    332
    608
              else x = i436;                     \
    333
    608
            }                           \
    334
    608
          }                              \
    335
    723
        }                               \
    336
    723
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    551
          h->keys[x] = key;                     \
    338
    551
          __ac_set_isboth_false(h->flags, x);              \
    339
    551
          ++h->size; ++h->n_occupied;                 \
    340
    551
          *ret = 1;                         \
    341
    551
        } else if (172__ac_isdel172(h->flags, x)) { /* deleted */       \
    342
    172
          h->keys[x] = key;                     \
    343
    172
          __ac_set_isboth_false(h->flags, x);              \
    344
    172
          ++h->size;                          \
    345
    172
          *ret = 2;                         \
    346
    172
        } else *ret = 00; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    723
        return x;                           \
    348
    723
      }                                  \

    ccv_nnc_xpu_alloc.c:kh_put_dy_dev

    Line
    Count
    Source
    308
    675
      {                                 \
    309
    675
        khint_t x;                            \
    310
    675
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    23
          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
    23
          } 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
    23
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    675
        {                               \
    320
    675
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    675
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    675
          if (__ac_isempty(h->flags, i)) x = i42; /* for speed up */  \
    323
    675
          else {                           \
    324
    633
            last = i; \
    325
    633
            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
    633
            if (x == h->n_buckets) {               \
    331
    633
              if (__ac_isempty(h->flags, i) && site != h->n_buckets0) x = site0; \
    332
    633
              else x = i;                     \
    333
    633
            }                           \
    334
    633
          }                              \
    335
    675
        }                               \
    336
    675
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    42
          h->keys[x] = key;                     \
    338
    42
          __ac_set_isboth_false(h->flags, x);              \
    339
    42
          ++h->size; ++h->n_occupied;                 \
    340
    42
          *ret = 1;                         \
    341
    633
        } 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
    633
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    675
        return x;                           \
    348
    675
      }                                  \
    Unexecuted instantiation: ccv_nnc_xpu_alloc.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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_put_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_put_dy_alloc
    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_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_backward.c:kh_put_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_put_stream_map
    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_apply_gradients.c:kh_put_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_put_stream_map
    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_minimize.c:kh_put_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_put_stream_map
    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_stateful_exec
    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
    182k
      {                                 \
    309
    182k
        khint_t x;                            \
    310
    182k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    56
          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
    56
          } 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
    56
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    182k
        {                               \
    320
    182k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    182k
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    182k
          if (__ac_isempty(h->flags, i)) x = i56; /* for speed up */  \
    323
    182k
          else {                           \
    324
    182k
            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
    182k
            if (x == h->n_buckets) {               \
    331
    182k
              if (__ac_isempty(h->flags, i) && site != h->n_buckets6) x = site0; \
    332
    182k
              else x = i;                     \
    333
    182k
            }                           \
    334
    182k
          }                              \
    335
    182k
        }                               \
    336
    182k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    62
          h->keys[x] = key;                     \
    338
    62
          __ac_set_isboth_false(h->flags, x);              \
    339
    62
          ++h->size; ++h->n_occupied;                 \
    340
    62
          *ret = 1;                         \
    341
    182k
        } 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
    182k
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    182k
        return x;                           \
    348
    182k
      }                                  \

    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
    1.25k
      {                                 \
    309
    1.25k
        khint_t x;                            \
    310
    1.25k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    1.25k
          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.25k
          } 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.25k
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    1.25k
        {                               \
    320
    1.25k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    1.25k
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    1.25k
          if (__ac_isempty(h->flags, i)) x = i; /* for speed up */  \
    323
    1.25k
          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
    1.25k
        }                               \
    336
    1.25k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    1.25k
          h->keys[x] = key;                     \
    338
    1.25k
          __ac_set_isboth_false(h->flags, x);              \
    339
    1.25k
          ++h->size; ++h->n_occupied;                 \
    340
    1.25k
          *ret = 1;                         \
    341
    1.25k
        } 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
    1.25k
        return x;                           \
    348
    1.25k
      }                                  \

    ccv_cnnp_model.c:kh_put_ccv_cnnp_parameter_id

    Line
    Count
    Source
    308
    3
      {                                 \
    309
    3
        khint_t x;                            \
    310
    3
        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
    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 = i; /* for speed up */  \
    323
    3
          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
    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_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.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_put_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_put_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_put_dy_alloc
    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
    1.52k
      {                                 \
    309
    1.52k
        khint_t x;                            \
    310
    1.52k
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    1.13k
          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.13k
          } 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.13k
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    1.52k
        {                               \
    320
    1.52k
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    1.52k
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    1.52k
          if (__ac_isempty(h->flags, i)) x = i1.21k; /* for speed up */  \
    323
    1.52k
          else {                           \
    324
    317
            last = i; \
    325
    386
            while (!__ac_isempty(h->flags, i) && (342__ac_isdel342(h->flags, i) || !342__hash_equal342(h->keys[i], key))) { \
    326
    69
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    69
              i = (i + (++step)) & mask; \
    328
    69
              if (i == last) { x = site; break; }0          \
    329
    69
            }                            \
    330
    317
            if (x == h->n_buckets) {               \
    331
    317
              if (__ac_isempty(h->flags, i) && site != h->n_buckets44) x = site0; \
    332
    317
              else x = i;                     \
    333
    317
            }                           \
    334
    317
          }                              \
    335
    1.52k
        }                               \
    336
    1.52k
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    1.25k
          h->keys[x] = key;                     \
    338
    1.25k
          __ac_set_isboth_false(h->flags, x);              \
    339
    1.25k
          ++h->size; ++h->n_occupied;                 \
    340
    1.25k
          *ret = 1;                         \
    341
    1.25k
        } else if (273__ac_isdel273(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
    273
        } else *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \
    347
    1.52k
        return x;                           \
    348
    1.52k
      }                                  \

    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.70k
            while (!__ac_isempty(h->flags, i) && (1.61k__ac_isdel1.61k(h->flags, i) || !1.61k__hash_equal1.61k(h->keys[i], key))) { \
    326
    1.60k
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    1.60k
              i = (i + (++step)) & mask; \
    328
    1.60k
              if (i == last) { x = site; break; }0          \
    329
    1.60k
            }                            \
    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_io_node

    Line
    Count
    Source
    308
    5
      {                                 \
    309
    5
        khint_t x;                            \
    310
    5
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    2
          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
    2
          } 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
    2
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    5
        {                               \
    320
    5
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    5
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    5
          if (__ac_isempty(h->flags, i)) x = i2; /* for speed up */  \
    323
    5
          else {                           \
    324
    3
            last = i; \
    325
    7
            while (!__ac_isempty(h->flags, i) && (4__ac_isdel4(h->flags, i) || !4__hash_equal4(h->keys[i], key))) { \
    326
    4
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    4
              i = (i + (++step)) & mask; \
    328
    4
              if (i == last) { x = site; break; }0          \
    329
    4
            }                            \
    330
    3
            if (x == h->n_buckets) {               \
    331
    3
              if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site0; \
    332
    3
              else x = i;                     \
    333
    3
            }                           \
    334
    3
          }                              \
    335
    5
        }                               \
    336
    5
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    5
          h->keys[x] = key;                     \
    338
    5
          __ac_set_isboth_false(h->flags, x);              \
    339
    5
          ++h->size; ++h->n_occupied;                 \
    340
    5
          *ret = 1;                         \
    341
    5
        } 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
    5
        return x;                           \
    348
    5
      }                                  \

    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_core.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_put_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_put_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_stream_map
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_put_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_put_stream_map

    ccv_cnnp_model_gradient_checkpointing.c:kh_put_ccv_cnnp_tensor_symbol_set

    Line
    Count
    Source
    308
    48
      {                                 \
    309
    48
        khint_t x;                            \
    310
    48
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    10
          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
    10
          } 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
    10
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    48
        {                               \
    320
    48
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    48
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    48
          if (__ac_isempty(h->flags, i)) x = i39; /* for speed up */  \
    323
    48
          else {                           \
    324
    9
            last = i; \
    325
    18
            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
    9
            if (x == h->n_buckets) {               \
    331
    9
              if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site0; \
    332
    9
              else x = i;                     \
    333
    9
            }                           \
    334
    9
          }                              \
    335
    48
        }                               \
    336
    48
        if (__ac_isempty(h->flags, x)) { /* not present at all */    \
    337
    48
          h->keys[x] = key;                     \
    338
    48
          __ac_set_isboth_false(h->flags, x);              \
    339
    48
          ++h->size; ++h->n_occupied;                 \
    340
    48
          *ret = 1;                         \
    341
    48
        } 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
    48
        return x;                           \
    348
    48
      }                                  \

    ccv_cnnp_model_gradient_checkpointing.c:kh_put_ccv_cnnp_tensor_symbol_map

    Line
    Count
    Source
    308
    16
      {                                 \
    309
    16
        khint_t x;                            \
    310
    16
        if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
    311
    5
          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
    5
          } 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
    5
        } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \
    319
    16
        {                               \
    320
    16
          khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \
    321
    16
          x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \
    322
    16
          if (__ac_isempty(h->flags, i)) x = i12; /* for speed up */  \
    323
    16
          else {                           \
    324
    4
            last = i; \
    325
    8
            while (!__ac_isempty(h->flags, i) && (4__ac_isdel4(h->flags, i) || !4__hash_equal4(h->keys[i], key))) { \
    326
    4
              if (__ac_isdel(h->flags, i)) site = i0;       \
    327
    4
              i = (i + (++step)) & mask; \
    328
    4
              if (i == last) { x = site; break; }0          \
    329
    4
            }                           \
    330
    4
            if (x == h->n_buckets) {               \
    331
    4
              if (__ac_isempty(h->flags, i) && site != h->n_buckets) x = site0; \
    332
    4
              else x = i;                     \
    333
    4
            }                           \
    334
    4
          }                              \
    335
    16
        }                               \
    336
    16
        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 (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
    16
        return x;                           \
    348
    16
      }                                  \
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_put_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_put_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_put_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_put_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_put_ccv_cnnp_model_name_bank
    349
      SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x)       \
    350
    1.70k
      {                                 \
    351
    1.70k
        if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
    352
    1.70k
          __ac_set_isdel_true(h->flags, x);              \
    353
    1.70k
          --h->size;                          \
    354
    1.70k
        }                               \
    355
    1.70k
      }
    Unexecuted instantiation: imdb.tests.c:kh_del_vocab_map
    Unexecuted instantiation: mpsblas.tests.c:kh_del_stream_map
    Unexecuted instantiation: tape.tests.c:kh_del_stream_map
    Unexecuted instantiation: while.backward.tests.c:kh_del_stream_map

    ccv_nnc_cmd.c:kh_del_autotune_executable_cache

    Line
    Count
    Source
    350
    934
      {                                 \
    351
    934
        if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
    352
    934
          __ac_set_isdel_true(h->flags, x);              \
    353
    934
          --h->size;                          \
    354
    934
        }                               \
    355
    934
      }
    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_symbolic_graph_compile.c:kh_del_obj_ptr
    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

    ccv_nnc_xpu_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_xpu_alloc.c:kh_del_dy_alloc

    Line
    Count
    Source
    350
    723
      {                                 \
    351
    723
        if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
    352
    723
          __ac_set_isdel_true(h->flags, x);              \
    353
    723
          --h->size;                          \
    354
    723
        }                               \
    355
    723
      }

    ccv_nnc_xpu_alloc.c:kh_del_dy_dev

    Line
    Count
    Source
    350
    42
      {                                 \
    351
    42
        if (x != h->n_buckets && !__ac_iseither(h->flags, x)) {     \
    352
    42
          __ac_set_isdel_true(h->flags, x);              \
    353
    42
          --h->size;                          \
    354
    42
        }                               \
    355
    42
      }
    Unexecuted instantiation: ccv_nnc_xpu_alloc.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_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_dy_alloc
    Unexecuted instantiation: ccv_nnc_dynamic_graph.c:kh_del_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_stream_map
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_dev
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_str
    Unexecuted instantiation: ccv_nnc_dynamic_graph_alloc.c:kh_del_dy_alloc
    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_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_backward.c:kh_del_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_apply_gradients.c:kh_del_stream_map
    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_apply_gradients.c:kh_del_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_minimize.c:kh_del_stream_map
    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_minimize.c:kh_del_stateful_exec
    Unexecuted instantiation: ccv_nnc_dynamic_graph_evaluate.c:kh_del_stream_map
    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_stateful_exec
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model.c:kh_del_dy_str
    Unexecuted instantiation: ccv_cnnp_model.c:kh_del_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model.c:kh_del_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_cnnp_model.c:kh_del_ccv_cnnp_parameter_id
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_stream_map
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_dy_str
    Unexecuted instantiation: ccv_cnnp_model_io.c:kh_del_dy_alloc
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_dy_str
    Unexecuted instantiation: ccv_cnnp_model_core.c:kh_del_dy_alloc
    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_io_node
    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_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_del_dy_str
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_del_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_addons.c:kh_del_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_nnc_palettize.c:kh_del_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_stream_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_dy_dev
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_dy_str
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_dy_alloc
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_ccv_cnnp_model_name_bank
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_ccv_cnnp_tensor_symbol_map
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.c:kh_del_ccv_cnnp_tensor_symbol_set
    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.58k
    #define kh_int_hash_func(key) (khint32_t)(key)
    376
    /*! @function
    377
      @abstract     Integer comparison function
    378
     */
    379
    1.83k
    #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.60M
    #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.72M
    #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
    758k
    {
    397
    758k
      khint_t h = (khint_t)*s;
    398
    5.28M
      if (h758k) for (++s ; 756k*s; ++s4.53M) h = (h << 5) - h + (khint_t)*s4.53M;
    399
    758k
      return h;
    400
    758k
    }

    imdb.tests.c:__ac_X31_hash_string

    Line
    Count
    Source
    396
    756k
    {
    397
    756k
      khint_t h = (khint_t)*s;
    398
    5.28M
      if (h756k) for (++s ; 756k*s; ++s4.53M) h = (h << 5) - h + (khint_t)*s4.53M;
    399
    756k
      return h;
    400
    756k
    }
    Unexecuted instantiation: mpsblas.tests.c:__ac_X31_hash_string
    Unexecuted instantiation: tape.tests.c:__ac_X31_hash_string
    Unexecuted instantiation: while.backward.tests.c:__ac_X31_hash_string
    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_xpu_alloc.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
    1.26k
    {
    397
    1.26k
      khint_t h = (khint_t)*s;
    398
    1.26k
      if (h) for (++s ; 58*s558; ++s500) h = (h << 5) - h + (khint_t)*s500;
    399
    1.26k
      return h;
    400
    1.26k
    }
    Unexecuted instantiation: ccv_cnnp_model_io.c:__ac_X31_hash_string

    ccv_cnnp_model_core.c:__ac_X31_hash_string

    Line
    Count
    Source
    396
    1.62k
    {
    397
    1.62k
      khint_t h = (khint_t)*s;
    398
    1.88k
      if (h1.62k) for (++s ; 329*s; ++s1.55k) h = (h << 5) - h + (khint_t)*s1.55k;
    399
    1.62k
      return h;
    400
    1.62k
    }
    Unexecuted instantiation: ccv_cnnp_model_addons.c:__ac_X31_hash_string
    Unexecuted instantiation: ccv_nnc_palettize.c:__ac_X31_hash_string
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.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
    758k
    #define kh_str_hash_func(key) __ac_X31_hash_string(key)
    407
    /*! @function
    408
      @abstract     Const char* comparison function
    409
     */
    410
    927k
    #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: imdb.tests.c:__ac_Wang_hash
    Unexecuted instantiation: mpsblas.tests.c:__ac_Wang_hash
    Unexecuted instantiation: tape.tests.c:__ac_Wang_hash
    Unexecuted instantiation: while.backward.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_xpu_alloc.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
    Unexecuted instantiation: ccv_nnc_palettize.c:__ac_Wang_hash
    Unexecuted instantiation: ccv_cnnp_model_gradient_checkpointing.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.61M
    #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
    11.0k
    #define kh_init(name) kh_init_##1.00kname()
    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
    11.0k
    #define kh_destroy(name, h) kh_destroy_##1.07kname(h)
    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
    6
    #define kh_clear(name, h) kh_clear_##2name(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
    461k
    #define kh_put(name, h, k, r) kh_put_##name(h, k5.56k, 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.60M
    #define kh_get(name, h, k) kh_get_##84name(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
    1.70k
    #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
    430k
    #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
    269k
    #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.87M
    #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
    5.24k
    #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
    3.03M
    #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
    225
      KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal183)
    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.35k
      KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal1.65k)
    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.72M
      KHASH_INIT(name, khint64_t, khval_t, 1, kh_int64_hash_func2.60M, 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
    927k
      KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func758k, kh_str_hash_equal)
    626
    627
    #endif /* __AC_KHASH_H */