コード例 #1
0
ファイル: test_raw.py プロジェクト: viantirreau/cupy
    def setUp(self):
        if hasattr(self, 'clean_up'):
            _util.clear_memo()
        self.dev = cupy.cuda.runtime.getDevice()
        assert self.dev != 1
        if not hasattr(self, 'jitify'):
            self.jitify = False
        if cupy.cuda.runtime.is_hip and self.jitify:
            self.skipTest('Jitify does not support ROCm/HIP')

        self.temporary_cache_dir_context = use_temporary_cache_dir()
        self.in_memory_context = compile_in_memory(self.in_memory)
        self.cache_dir = self.temporary_cache_dir_context.__enter__()
        self.in_memory_context.__enter__()

        self.kern = cupy.RawKernel(
            _test_source1, 'test_sum',
            backend=self.backend, jitify=self.jitify)
        self.mod2 = cupy.RawModule(
            code=_test_source2,
            backend=self.backend, jitify=self.jitify)
        self.mod3 = cupy.RawModule(
            code=_test_source3,
            options=('-DPRECISION=2',),
            backend=self.backend, jitify=self.jitify)
コード例 #2
0
ファイル: test_raw.py プロジェクト: takagi/cupy
    def setUp(self):
        if hasattr(self, 'clean_up'):
            if cupy.cuda.runtime.is_hip:
                # Clearing memo triggers recompiling kernels using name
                # expressions in other tests, e.g. dot and matmul, which
                # hits a nvrtc bug. See #5843, #5945 and #6725.
                self.skipTest('Clearing memo hits a nvrtc bug in other tests')
            _util.clear_memo()
        self.dev = cupy.cuda.runtime.getDevice()
        assert self.dev != 1
        if not hasattr(self, 'jitify'):
            self.jitify = False
        if cupy.cuda.runtime.is_hip and self.jitify:
            self.skipTest('Jitify does not support ROCm/HIP')

        self.temporary_cache_dir_context = use_temporary_cache_dir()
        self.in_memory_context = compile_in_memory(self.in_memory)
        self.cache_dir = self.temporary_cache_dir_context.__enter__()
        self.in_memory_context.__enter__()

        self.kern = cupy.RawKernel(_test_source1,
                                   'test_sum',
                                   backend=self.backend,
                                   jitify=self.jitify)
        self.mod2 = cupy.RawModule(code=_test_source2,
                                   backend=self.backend,
                                   jitify=self.jitify)
        self.mod3 = cupy.RawModule(code=_test_source3,
                                   options=('-DPRECISION=2', ),
                                   backend=self.backend,
                                   jitify=self.jitify)
コード例 #3
0
ファイル: test_raw.py プロジェクト: zelo2/cupy
    def setUp(self):
        if hasattr(self, 'clean_up'):
            _util.clear_memo()
        self.dev = cupy.cuda.runtime.getDevice()
        assert self.dev != 1

        self.temporary_cache_dir_context = use_temporary_cache_dir()
        self.in_memory_context = compile_in_memory(self.in_memory)
        self.cache_dir = self.temporary_cache_dir_context.__enter__()
        self.in_memory_context.__enter__()

        self.kern = cupy.RawKernel(_test_source1,
                                   'test_sum',
                                   backend=self.backend)
        self.mod2 = cupy.RawModule(code=_test_source2, backend=self.backend)
        self.mod3 = cupy.RawModule(code=_test_source3,
                                   options=('-DPRECISION=2', ),
                                   backend=self.backend)