aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-21 23:59:20 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-01-21 23:59:20 +0200
commite1b50309dfd9c927866f36a0a4662321351ab697 (patch)
treeb3fb38d1a391f4e33004b95eba2ea6d17a8dd762
parent140975116905e7637e906e645b588e03b8c3aebb (diff)
downloadmeson-e1b50309dfd9c927866f36a0a4662321351ab697.zip
meson-e1b50309dfd9c927866f36a0a4662321351ab697.tar.gz
meson-e1b50309dfd9c927866f36a0a4662321351ab697.tar.bz2
All the fixes needed to make work against current master.
-rw-r--r--mesonbuild/compilers/compilers.py19
-rw-r--r--mesonbuild/compilers/cuda.py11
-rw-r--r--mesonbuild/environment.py6
-rw-r--r--test cases/cuda/1 simple/prog.cu3
4 files changed, 28 insertions, 11 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index b2dc213..b1f3cc2 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -146,10 +146,10 @@ armclang_buildtype_args = {'plain': [],
}
cuda_buildtype_args = {'plain': [],
- 'debug': ['-O0', '-g'],
- 'debugoptimized': ['-O1', '--debug'],
- 'release': ['-O3', '-Otime'],
- 'minsize': ['-O3', '-Ospace'],
+ 'debug': [],
+ 'debugoptimized': [],
+ 'release': [],
+ 'minsize': [],
}
arm_buildtype_args = {'plain': [],
@@ -354,6 +354,17 @@ msvc_optimization_args = {'0': [],
's': ['/O1'], # Implies /Os.
}
+cuda_optimization_args = {'0': [],
+ 'g': ['-O0'],
+ '1': ['-O1'],
+ '2': ['-O2'],
+ '3': ['-O3', '-Otime'],
+ 's': ['-O3', '-Ospace']
+ }
+
+cuda_debug_args = {False: [],
+ True: ['-g']}
+
clike_debug_args = {False: [],
True: ['-g']}
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 7beecf9..b5f16ab 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -16,7 +16,7 @@ import subprocess, os.path
from .. import mlog
from ..mesonlib import EnvironmentException, Popen_safe
-from .compilers import Compiler, cuda_buildtype_args
+from .compilers import Compiler, cuda_buildtype_args, cuda_optimization_args, cuda_debug_args
class CudaCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
@@ -151,6 +151,12 @@ __global__ void kernel (void) {
def get_no_optimization_args(self):
return ['-O0']
+ def get_optimization_args(self, optimization_level):
+ return cuda_optimization_args[optimization_level]
+
+ def get_debug_args(self, is_debug):
+ return cuda_debug_args[is_debug]
+
def get_linker_exelist(self):
return self.exelist[:]
@@ -191,3 +197,6 @@ __global__ void kernel (void) {
def get_pic_args(self):
return []
+
+ def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+ return []
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 87d221d..d853020 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -753,7 +753,7 @@ class Environment:
def detect_cuda_compiler(self, want_cross):
popen_exceptions = {}
- compilers, ccache, is_cross, exe_wrap = self._get_compilers('cuda', 'Cuda', want_cross)
+ compilers, ccache, is_cross, exe_wrap = self._get_compilers('cuda', want_cross)
for compiler in compilers:
if isinstance(compiler, str):
compiler = [compiler]
@@ -1033,9 +1033,9 @@ class Environment:
if need_cross_compiler:
cross_comp = self.detect_objc_compiler(True)
elif lang == 'cuda':
- comp = self.environment.detect_cuda_compiler(False)
+ comp = self.detect_cuda_compiler(False)
if need_cross_compiler:
- cross_comp = self.environment.detect_cuda_compiler(True)
+ cross_comp = self.detect_cuda_compiler(True)
elif lang == 'objcpp':
comp = self.detect_objcpp_compiler(False)
if need_cross_compiler:
diff --git a/test cases/cuda/1 simple/prog.cu b/test cases/cuda/1 simple/prog.cu
index 2dd4554..7eab673 100644
--- a/test cases/cuda/1 simple/prog.cu
+++ b/test cases/cuda/1 simple/prog.cu
@@ -1,8 +1,5 @@
#include <iostream>
-__global__ void kernel (void){
-}
-
int main(int argc, char **argv) {
int cuda_devices = 0;
std::cout << "CUDA version: " << CUDART_VERSION << "\n";