Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spgemm perf test enhancements #1664

Merged
merged 8 commits into from
Mar 30, 2023
Merged
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
36 changes: 36 additions & 0 deletions perf_test/KokkosKernels_perf_test_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ void process_arg_int(char const* str_val, int& val) {
}
}

void process_arg_double(char const* str_val, double& val) {
errno = 0;
char* ptr_end;
val = std::strtod(str_val, &ptr_end);

if (str_val == ptr_end) {
std::stringstream ss;
ss << "Error: cannot convert command line argument '" << str_val
<< "' to a double.\n";
throw std::invalid_argument(ss.str());
}

if (errno == ERANGE) {
std::stringstream ss;
ss << "Error: converted value for command line argument '" << str_val
<< "' falls out of range.\n";
throw std::invalid_argument(ss.str());
}
}

bool check_arg_int(int const i, int const argc, char** argv, char const* name,
int& val) {
if (0 != Test::string_compare_no_case(argv[i], name)) {
Expand All @@ -83,6 +103,22 @@ bool check_arg_int(int const i, int const argc, char** argv, char const* name,
return true;
}

bool check_arg_double(int const i, int const argc, char** argv,
char const* name, double& val) {
if (0 != Test::string_compare_no_case(argv[i], name)) {
return false;
}

if (i < argc - 1) {
process_arg_double(argv[i + 1], val);
} else {
std::stringstream msg;
msg << name << " input argument needs to be followed by a real number";
throw std::invalid_argument(msg.str());
}
return true;
}

bool check_arg_bool(int const i, int const /*argc*/, char** argv,
char const* name, bool& val) {
if (0 != Test::string_compare_no_case(argv[i], name)) {
Expand Down
6 changes: 3 additions & 3 deletions perf_test/graph/KokkosGraph_color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void run_experiment(crsGraph_t crsGraph, int num_cols, Parameters params) {
}
}

if (params.coloring_output_file != NULL) {
if (params.coloring_output_file != "") {
std::ofstream os(params.coloring_output_file, std::ofstream::out);
KokkosKernels::Impl::print_1Dview(os, colors, true, "\n");
}
Expand Down Expand Up @@ -420,7 +420,7 @@ void run_multi_mem_experiment(Parameters params) {
// typedef typename slow_graph_t::entries_type::const_type
// const_slow_cols_view_t;

char *a_mat_file = params.a_mtx_bin_file;
const char *a_mat_file = params.a_mtx_bin_file.c_str();
// char *b_mat_file = params.b_mtx_bin_file;
// char *c_mat_file = params.c_mtx_bin_file;

Expand Down Expand Up @@ -581,7 +581,7 @@ int main(int argc, char **argv) {
if (parse_inputs(params, argc, argv)) {
return 1;
}
if (params.a_mtx_bin_file == NULL) {
if (params.a_mtx_bin_file == "") {
std::cerr << "Provide a matrix file" << std::endl;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion perf_test/graph/KokkosGraph_run_triangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool is_same_graph(crsGraph_t output_mat1, crsGraph_t output_mat2) {
if (!is_identical) return false;

if (!is_identical) {
std::cout << "Incorret values" << std::endl;
std::cout << "Incorrect values" << std::endl;
}
return true;
}
Expand Down
216 changes: 0 additions & 216 deletions perf_test/sparse/KokkosSparse_multimem_spgemm.hpp

This file was deleted.

Loading