Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: niboshi <niboshi000@gmail.com>
  • Loading branch information
leofang and niboshi committed Oct 11, 2019
1 parent 45534ae commit a3f1703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cupy/cuda/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _compile_with_cache_cuda(source, options, arch, cache_dir,
if backend == 'nvrtc':
ptx = compile_using_nvrtc(source, options, arch, name + '.cu')
ls = function.LinkState()
ls.add_ptr_data(ptx, u'cupy.ptx')
ls.add_ptr_data(ptx, 'cupy.ptx')
cubin = ls.complete()
elif backend == 'nvcc':
cubin = compile_using_nvcc(source, options, arch, name + '.cu',
Expand Down
10 changes: 5 additions & 5 deletions tests/cupy_tests/core_tests/test_raw.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import pytest
import shutil
from tempfile import mkdtemp
import tempfile
import unittest

import cupy
Expand Down Expand Up @@ -99,13 +99,13 @@ class TestRaw(unittest.TestCase):

def setUp(self):
global _test_cache_dir
_test_cache_dir = mkdtemp()
_test_cache_dir = tempfile.mkdtemp()
os.environ['CUPY_CACHE_DIR'] = _test_cache_dir

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

def tearDown(self):
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_compiler_flag(self):

def test_invalid_compiler_flag(self):
with pytest.raises(cupy.cuda.compiler.CompileException) as ex:
cupy.RawModule(_test_source3, ("-DPRECISION=3",),
cupy.RawModule(_test_source3, ('-DPRECISION=3',),
backend=self.backend)
assert 'precision not supported' in str(ex.value)

Expand All @@ -181,7 +181,7 @@ def test_module_load_failure(self):
# this error is more likely to appear when using RawModule, so
# let us do it here
with pytest.raises(cupy.cuda.driver.CUDADriverError) as ex:
cupy.RawModule(os.path.expanduser("~/this_does_not_exist.cubin"),
cupy.RawModule(os.path.expanduser('~/this_does_not_exist.cubin'),
backend=self.backend)
assert 'CUDA_ERROR_FILE_NOT_FOUND' in str(ex.value)

Expand Down

0 comments on commit a3f1703

Please sign in to comment.