Skip to content

Commit

Permalink
Merge pull request #73 from rutsky/compile_fatbin
Browse files Browse the repository at this point in the history
add option to compile nvcc's fatbin
  • Loading branch information
inducer committed Jun 19, 2015
2 parents 52fe395 + e282410 commit a7a242e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pycuda/compiler.py
Expand Up @@ -69,7 +69,7 @@ def preprocess_source(source, options, nvcc):
def compile_plain(source, options, keep, nvcc, cache_dir, target="cubin"):
from os.path import join

assert target in ["cubin", "ptx"]
assert target in ["cubin", "ptx", "fatbin"]

if cache_dir:
checksum = _new_md5()
Expand Down Expand Up @@ -191,7 +191,7 @@ def compile(source, nvcc="nvcc", options=None, keep=False,
no_extern_c=False, arch=None, code=None, cache_dir=None,
include_dirs=[], target="cubin"):

assert target in ["cubin", "ptx"]
assert target in ["cubin", "ptx", "fatbin"]

if not no_extern_c:
source = 'extern "C" {\n%s\n}\n' % source
Expand All @@ -201,10 +201,11 @@ def compile(source, nvcc="nvcc", options=None, keep=False,

options = options[:]
if arch is None:
from pycuda.driver import Error
try:
from pycuda.driver import Context
arch = "sm_%d%d" % Context.get_device().compute_capability()
except RuntimeError:
except Error:
pass

from pycuda.driver import CUDA_DEBUGGING
Expand Down

0 comments on commit a7a242e

Please sign in to comment.