Repository: cupy/cupy
Issue: cupy.nansum won't work in fusing

### Description

This should be a quick fix: in 

https://github.com/cupy/cupy/blob/f822ada05644fee1cf66fd0cc196227d0b2a892f/cupy/_math/sumprod.py#L95

It should be something like `if a.dtype.char in 'FD':`.

### To Reproduce

```py
# Write the code here
import cupy
@cupy.fuse
def nansum_test(arr):
    return cupy.nansum(arr)
nansum_test(cupy.linspace(0,10,5))
```


### Installation

Wheel (`pip install cupy-***`)

### Environment

```
# Paste the output here
OS                           : Windows-10-10.0.19044-SP0
Python Version               : 3.9.13
CuPy Version                 : 11.1.0
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 1.23.3
SciPy Version                : 1.9.1
Cython Build Version         : 0.29.32
Cython Runtime Version       : None
CUDA Root                    : D:\\NV_CUDA\\v11.7
nvcc PATH                    : D:\\NV_CUDA\\v11.7\\bin\\nvcc.EXE
CUDA Build Version           : 11070
CUDA Driver Version          : 11070
CUDA Runtime Version         : 11070
cuBLAS Version               : (available)
cuFFT Version                : 10701
cuRAND Version               : 10210
cuSOLVER Version             : (11, 4, 0)
cuSPARSE Version             : (available)
NVRTC Version                : (11, 7)
Thrust Version               : 101500
CUB Build Version            : 101500
Jitify Build Version         : 4a37de0
cuDNN Build Version          : 8400
cuDNN Version                : 8500
NCCL Build Version           : None
NCCL Runtime Version         : None
cuTENSOR Version             : 10600
cuSPARSELt Build Version     : None
Device 0 Name                : NVIDIA GeForce RTX 3090
Device 0 Compute Capability  : 86
Device 0 PCI Bus ID          : 0000:01:00.0

```


### Additional Information

The line affected can only be reached when `cupy.nansum` is being fused, so without fusing everything is fine.

Changed files:
cupy/_math/sumprod.py, tests/cupy_tests/core_tests/fusion_tests/test_reduction.py

diff --git a/cupy/_math/sumprod.py b/cupy/_math/sumprod.py
index 061c3cdbd..5f93e8b51 100644
--- a/cupy/_math/sumprod.py
+++ b/cupy/_math/sumprod.py
@@ -92,7 +92,7 @@ def nansum(a, axis=None, dtype=None, out=None, keepdims=False):
         if keepdims:
             raise NotImplementedError(
                 'cupy.nansum does not support `keepdims` in fusion yet.')
-        if a.dtype in 'FD':
+        if a.dtype.char in 'FD':
             func = _math._nansum_complex_dtype
         elif dtype is None:
             func = _math._nansum_auto_dtype
diff --git a/tests/cupy_tests/core_tests/fusion_tests/test_reduction.py b/tests/cupy_tests/core_tests/fusion_tests/test_reduction.py
index 3475f7905..91c5fb0a1 100644
--- a/tests/cupy_tests/core_tests/fusion_tests/test_reduction.py
+++ b/tests/cupy_tests/core_tests/fusion_tests/test_reduction.py
@@ -208,3 +208,27 @@ class TestFusionMultistageReductionsMultiAxis(unittest.TestCase):
     @fusion_utils.check_fusion()
     def test_multistage_reductions(self, xp):
         return lambda x: x.prod(axis=(-1, 1)).sum(axis=(0, 1))
+
+
+@testing.gpu
+class TestFusionReductionRoutines(unittest.TestCase):
+
+    def generate_inputs(self, xp):
+        x = testing.shaped_random((30,), xp, 'int64', scale=10, seed=0)
+        return (x,), {}
+
+    @fusion_utils.check_fusion()
+    def test_sum(self, xp):
+        return lambda x: xp.sum(x)
+
+    @fusion_utils.check_fusion()
+    def test_prod(self, xp):
+        return lambda x: xp.prod(x)
+
+    @fusion_utils.check_fusion()
+    def test_nansum(self, xp):
+        return lambda x: xp.nansum(x)
+
+    @fusion_utils.check_fusion()
+    def test_nanprod(self, xp):
+        return lambda x: xp.nanprod(x)