Skip to content

Commit

Permalink
Choose parallel tests based on CPUs, not threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Mar 29, 2023
1 parent 6b05f9a commit 3bd8287
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/device/opencl/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end
alignment!(gv, Base.datatype_alignment(T))

# generate IR
Builder(ctx) do builder
IRBuilder(ctx) do builder
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)

Expand Down
4 changes: 2 additions & 2 deletions src/device/opencl/printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end
mod = LLVM.parent(llvm_f)

# generate IR
Builder(ctx) do builder
IRBuilder(ctx) do builder
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)

Expand All @@ -49,7 +49,7 @@ end
printf_typ = LLVM.FunctionType(T_int32, [T_pint8]; vararg=true)
printf = LLVM.Function(mod, "printf", printf_typ)
push!(function_attributes(printf), EnumAttribute("nobuiltin"; ctx))
chars = call!(builder, printf, [str, parameters(llvm_f)...])
chars = call!(builder, printf_typ, printf, [str, parameters(llvm_f)...])

ret!(builder, chars)
end
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ if do_help
--help Show this text.
--list List all available tests.
--quickfail Fail the entire run as soon as a single test errored.
--jobs=N Launch `N` processes to perform tests (default: Threads.nthreads()).
--jobs=N Launch `N` processes to perform tests (default: Sys.CPU_THREADS).
Remaining arguments filter the tests that will be executed.""")
exit(0)
end
_, jobs = extract_flag!(ARGS, "--jobs", Threads.nthreads())
_, jobs = extract_flag!(ARGS, "--jobs", Sys.CPU_THREADS)
do_quickfail, _ = extract_flag!(ARGS, "--quickfail")

include("setup.jl") # make sure everything is precompiled
@info "System information:\n" * sprint(io->oneAPI.versioninfo(io))

@info "Using oneAPI support library at " * oneAPI.Support.liboneapi_support

@info "Running $jobs tests in parallel. If this is too many, specify the `--jobs` argument to the tests, or set the JULIA_CPU_THREADS environment variable."

# choose tests
const tests = []
const test_runners = Dict()
Expand Down

0 comments on commit 3bd8287

Please sign in to comment.