Skip to content

Commit

Permalink
utest_gpu: make utest MPI-aware
Browse files Browse the repository at this point in the history
This is not needed for now, but it would be the first stumbling block
when writing an MPI-aware GPU unit test.
  • Loading branch information
hcmh committed Mar 14, 2024
1 parent 7c92712 commit 727f5d2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion utests/utest_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include "num/init.h"

#include "num/mpi_ops.h"

#include "utest.h"


Expand Down Expand Up @@ -42,8 +44,14 @@ UTESTS_GPU
#endif


int main(int /*argc*/, char* argv[])
int main(int argc, char* argv[])
{
#ifdef USE_MPI
init_mpi(&argc, &argv);
#else
(void)argc;
#endif

int num_tests_run = 0;
int num_tests_pass = 0;

Expand All @@ -57,6 +65,8 @@ int main(int /*argc*/, char* argv[])

debug_printf(good ? DP_INFO : DP_ERROR, "%20s: %2d/%2d passed.\n", argv[0], num_tests_pass, num_tests_run);

deinit_mpi();

exit(good ? 0 : 1);
}

Expand Down

0 comments on commit 727f5d2

Please sign in to comment.