Skip to content

Commit

Permalink
Support for running under cuda-memcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed May 20, 2020
1 parent 1170ad2 commit d6ffc0e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function extract_flag!(args, flag, default=nothing)
end
return (false, default)
end
## --help
do_help, _ = extract_flag!(ARGS, "--help")
if do_help
println("""
Expand All @@ -33,11 +32,12 @@ if do_help
--help Show this text.
--list List all available tests.
--jobs=N Launch `N` process to perform tests.
Defaults to `Threads.nthreads()`.""")
Defaults to `Threads.nthreads()`.
--memcheck Run the tests under `cuda-memcheck`.""")
exit(0)
end
## --jobs=N for parallel job execution
_, jobs = extract_flag!(ARGS, "--jobs", Threads.nthreads())
do_memcheck, _ = extract_flag!(ARGS, "--memcheck")

include("setup.jl") # make sure everything is precompiled

Expand Down Expand Up @@ -153,7 +153,13 @@ if Base.JLOptions().project != C_NULL
end
const test_exename = popfirst!(test_exeflags.exec)
function addworker(X; kwargs...)
procs = addprocs(X; exename=`$test_exename`, exeflags=test_exeflags,
exename = if do_memcheck
`cuda-memcheck $test_exename`
else
test_exename
end

procs = addprocs(X; exename=exename, exeflags=test_exeflags,
dir=@__DIR__, kwargs...)
@everywhere procs include("setup.jl")
procs
Expand Down

0 comments on commit d6ffc0e

Please sign in to comment.