waf/playground/cuda/wscript

51 lines
1021 B
Plaintext
Raw Normal View History

2011-09-10 11:13:51 +02:00
#!/usr/bin/env python
2017-01-21 13:28:06 +01:00
# encoding: utf-8
2011-09-10 11:13:51 +02:00
# Thomas Nagy, 2010
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_cxx')
def configure(conf):
conf.load('compiler_cxx') # cuda does not compile in c mode
# the tests will fail if the libraries cannot be found
# try pre_setting some variables, like this
# conf.env.LIBPATH_CUDA = ['c:\\foo\\bar\\lib']
# conf.env.INCLUDES_CUDA = ['c:\\foo\\bar\\includes']
conf.load('cuda', tooldir='.')
# Add a few flags to test proper passing to nvcc
conf.env.CXXFLAGS=['-fPIC', '--std=c++11']
2011-09-10 11:13:51 +02:00
def build(bld):
2018-12-05 20:49:07 +01:00
# cuda application
2011-09-10 11:13:51 +02:00
t = bld.program(
source = 'test.cu main.cpp',
target = 'app',
2018-12-07 07:57:43 +01:00
use = 'CUDA CUDART')
2011-09-10 11:13:51 +02:00
#t.env.CUDAFLAGS = ['-deviceemu']
# --ptxas-options="-v"
# --ptxas-options="-v -maxrregcount=10"
2018-12-07 07:57:43 +01:00
# -----------------------
# native application
bld.program(
source = 'test.cpp',
target = 'testapp-native')
2018-12-07 07:57:43 +01:00
# cuda application
bld.program(
source = 'test.cpp',
target = 'testapp',
cuda = True,
use = 'CUDA CUDART')