Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benchmark/blas/blas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ C has dimensions n x m and x and y have dimensions n x r

auto test_cases = json::parse(get_input_stream());

auto results =
run_test_cases(BlasBenchmark{operation_map}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(BlasBenchmark{operation_map}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
4 changes: 2 additions & 2 deletions benchmark/blas/distributed/multi_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BLAS algorithms:
auto schema = json::parse(
std::ifstream(GKO_ROOT "/benchmark/schema/blas-distributed.json"));

initialize_argument_parsing(&argc, &argv, header, schema["examples"],
initialize_argument_parsing(&argc, &argv, header, schema["examples"], "",
do_print);

auto exec = executor_factory_mpi.at(FLAGS_executor)(comm.get());
Expand Down Expand Up @@ -112,7 +112,7 @@ BLAS algorithms:

auto results = run_test_cases(BlasBenchmark{operation_map, do_print}, exec,
get_mpi_timer(exec, comm, FLAGS_gpu_timer),
schema, test_cases);
schema, std::move(test_cases));

if (do_print) {
std::cout << std::setw(4) << results << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions benchmark/conversion/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ int main(int argc, char* argv[])

auto test_cases = json::parse(get_input_stream());

auto results =
run_test_cases(ConversionBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(ConversionBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
5 changes: 3 additions & 2 deletions benchmark/matrix_statistics/matrix_statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ int main(int argc, char* argv[])
auto test_cases = json::parse(get_input_stream());
auto exec = gko::ReferenceExecutor::create();

auto results = run_test_cases(MatrixStatistics{}, exec,
get_timer(exec, false), schema, test_cases);
auto results =
run_test_cases(MatrixStatistics{}, exec, get_timer(exec, false), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
8 changes: 4 additions & 4 deletions benchmark/preconditioner/preconditioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct PreconditionerBenchmark : Benchmark<preconditioner_benchmark_state> {
IterationControl ic_gen{get_timer(exec, FLAGS_gpu_timer)};
IterationControl ic_apply{get_timer(exec, FLAGS_gpu_timer)};

auto context = gko::config::registry{};
auto context = create_default_registry();
auto td = gko::config::make_type_descriptor<etype, itype>();
auto preconditioner_config =
gko::ext::config::parse_json(operation_case["preconditioner"]);
Expand Down Expand Up @@ -184,9 +184,9 @@ int main(int argc, char* argv[])

auto test_cases = json::parse(get_input_stream());

auto results =
run_test_cases(PreconditionerBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(PreconditionerBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
9 changes: 5 additions & 4 deletions benchmark/solver/distributed/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int main(int argc, char* argv[])
auto schema = json::parse(
std::ifstream(GKO_ROOT "/benchmark/schema/solver-distributed.json"));

initialize_argument_parsing(&argc, &argv, header, schema["examples"],
initialize_argument_parsing(&argc, &argv, header, schema["examples"], "",
do_print);

auto exec = executor_factory_mpi.at(FLAGS_executor)(comm.get());
Expand All @@ -96,9 +96,10 @@ int main(int argc, char* argv[])
std::string json_input = broadcast_json_input(get_input_stream(), comm);
auto test_cases = json::parse(json_input);

auto results = run_test_cases(
SolverBenchmark{Generator{comm}, do_print}, exec,
get_mpi_timer(exec, comm, FLAGS_gpu_timer), schema, test_cases);
auto results =
run_test_cases(SolverBenchmark{Generator{comm}, do_print}, exec,
get_mpi_timer(exec, comm, FLAGS_gpu_timer), schema,
std::move(test_cases));

if (do_print) {
std::cout << std::setw(4) << results << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions benchmark/solver/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ int main(int argc, char* argv[])

json test_cases = json::parse(get_input_stream());

auto results =
run_test_cases(SolverBenchmark{SolverGenerator{}}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(SolverBenchmark{SolverGenerator{}}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
2 changes: 1 addition & 1 deletion benchmark/solver/solver_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct SolverBenchmark : Benchmark<solver_benchmark_state<Generator>> {
auto warmup_config =
gko::ext::config::parse_json(warmup_case["solver"]);

auto registry = gko::config::registry{};
auto registry = create_default_registry();
auto td = gko::config::make_type_descriptor<etype>();

IterationControl ic{timer};
Expand Down
6 changes: 3 additions & 3 deletions benchmark/sparse_blas/sparse_blas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ int main(int argc, char* argv[])

print_general_information("", exec);

auto results =
run_test_cases(SparseBlasBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(SparseBlasBenchmark{}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
9 changes: 5 additions & 4 deletions benchmark/spmv/distributed/spmv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char* argv[])
auto schema = json::parse(
std::ifstream(GKO_ROOT "/benchmark/schema/spmv-distributed.json"));

initialize_argument_parsing(&argc, &argv, header, schema["examples"],
initialize_argument_parsing(&argc, &argv, header, schema["examples"], "",
do_print);

auto exec = executor_factory_mpi.at(FLAGS_executor)(comm.get());
Expand All @@ -55,9 +55,10 @@ int main(int argc, char* argv[])
std::string json_input = broadcast_json_input(get_input_stream(), comm);
auto test_cases = json::parse(json_input);

auto results = run_test_cases(
SpmvBenchmark{Generator{comm}, do_print}, exec,
get_mpi_timer(exec, comm, FLAGS_gpu_timer), schema, test_cases);
auto results =
run_test_cases(SpmvBenchmark{Generator{comm}, do_print}, exec,
get_mpi_timer(exec, comm, FLAGS_gpu_timer), schema,
std::move(test_cases));

if (do_print) {
std::cout << std::setw(4) << results << std::endl;
Expand Down
9 changes: 5 additions & 4 deletions benchmark/spmv/spmv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ int main(int argc, char* argv[])
auto schema =
json::parse(std::ifstream(GKO_ROOT "/benchmark/schema/spmv.json"));

initialize_argument_parsing(&argc, &argv, header, schema["examples"]);
initialize_argument_parsing(&argc, &argv, header, schema["examples"],
formats::format_description);

std::string extra_information =
"The number of right hand sides is " + std::to_string(FLAGS_nrhs);
Expand All @@ -39,9 +40,9 @@ int main(int argc, char* argv[])
SpmvBenchmark benchmark{Generator{}};
auto timer = get_timer(exec, FLAGS_gpu_timer);

auto results =
run_test_cases(SpmvBenchmark{Generator{}}, exec,
get_timer(exec, FLAGS_gpu_timer), schema, test_cases);
auto results = run_test_cases(SpmvBenchmark{Generator{}}, exec,
get_timer(exec, FLAGS_gpu_timer), schema,
std::move(test_cases));

std::cout << std::setw(4) << results << std::endl;
}
10 changes: 8 additions & 2 deletions benchmark/test/blas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import test_framework
import json


case = json.dumps([{"n": 100, "operation": op} for op in ["copy", "axpy", "scal"]])
case = json.dumps({"n": 100, "operation": ["copy", "axpy", "scal"]})

# check that all input modes work:
# parameter
Expand All @@ -21,6 +20,13 @@
stdin=case,
)

# list input
test_framework.compare_output(
["-input", json.dumps(test_framework.config_dict_to_list(json.loads(case)))],
expected_stdout="blas.list.stdout",
expected_stderr="blas.list.stderr",
)

# file
test_framework.compare_output(
["-input", str(test_framework.sourcepath / "input.blas.json")],
Expand Down
31 changes: 12 additions & 19 deletions benchmark/test/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,11 @@
import json


def generate_input(operations: List[Tuple[str]]):
input = [{"operator": {"stencil": {"kind": "7pt", "size": 100}}, "to": to_, "from": from_} for from_, to_ in
operations]
return json.dumps(input)
def generate_input(formats: List[str]):
return json.dumps({"operator": {"stencil": {"kind": "7pt", "size": 100}}, "to": formats, "from": formats})


stencil_input = generate_input([("coo", "coo"), ("coo", "csr"), ("csr", "csr"), ("csr", "coo")])
stencil_input_all = generate_input([("coo", "coo"),
("coo", "csr"),
("csr", "csr"),
("csr", "coo"),
("csr", "ell"),
("csr", "sellp"),
("csr", "hybrid"),
("ell", "ell"),
("ell", "csr"),
("sellp", "sellp"),
("sellp", "csr"),
("hybrid", "hybrid"),
("hybrid", "csr")])
stencil_input = generate_input(["coo", "csr"])

# check that all input modes work:
# parameter
Expand All @@ -41,6 +26,14 @@ def generate_input(operations: List[Tuple[str]]):
stdin=stencil_input,
)

# list input
test_framework.compare_output(
["-input", json.dumps(test_framework.config_dict_to_list(json.loads(stencil_input)))],
expected_stdout="conversion.list.stdout",
expected_stderr="conversion.list.stderr",
stdin=stencil_input,
)

# input file
test_framework.compare_output(
[
Expand All @@ -55,7 +48,7 @@ def generate_input(operations: List[Tuple[str]]):
test_framework.compare_output(
[
"-input",
stencil_input_all
str(test_framework.sourcepath / "input.conversion.all.json")
],
expected_stdout="conversion.all.stdout",
expected_stderr="conversion.all.stderr",
Expand Down
22 changes: 8 additions & 14 deletions benchmark/test/input.blas.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
[
{
"n": 100,
"operation": "copy"
},
{
"n": 100,
"operation": "axpy"
},
{
"n": 100,
"operation": "scal"
}
]
{
"n": 100,
"operation": [
"copy",
"axpy",
"scal"
]
}
Loading
Loading