mirror of https://gitlab.com/ita1024/waf.git
Provide a better Cuda example #2212
This commit is contained in:
parent
bd15a9dce7
commit
753b153631
|
@ -0,0 +1,5 @@
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -16,14 +16,23 @@ def configure(conf):
|
||||||
# conf.env.LIBPATH_CUDA = ['c:\\foo\\bar\\lib']
|
# conf.env.LIBPATH_CUDA = ['c:\\foo\\bar\\lib']
|
||||||
# conf.env.INCLUDES_CUDA = ['c:\\foo\\bar\\includes']
|
# conf.env.INCLUDES_CUDA = ['c:\\foo\\bar\\includes']
|
||||||
|
|
||||||
|
conf.env = conf.all_envs['cuda'] = conf.env.derive()
|
||||||
conf.load('cuda', tooldir='.')
|
conf.load('cuda', tooldir='.')
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
|
# native application
|
||||||
|
bld.program(
|
||||||
|
source = 'test.cpp',
|
||||||
|
target = 'testapp',
|
||||||
|
)
|
||||||
|
|
||||||
|
# cuda application
|
||||||
t = bld.program(
|
t = bld.program(
|
||||||
source = 'test.cu main.cpp',
|
source = 'test.cu main.cpp',
|
||||||
target = 'app',
|
target = 'app',
|
||||||
use = 'CUDA CUDART')
|
use = 'CUDA CUDART',
|
||||||
|
env = bld.all_envs['cuda'])
|
||||||
|
|
||||||
#t.env.CUDAFLAGS = ['-deviceemu']
|
#t.env.CUDAFLAGS = ['-deviceemu']
|
||||||
# --ptxas-options="-v"
|
# --ptxas-options="-v"
|
||||||
|
|
Loading…
Reference in New Issue