mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 03:30:05 -05:00
Add arch as compiler option
This commit is contained in:
parent
7c0d86b929
commit
805742d4ce
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user