diff --git a/cuburn/code/util.py b/cuburn/code/util.py index 7b22502..c7b8a0a 100644 --- a/cuburn/code/util.py +++ b/cuburn/code/util.py @@ -80,7 +80,8 @@ def assemble_code(*libs): DEFAULT_CMP_OPTIONS = ('-use_fast_math', '-maxrregcount', '42') DEFAULT_SAVE_KERNEL = True -def compile(name, src, opts=DEFAULT_CMP_OPTIONS, save=DEFAULT_SAVE_KERNEL): +def compile(name, src, opts=DEFAULT_CMP_OPTIONS, save=DEFAULT_SAVE_KERNEL, + arch=None): """ Compile a module. Returns a copy of the source (for inspection or display) and the compiled cubin. @@ -89,7 +90,7 @@ def compile(name, src, opts=DEFAULT_CMP_OPTIONS, save=DEFAULT_SAVE_KERNEL): if save: with open(os.path.join(dir, name + '_kern.cu'), 'w') as fp: fp.write(src) - cubin = pycuda.compiler.compile(src, options=list(opts)) + cubin = pycuda.compiler.compile(src, options=list(opts), arch=arch) if save: with open(os.path.join(dir, name + '_kern.cubin'), 'w') as fp: fp.write(cubin)