summaryrefslogtreecommitdiff
path: root/xnt/build
diff options
context:
space:
mode:
authorkennyballou <kballou@onyx.boisestate.edu>2013-06-21 17:05:57 -0600
committerkennyballou <kballou@onyx.boisestate.edu>2013-06-21 17:07:40 -0600
commitf10e7e3b1588fc3b2d29cfb3a6e9ff0afb0b685c (patch)
treebf94afbb930997b049b8c54b8148951141a9da35 /xnt/build
parentfbe99bf593c0b0fb12c43bcf2c7b9b2c50cb850b (diff)
downloadxnt-f10e7e3b1588fc3b2d29cfb3a6e9ff0afb0b685c.tar.gz
xnt-f10e7e3b1588fc3b2d29cfb3a6e9ff0afb0b685c.tar.xz
Add NVCC compiler to xnt.build.cc
Diffstat (limited to 'xnt/build')
-rw-r--r--xnt/build/cc.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/xnt/build/cc.py b/xnt/build/cc.py
index 5cb455f..967608f 100644
--- a/xnt/build/cc.py
+++ b/xnt/build/cc.py
@@ -22,7 +22,7 @@ Definition of commonly used compilers
import os
import logging
-from xnt.tasks import call
+from xnt.tasks import call, which
LOGGER = logging.getLogger(__name__)
@@ -70,6 +70,25 @@ def javac(src, flags=None):
cmd = __generate_command(src, flags, "javac")
return __compile(cmd)
+def nvcc(src, flags=None):
+ """NVCC: compile CUDA C/C++ programs
+
+ :param src: CUDA source file to compile with default `nvcc`
+ :param flags: List of flags to pass onto the compiler
+ """
+ assert which('nvcc')
+ return _gcc(src, flags, compiler='nvcc')
+
+def nvcc_o(src, output, flags=None):
+ """NVCC: compile with named output
+
+ :param src: CUDA source file to compile with default `nvcc`
+ :param output: Name of resulting object or executable
+ :param flags: List of flags to pass onto the compiler
+ """
+ assert which('nvcc')
+ return _gcc_o(src, output, flags, compiler='nvcc')
+
def _gcc(src, flags=None, compiler="gcc"):
"""Compile using gcc"""
LOGGER.info("Compiling %s", src)