Example #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'])
Example #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'])
Example #3
0
    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)
Example #4
0
 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'])
Example #5
0
 def tearDown(self):
     _acc.set_routine_accelerators(self.old_routine_accelerators)
     _acc.set_reduction_accelerators(self.old_reduction_accelerators)
Example #6
0
 def tearDown(self):
     _accelerator.set_reduction_accelerators(self.old_accelerators)
Example #7
0
    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'])
Example #8
0
 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([])