internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cupy/cupy

Issue:
`argwhere` is wrong for 0d-array
```
>>> for xp in [numpy, cupy]: print(xp.__name__, xp.__version__, repr(xp.argwhere(xp.array(0, 'i'))))
...
numpy 1.19.2 array([], shape=(0, 0), dtype=int64)
cupy 8.0.0rc1 array([], shape=(0, 1), dtype=int64)
>>> for xp in [numpy, cupy]: print(xp.__name__, xp.__version__, repr(xp.argwhere(xp.array(3, 'i'))))
...
numpy 1.19.2 array([], shape=(1, 0), dtype=int64)
cupy 8.0.0rc1 array([[0]])
```

See https://numpy.org/devdocs/release/1.18.0-notes.html#argwhere-now-produces-a-consistent-result-on-0d-arrays.


Discussion:

Resolving patch:
diff --git a/cupy/_sorting/search.py b/cupy/_sorting/search.py
--- a/cupy/_sorting/search.py
+++ b/cupy/_sorting/search.py
@@ -6,8 +6,6 @@
 from cupy.core import _routines_indexing as _indexing
 from cupy.core import _routines_statistics as _statistics
 
-import warnings
-
 
 def argmax(a, axis=None, dtype=None, out=None, keepdims=False):
     """Returns the indices of the maximum along an axis.
@@ -118,8 +116,6 @@ def nanargmin(a, axis=None, dtype=None, out=None, keepdims=False):
 
     return _statistics._nanargmin(a, axis, dtype, out, keepdims)
 
-# TODO(okuta): Implement argwhere
-
 
 def nonzero(a):
     """Return the indices of the elements that are non-zero.
@@ -232,10 +228,6 @@ def argwhere(a):
 
     """
     _util.check_array(a, arg_name='a')
-    if a.ndim == 0:
-        warnings.warn(
-            'calling argwhere on 0d arrays is deprecated',
-            DeprecationWarning)
     return _indexing._ndarray_argwhere(a)
 
 


Test patch:
diff --git a/tests/cupy_tests/sorting_tests/test_search.py b/tests/cupy_tests/sorting_tests/test_search.py
--- a/tests/cupy_tests/sorting_tests/test_search.py
+++ b/tests/cupy_tests/sorting_tests/test_search.py
@@ -402,14 +402,18 @@ def test_argwhere(self, xp, dtype):
 
 
 @testing.parameterize(
-    {'array': cupy.array(1)},
+    {'value': 0},
+    {'value': 3},
 )
 @testing.gpu
+@testing.with_requires('numpy>=1.18')
 class TestArgwhereZeroDimension(unittest.TestCase):
 
-    def test_argwhere(self):
-        with testing.assert_warns(DeprecationWarning):
-            return cupy.nonzero(self.array)
+    @testing.for_all_dtypes()
+    @testing.numpy_cupy_array_equal()
+    def test_argwhere(self, xp, dtype):
+        array = xp.array(self.value, dtype=dtype)
+        return xp.argwhere(array)
 
 
 @testing.gpu
Repository: cupy/cupy

Issue:
Enhancement: enable CUB backend for ReductionKernel
Currently the CUB reduction is disabled for `ReductionKernel` (by the last `False` argument):
https://github.com/cupy/cupy/blob/c1bf1aab6eb79a1cfcd5bb374460082d8eb2f3ca/cupy/core/_reduction.pyx#L724-L727
But we should revisit this at some point.


Discussion:

Resolving patch:
diff --git a/cupy/core/_fusion_op.py b/cupy/core/_fusion_op.py
--- a/cupy/core/_fusion_op.py
+++ b/cupy/core/_fusion_op.py
@@ -205,7 +205,7 @@ def __init__(self, name, reduce_func, expr, in_param, out_param, axis):
         assert all([0 <= x < in_param.ndim for x in axis])
 
         self.name = name
-        self.preamble = reduce_func._preamble
+        self.preamble = reduce_func.preamble
         self.in_params = _VariableSet(in_param)
         self.out_params = _VariableSet(out_param)
         self.block_stride_name = 'block_stride_' + name


Test patch:
Repository: cupy/cupy

Issue:
Triangular Solve not working for complex case
I have discovered, that `solve_triangular` does not work, if the input is complex, but the matrix is real:
```
solve_triangular(
     cholesky,
     rhs,
     lower=True,
)
```
produces a real valued result, if `cholesky` is real but `rhs` is complex.

```
intelpython3 -c 'import cupy; cupy.show_config()'
OS                           : Linux-5.9.6-1-MANJARO-x86_64-with-arch-Manjaro-Linux
CuPy Version                 : 9.0.0a1
NumPy Version                : 1.16.2+intel.0
SciPy Version                : 1.5.0
Cython Build Version         : 0.29.21
Cython Runtime Version       : 0.29.6
CUDA Root                    : /opt/cuda
CUDA Build Version           : 11010
CUDA Driver Version          : 11010
CUDA Runtime Version         : 11010
cuBLAS Version               : 11300
cuFFT Version                : 10300
cuRAND Version               : 10202
cuSOLVER Version             : (11, 0, 1)
cuSPARSE Version             : 11300
NVRTC Version                : (11, 1)
Thrust Version               : 100910
CUB Build Version            : 100910
cuDNN Build Version          : None
cuDNN Version                : None
NCCL Build Version           : 2708
NCCL Runtime Version         : 2708
cuTENSOR Version             : None
Device 0 Name                : GeForce RTX 3090
Device 0 Compute Capability  : 86
```




Discussion:

Resolving patch:
diff --git a/cupyx/scipy/linalg/solve_triangular.py b/cupyx/scipy/linalg/solve_triangular.py
--- a/cupyx/scipy/linalg/solve_triangular.py
+++ b/cupyx/scipy/linalg/solve_triangular.py
@@ -67,8 +67,12 @@ def solve_triangular(a, b, trans=0, lower=False, unit_diagonal=False,
 
     if dtype == 'f':
         trsm = cublas.strsm
-    else:  # dtype == 'd'
+    elif dtype == 'd':
         trsm = cublas.dtrsm
+    elif dtype == 'F':
+        trsm = cublas.ctrsm
+    else:  # dtype == 'D'
+        trsm = cublas.ztrsm
     one = numpy.array(1, dtype=dtype)
 
     if lower:


Test patch:
diff --git a/tests/cupyx_tests/scipy_tests/linalg_tests/test_solve_triangular.py b/tests/cupyx_tests/scipy_tests/linalg_tests/test_solve_triangular.py
--- a/tests/cupyx_tests/scipy_tests/linalg_tests/test_solve_triangular.py
+++ b/tests/cupyx_tests/scipy_tests/linalg_tests/test_solve_triangular.py
@@ -25,7 +25,7 @@
 @testing.with_requires('scipy')
 class TestSolveTriangular(unittest.TestCase):
 
-    @testing.for_float_dtypes(no_float16=True)
+    @testing.for_dtypes('fdFD')
     def check_x(self, a_shape, b_shape, dtype):
         a_cpu = numpy.random.randint(1, 10, size=a_shape).astype(dtype)
         b_cpu = numpy.random.randint(1, 10, size=b_shape).astype(dtype)
Repository: cupy/cupy

Issue:
Remove experimental mark of ndimage interpolation's new modes after SciPy 1.6 is released
#4400 and #4401 introduce some new modes for ndimage interpolation. These modes are to be included in SciPy 1.6 and the latest SciPy 1.5.4 does not have them, so they have been merged to CuPy master with marked as experimental.

We will remove the experimental marks after SciPy 1.6 is released.



Discussion:

Resolving patch:
diff --git a/cupyx/scipy/ndimage/_util.py b/cupyx/scipy/ndimage/_util.py
--- a/cupyx/scipy/ndimage/_util.py
+++ b/cupyx/scipy/ndimage/_util.py
@@ -1,5 +1,4 @@
 import cupy
-import cupy._util
 
 
 def _is_integer_output(output, input):
@@ -46,8 +45,6 @@ def _check_origin(origin, width):
 
 
 def _check_mode(mode):
-    if mode in ['grid-mirror', 'grid-wrap', 'grid-reflect']:
-        cupy._util.experimental(f"mode '{mode}'")
     if mode not in ('reflect', 'constant', 'nearest', 'mirror', 'wrap',
                     'grid-mirror', 'grid-wrap', 'grid-reflect'):
         msg = f'boundary mode not supported (actual: {mode})'
diff --git a/cupyx/scipy/ndimage/interpolation.py b/cupyx/scipy/ndimage/interpolation.py
--- a/cupyx/scipy/ndimage/interpolation.py
+++ b/cupyx/scipy/ndimage/interpolation.py
@@ -4,7 +4,6 @@
 import cupy
 import numpy
 
-import cupy._util
 from cupy.core import internal
 from cupyx.scipy.ndimage import _util
 from cupyx.scipy.ndimage import _interp_kernels
@@ -21,9 +20,6 @@ def _check_parameter(func_name, order, mode):
     elif order < 0 or 5 < order:
         raise ValueError('spline order is not supported')
 
-    if mode in ['grid-mirror', 'grid-wrap', 'grid-reflect', 'wrap', 'reflect']:
-        cupy._util.experimental(f"mode '{mode}'")
-
     if mode not in ('constant', 'grid-constant', 'nearest', 'mirror',
                     'reflect', 'grid-mirror', 'wrap', 'grid-wrap', 'opencv',
                     '_opencv_edge'):
@@ -695,7 +691,6 @@ def zoom(input, zoom, output=None, order=3, mode='constant', cval=0.0,
         )
     else:
         if grid_mode:
-            cupy._util.experimental("grid_mode=True")
 
             # warn about modes that may have surprising behavior
             suggest_mode = None


Test patch:
Repository: cupy/cupy

Issue:
`cupy.gradient` should not sort axis
```
>>> for xp in [numpy, cupy]:
...     print(xp.__name__)
...     for a in xp.gradient(xp.arange(4).reshape(2, 2), axis=(1, 0)):
...         print(a)
...
numpy
[[1. 1.]
 [1. 1.]]
[[2. 2.]
 [2. 2.]]
cupy
[[2. 2.]
 [2. 2.]]
[[1. 1.]
 [1. 1.]]
```


Discussion:

Resolving patch:
diff --git a/cupy/_math/sumprod.py b/cupy/_math/sumprod.py
--- a/cupy/_math/sumprod.py
+++ b/cupy/_math/sumprod.py
@@ -337,11 +337,7 @@ def gradient(f, *varargs, axis=None, edge_order=1):
     """
     f = cupy.asanyarray(f)
     ndim = f.ndim  # number of dimensions
-
-    if axis is None:
-        axes = tuple(range(ndim))
-    else:
-        axes = internal._normalize_axis_indices(axis, ndim)
+    axes = internal._normalize_axis_indices(axis, ndim, sort_axes=False)
 
     len_axes = len(axes)
     n = len(varargs)


Test patch:
diff --git a/tests/cupy_tests/math_tests/test_sumprod.py b/tests/cupy_tests/math_tests/test_sumprod.py
--- a/tests/cupy_tests/math_tests/test_sumprod.py
+++ b/tests/cupy_tests/math_tests/test_sumprod.py
@@ -7,7 +7,6 @@
 import cupy
 import cupy.core._accelerator as _acc
 from cupy.core import _cub_reduction
-from cupy.core import internal
 from cupy import testing
 
 
@@ -893,23 +892,38 @@ def test_diff_invalid_axis(self):
 
 
 # This class compares CUB results against NumPy's
-@testing.parameterize(*testing.product({
-    'shape': [(33,), (10, 20), (10, 20, 30)],
-    'spacing': ((), (1.2,), 'sequence of int', 'arrays', 'mixed'),
-    'edge_order': [1, 2],
-    'axis': [None, 0, -1, 'tuple'],
-}))
+@testing.parameterize(*testing.product_dict(
+    testing.product({
+        'shape': [()],
+        'axis': [None, ()],
+        'spacing': [(), (1.2,)],
+    })
+    + testing.product({
+        'shape': [(33,)],
+        'axis': [None, 0, -1, (0,)],
+        'spacing': [(), (1.2,), 'sequence of int', 'arrays'],
+    })
+    + testing.product({
+        'shape': [(10, 20), (10, 20, 30)],
+        'axis': [None, 0, -1, (0, -1), (1, 0)],
+        'spacing': [(), (1.2,), 'sequence of int', 'arrays', 'mixed'],
+    }),
+    testing.product({
+        'edge_order': [1, 2],
+    }),
+))
 @testing.gpu
 class TestGradient(unittest.TestCase):
 
     def _gradient(self, xp, dtype, shape, spacing, axis, edge_order):
         x = testing.shaped_random(shape, xp, dtype=dtype)
-        if axis == 'tuple':
-            if x.ndim == 1:
-                axis = (0,)
-            else:
-                axis = (0, -1)
-        normalized_axes = internal._normalize_axis_indices(axis, x.ndim)
+        if axis is None:
+            normalized_axes = tuple(range(x.ndim))
+        else:
+            normalized_axes = axis
+            if not isinstance(normalized_axes, tuple):
+                normalized_axes = normalized_axes,
+            normalized_axes = tuple(ax % x.ndim for ax in normalized_axes)
         if spacing == 'sequence of int':
             # one scalar per axis
             spacing = tuple((ax + 1) / x.ndim for ax in normalized_axes)
Repository: cupy/cupy

Issue:
Bump CuPy requirement to `fastrlock>=0.5`
So that we can remove this warnings filter: https://github.com/cupy/cupy/blob/a2fe3fb37c5c77daf05f71a996e08b840d5d4de9/cupy/__init__.py#L16-L19
which was to workaround  fastrlock 0.4 issue (related: #2476, #2476).


Discussion:

Resolving patch:
diff --git a/cupy/__init__.py b/cupy/__init__.py
--- a/cupy/__init__.py
+++ b/cupy/__init__.py
@@ -1,6 +1,5 @@
 import functools as _functools
 import sys as _sys
-import warnings as _warnings
 
 import numpy as _numpy
 
@@ -13,11 +12,7 @@
 
 
 try:
-    with _warnings.catch_warnings():
-        _warnings.filterwarnings(
-            'ignore', category=ImportWarning,
-            message='can\'t resolve package from __spec__')
-        from cupy import core  # NOQA
+    from cupy import core  # NOQA
 except ImportError as e:
     # core is a c-extension module.
     # When a user cannot import core, it represents that CuPy is not correctly
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -25,11 +25,11 @@
 
 requirements = {
     'setup': [
-        'fastrlock>=0.3',
+        'fastrlock>=0.5',
     ],
     'install': [
         'numpy>=1.17',
-        'fastrlock>=0.3',
+        'fastrlock>=0.5',
     ],
     'all': [
         'scipy>=1.4',


Test patch:
Repository: cupy/cupy

Issue:
Python 3.8 warning in Windows
```
Traceback (most recent call last):
  File "C:\Development\Python\Python38\lib\site-packages\cupy\_environment.py", line 265, in get_preload_config
    _preload_config = json.load(open(config_path))
ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Development\\Python\\Python38\\lib\\site-packages\\cupy\\.data\\_wheel.json' mode='r' encoding='cp1252'>
```


Discussion:
`git grep -n '[^A-Za-z]open(' | grep -v 'with open'`

```
cupy/_environment.py:265:        _preload_config = json.load(open(config_path))
setup.py:126:exec(open(os.path.join(here, 'cupy', '_version.py')).read())
```

Resolving patch:
diff --git a/cupy/_environment.py b/cupy/_environment.py
--- a/cupy/_environment.py
+++ b/cupy/_environment.py
@@ -262,7 +262,8 @@ def get_preload_config():
             get_cupy_install_path(), 'cupy', '.data', '_wheel.json')
         if not os.path.exists(config_path):
             return None
-        _preload_config = json.load(open(config_path))
+        with open(config_path) as f:
+            _preload_config = json.load(f)
     return _preload_config
 
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -120,7 +120,8 @@ def reduce_requirements(key):
 
 here = os.path.abspath(os.path.dirname(__file__))
 # Get __version__ variable
-exec(open(os.path.join(here, 'cupy', '_version.py')).read())
+with open(os.path.join(here, 'cupy', '_version.py')) as f:
+    exec(f.read())
 
 CLASSIFIERS = """\
 Development Status :: 5 - Production/Stable


Test patch:
Repository: cupy/cupy

Issue:
Python 3.9 support
- CI
- cupy-release-tools


Discussion:
NumPy 1.19.3 (Oct 29) and SciPy 1.5.4 (Nov 5) now supports Python 3.9.
https://pypi.org/project/numpy/1.19.3/
https://pypi.org/project/scipy/1.5.4/
Time to start supporting Python 3.9 in CuPy.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -133,6 +133,7 @@ def reduce_requirements(key):
 Programming Language :: Python :: 3.6
 Programming Language :: Python :: 3.7
 Programming Language :: Python :: 3.8
+Programming Language :: Python :: 3.9
 Programming Language :: Python :: 3 :: Only
 Programming Language :: Cython
 Topic :: Software Development


Test patch:
Repository: cupy/cupy

Issue:
Deprecate `cupy.bool`, `cupy.int`, `cupy.float` and `cupy.complex`
`numpy.bool`, `numpy.int`, `numpy.float` and `numpy.complex` were deprecated in NumPy 1.20.


Discussion:
https://github.com/cupy/cupy/blob/57ef68c33a03ac68ddba149b20657c3668ae511c/cupy/__init__.py#L215

Resolving patch:
diff --git a/cupy/__init__.py b/cupy/__init__.py
--- a/cupy/__init__.py
+++ b/cupy/__init__.py
@@ -1,5 +1,6 @@
 import functools as _functools
 import sys as _sys
+import warnings as _warnings
 
 import numpy as _numpy
 
@@ -212,22 +213,6 @@ def is_available():
 # Built-in Python types
 # -----------------------------------------------------------------------------
 
-# After NumPy 1.20 is released, CuPy should mimic the DeprecationWarning
-# behavior for these types
-
-from builtins import int  # NOQA
-
-from builtins import bool  # NOQA
-
-from builtins import float  # NOQA
-
-from builtins import complex  # NOQA
-
-# Not supported by CuPy:
-# from numpy import object
-# from numpy import unicode
-# from numpy import str
-
 # =============================================================================
 # Routines
 #
@@ -874,3 +859,32 @@ def show_config():
     """Prints the current runtime configuration to standard output."""
     _sys.stdout.write(str(_cupyx.get_runtime_info()))
     _sys.stdout.flush()
+
+
+if _sys.version_info >= (3, 7):
+    _deprecated_attrs = {
+        'int': (int, 'cupy.int_'),
+        'bool': (bool, 'cupy.bool_'),
+        'float': (float, 'cupy.float_'),
+        'complex': (complex, 'cupy.complex_'),
+    }
+
+    def __getattr__(name):
+        value = _deprecated_attrs.get(name)
+        if value is None:
+            raise AttributeError(
+                f"module 'cupy' has no attribute {name!r}")
+        attr, eq_attr = value
+        _warnings.warn(
+            f'`cupy.{name}` is a deprecated alias for the Python scalar type '
+            f'`{name}`. Please use the builtin `{name}` or its corresponding '
+            f'NumPy scalar type `{eq_attr}` instead.',
+            DeprecationWarning, stacklevel=2
+        )
+        return attr
+else:
+    # Does not emit warnings.
+    from builtins import int
+    from builtins import bool
+    from builtins import float
+    from builtins import complex


Test patch:
Repository: cupy/cupy

Issue:
[RFC] [v10] Dropping Support for CUDA 9.2 & NCCL 2.4
In CuPy v10, we are thinking of dropping support for CUDA 9.2 and NCCL 2.4. Please leave a comment if you have any concerns.

This does not affect CuPy v9.x releases.


Discussion:

Resolving patch:
diff --git a/install/build.py b/install/build.py
--- a/install/build.py
+++ b/install/build.py
@@ -27,7 +27,7 @@ def _from_install_import(name):
 PLATFORM_LINUX = sys.platform.startswith('linux')
 PLATFORM_WIN32 = sys.platform.startswith('win32')
 
-minimum_cuda_version = 9020
+minimum_cuda_version = 10000
 minimum_cudnn_version = 7600
 
 minimum_hip_version = 305  # for ROCm 3.5.0+
@@ -326,7 +326,7 @@ def check_cuda_version(compiler, settings):
     if _cuda_version < minimum_cuda_version:
         utils.print_warning(
             'CUDA version is too old: %d' % _cuda_version,
-            'CUDA 9.2 or newer is required')
+            'CUDA 10.0 or newer is required')
         return False
 
     return True


Test patch:
Repository: cupy/cupy

Issue:
Add NVCC path and Python version to show_config



Discussion:

Resolving patch:
diff --git a/cupyx/_runtime.py b/cupyx/_runtime.py
--- a/cupyx/_runtime.py
+++ b/cupyx/_runtime.py
@@ -144,6 +144,11 @@ def __init__(self):
         else:
             self.cuda_path = cupy._environment.get_rocm_path()
 
+        if not is_hip:
+            self.nvcc_path = cupy._environment.get_nvcc_path()
+        else:
+            self.nvcc_path = cupy._environment.get_hipcc_path()
+
         self.cuda_build_version = cupy.cuda.driver.get_build_version()
         self.cuda_driver_version = _eval_or_error(
             cupy.cuda.runtime.driverGetVersion,
@@ -212,12 +217,15 @@ def __init__(self):
     def __str__(self):
         records = [
             ('OS',  platform.platform()),
+            ('Python Version', platform.python_version()),
             ('CuPy Version', self.cupy_version),
+            ('CuPy Platform', 'NVIDIA CUDA' if not is_hip else 'AMD ROCm'),
             ('NumPy Version', self.numpy_version),
             ('SciPy Version', self.scipy_version),
             ('Cython Build Version', self.cython_build_version),
             ('Cython Runtime Version', self.cython_version),
             ('CUDA Root', self.cuda_path),
+            ('hipcc PATH' if is_hip else 'nvcc PATH', self.nvcc_path),
 
             ('CUDA Build Version', self.cuda_build_version),
             ('CUDA Driver Version', self.cuda_driver_version),


Test patch:
Repository: cupy/cupy

Issue:
[info] NumPy/SciPy new version pinning recommendation
See:
- https://github.com/numpy/numpy/pull/18505
- scipy/scipy#12862

The most important takeaway is that NumPy/SciPy now recommend downstream distributions to pin the upper bound version if NumPy/Scipy are runtime dependencies. (The example is if the latest NumPy out there is 1.20, one should pin to `<1.23`; the notation used in the docs `<1.xx+3.0` is a bit confusing, see the clarification in https://github.com/scipy/scipy/pull/12862#discussion_r575790007.) There are other suggestions too, but I think this is potentially the most impactful one.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -31,11 +31,11 @@
     ],
 
     'install': [
-        'numpy>=1.17',
+        'numpy>=1.17,<1.23',  # see #4773
         'fastrlock>=0.5',
     ],
     'all': [
-        'scipy>=1.4',
+        'scipy>=1.4,<1.9',  # see #4773
         'optuna>=2.0',
     ],
 


Test patch:
Repository: cupy/cupy

Issue:
Remove cupyx.allow_synchronize?
`cupyx.allow_synchronize` (#2808) was introduced originally for both unit tests and users who want to notice device synchronization in their own code.

Application in uint tests was dissmissed (#2893) because much more tests were synchronous than I had expected. 

Now I doubt the usefulness of this feature for users as well.
It's fundamentally impossible to eliminate false positives and/or false negatives.

If we took a policy for zero false positives, there would be too many false negatives which I think would make this feature useless.
For example, the documentation of [cudaMemcpy](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc263dbe6574220cc776b45438fc351e8) says *"This function exhibits synchronous behavior for most use cases"*. If we took this policy, we wouldn't be able to consider this function synchronous, because no condition is mentioned that would make this function asynchronous.

If we took a policy to allow some false positives, this feature wouldn't be used to detect unexpected synchronization in users' code.


Discussion:
+1 for removing sync detect stuff. Currently we rely on (incomplete) knowledge of the CUDA APIs for the (a-)sync behaviors, but for CUDA libraries (cuFFT, cuSOLVER, whatever) we have absolutely no idea in general, unless someone from NVIDIA is willing to sit down with us and mark all public APIs one by one. 
I'd like to remove this in v10.

Resolving patch:
diff --git a/cupy/_core/syncdetect.py b/cupy/_core/syncdetect.py
--- a/cupy/_core/syncdetect.py
+++ b/cupy/_core/syncdetect.py
@@ -1,7 +1,6 @@
 import contextlib
 import threading
-
-from cupy import _util
+import warnings
 
 
 _thread_local = threading.local()
@@ -10,6 +9,11 @@
 class DeviceSynchronized(RuntimeError):
     """Raised when device synchronization is detected while disallowed.
 
+    .. warning::
+
+       This API has been deprecated in CuPy v10 and will be removed in future
+       releases.
+
     .. seealso:: :func:`cupyx.allow_synchronize`
 
     """
@@ -41,13 +45,21 @@ def allow_synchronize(allow):
     """Allows or disallows device synchronization temporarily in the current \
 thread.
 
+    .. warning::
+
+       This API has been deprecated in CuPy v10 and will be removed in future
+       releases.
+
     If device synchronization is detected, :class:`cupyx.DeviceSynchronized`
     will be raised.
 
     Note that there can be false negatives and positives.
     Device synchronization outside CuPy will not be detected.
     """
-    _util.experimental('cupyx.allow_synchronize')
+    warnings.warn(
+        'cupyx.allow_synchronize will be removed in future releases as it '
+        'is not possible to reliably detect synchronizations.')
+
     old = _is_allowed()
     _thread_local.allowed = allow
     try:


Test patch: