Provide a better Cuda example #2212

This commit is contained in:
Thomas Nagy 2018-12-05 20:49:07 +01:00
parent bd15a9dce7
commit 753b153631
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
2 changed files with 15 additions and 1 deletions

5
playground/cuda/test.cpp Normal file
View File

@ -0,0 +1,5 @@
int main()
{
return 0;
}

View File

@ -16,14 +16,23 @@ def configure(conf):
# conf.env.LIBPATH_CUDA = ['c:\\foo\\bar\\lib']
# conf.env.INCLUDES_CUDA = ['c:\\foo\\bar\\includes']
conf.env = conf.all_envs['cuda'] = conf.env.derive()
conf.load('cuda', tooldir='.')
def build(bld):
# native application
bld.program(
source = 'test.cpp',
target = 'testapp',
)
# cuda application
t = bld.program(
source = 'test.cu main.cpp',
target = 'app',
use = 'CUDA CUDART')
use = 'CUDA CUDART',
env = bld.all_envs['cuda'])
#t.env.CUDAFLAGS = ['-deviceemu']
# --ptxas-options="-v"