## Coverage Report

#### Created: 2026-04-16 18:32

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

    /home/liu/actions-runner/_work/ccv/ccv/lib/nnc/cmd/isnan/ccv_nnc_reduce_isnan.c

    Line
    Count
    Source
    1
    #include "ccv.h"
    2
    #include "nnc/ccv_nnc.h"
    3
    #include "nnc/ccv_nnc_internal.h"
    4
    5
    static void _ccv_nnc_reduce_tensor_auto_forw(const ccv_nnc_cmd_param_t cmd, const ccv_nnc_tensor_param_t* const inputs, const int input_size, const ccv_nnc_hint_t hint, ccv_nnc_tensor_param_t* const outputs, const int output_size)
    6
    0
    {
    7
    0
      assert(input_size == 1);
    8
    0
      assert(output_size == 1);
    9
    0
      outputs[0] = inputs[0];
    10
    0
      int i;
    11
    0
      for (i = 0; i < cmd.reduce.count; i++)
    12
    0
        outputs[0].dim[cmd.reduce.axis[i]] = 1; // Reduce the dimension to 1.
    13
    0
    }
    14
    15
    static int _ccv_nnc_reduce_isnan_forw_bitmask(const ccv_nnc_cmd_param_t cmd, const int input_size, const int output_size, const uint64_t* const input_bitmasks, const int input_bitmask_size, const uint64_t* const output_bitmasks, const int output_bitmask_size)
    16
    0
    {
    17
    0
      if (input_bitmasks[0] == 1u && output_bitmasks[0] == 1u)
    18
    0
        return 1;
    19
    0
      return 0;
    20
    0
    }
    21
    22
    REGISTER_COMMAND(CCV_NNC_REDUCE_ISNAN_FORWARD)(ccv_nnc_cmd_registry_t* const registry)
    23
      FIND_BACKEND(ccv_nnc_reduce_isnan_cpu_ref.c, gpu/ccv_nnc_reduce_isnan_gpu_cudnn.cu, mps/ccv_nnc_reduce_isnan_mps.m)
    24
    1
    {
    25
    1
      registry->bitmask = _ccv_nnc_reduce_isnan_forw_bitmask;
    26
    1
      registry->tensor_auto = _ccv_nnc_reduce_tensor_auto_forw;
    27
    1
    }
    28
    29
    REGISTER_COMMAND(CCV_NNC_REDUCE_ISNAN_BACKWARD)(ccv_nnc_cmd_registry_t* const registry)
    30
      FIND_BACKEND(ccv_nnc_reduce_isnan_cpu_ref.c, gpu/ccv_nnc_reduce_isnan_gpu_cudnn.cu, mps/ccv_nnc_reduce_isnan_mps.m)
    31
    1
    {
    32
    1
      registry->tensor_auto = ccv_nnc_hint_tensor_auto_backward_from_gradient;
    33
    1
    }
    34
    35
    //@REGISTER_EASY_COMMAND_MACRO(CCV_NNC_REDUCE_ISNAN_FORWARD)
    36
    #define CMD_REDUCE_ISNAN_FORWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_ISNAN_FORWARD, 0, CMD_REDUCE(__VA_ARGS__), 0)
    37
    //@REGISTER_EASY_COMMAND_MACRO(CCV_NNC_REDUCE_ISNAN_BACKWARD)
    38
    #define CMD_REDUCE_ISNAN_BACKWARD(...) ccv_nnc_cmd(CCV_NNC_REDUCE_ISNAN_BACKWARD, 0, CMD_REDUCE(__VA_ARGS__), 0)
    39