Skip to content

Commit

Permalink
assert on invalid code_type
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed May 10, 2019
1 parent 5d74ecf commit 5b205f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cupy/cuda/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def compile_using_nvcc(source, options=(), arch=None,
arch = _get_arch()

if code_type not in ('cubin', 'ptx'):
raise ValueError("code_type not in ('cubin', 'ptx')")
raise ValueError('Invalid code_type %s. Should be cubin or ptx')

arch_str = '-gencode=arch=compute_{cc},code=sm_{cc}'.format(cc=arch)
cmd = ['nvcc', '--%s' % code_type, arch_str] + list(options)
Expand Down Expand Up @@ -157,7 +157,7 @@ def compile_using_nvcc(source, options=(), arch=None,
with open(result_path, 'rb') as bin_file:
return bin_file.read()
else:
raise ValueError("Invalid code_type '%s'" % code_type)
assert False, code_type


def _preprocess(source, options, arch, backend):
Expand Down

0 comments on commit 5b205f3

Please sign in to comment.