コード例 #1
0
    def setUp(self):
        if cupy.cuda.runtime.is_hip:
            if _environment.get_hipcc_path() is None:
                self.skipTest('hipcc is not found')

        self.can_use = cupy.core._cub_reduction._can_use_cub_block_reduction

        self.old_accelerators = _accelerator.get_reduction_accelerators()
        _accelerator.set_reduction_accelerators(['cub'])
コード例 #2
0
 def setUp(self):
     self.old_routine_accelerators = _acc.get_routine_accelerators()
     self.old_reduction_accelerators = _acc.get_reduction_accelerators()
     if self.backend == 'device':
         _acc.set_routine_accelerators(['cub'])
         _acc.set_reduction_accelerators([])
     elif self.backend == 'block':
         _acc.set_routine_accelerators([])
         _acc.set_reduction_accelerators(['cub'])
コード例 #3
0
ファイル: test_optimize.py プロジェクト: zhaohb/cupy
    def setUp(self):
        cupy.core._optimize_config._clear_all_contexts_cache()
        self.old_reductions = _accelerator.get_reduction_accelerators()
        _accelerator.set_reduction_accelerators(self.backend)

        # avoid shadowed by the cub module
        self.old_routines = _accelerator.get_routine_accelerators()
        _accelerator.set_routine_accelerators([])

        self.x = testing.shaped_arange((3, 4), cupy, dtype=cupy.float32)
コード例 #4
0
ファイル: test_search.py プロジェクト: wphicks/cupy
 def setUp(self):
     self.order, self.axis = self.order_and_axis
     self.old_routine_accelerators = _acc.get_routine_accelerators()
     self.old_reduction_accelerators = _acc.get_reduction_accelerators()
     if self.backend == 'device':
         if self.axis is not None:
             raise unittest.SkipTest('does not support')
         _acc.set_routine_accelerators(['cub'])
         _acc.set_reduction_accelerators([])
     elif self.backend == 'block':
         _acc.set_routine_accelerators([])
         _acc.set_reduction_accelerators(['cub'])
コード例 #5
0
 def tearDown(self):
     _acc.set_routine_accelerators(self.old_routine_accelerators)
     _acc.set_reduction_accelerators(self.old_reduction_accelerators)
コード例 #6
0
ファイル: test_cub_reduction.py プロジェクト: zhaohb/cupy
 def tearDown(self):
     _accelerator.set_reduction_accelerators(self.old_accelerators)
コード例 #7
0
ファイル: test_cub_reduction.py プロジェクト: zhaohb/cupy
    def setUp(self):
        self.can_use = cupy.core._cub_reduction._can_use_cub_block_reduction

        self.old_accelerators = _accelerator.get_reduction_accelerators()
        _accelerator.set_reduction_accelerators(['cub'])
コード例 #8
0
ファイル: test_ndarray_reduction.py プロジェクト: mrkwjc/cupy
 def setUp(self):
     self.old_accelerators = _acc.get_routine_accelerators()
     _acc.set_routine_accelerators([])
     # also avoid fallback to CUB via the general reduction kernel
     self.old_reduction_accelerators = _acc.get_reduction_accelerators()
     _acc.set_reduction_accelerators([])