Skip to content
Snippets Groups Projects
Verified Commit 639eccba authored by raphael.bach's avatar raphael.bach
Browse files

Add error check in `fmpi_futhark_values_##D##d_##T()`

parent 91136354
No related branches found
No related tags found
No related merge requests found
...@@ -172,11 +172,7 @@ void * fmpi_futhark_get_data_sync( ...@@ -172,11 +172,7 @@ void * fmpi_futhark_get_data_sync(
assert(out != NULL); assert(out != NULL);
assert(dim_cnt <= FMPI_DIM_MAX); assert(dim_cnt <= FMPI_DIM_MAX);
const size_t idx = FMPI_PRIV_FUTHARK_FUNC_IDX(dim_cnt, type); const size_t idx = FMPI_PRIV_FUTHARK_FUNC_IDX(dim_cnt, type);
const int err = fmpi_futhark_get_data_func_list[idx](ctx, in, out); fmpi_futhark_get_data_func_list[idx](ctx, in, out);
if(err != FUTHARK_SUCCESS) {
FMPI_RAISE_FUTHARK_ERROR(ctx, "futhark_values_##T##_##D##d() failed!");
return NULL;
}
fmpi_futhark_sync(ctx); fmpi_futhark_sync(ctx);
if(fmpi_futhark_check_error(ctx, "futhark_values_##T##_##D##d") == true) { if(fmpi_futhark_check_error(ctx, "futhark_values_##T##_##D##d") == true) {
return NULL; return NULL;
...@@ -237,7 +233,11 @@ int fmpi_futhark_values_##D##d_##T( \ ...@@ -237,7 +233,11 @@ int fmpi_futhark_values_##D##d_##T( \
assert(ctx != NULL); \ assert(ctx != NULL); \
assert(in != NULL); \ assert(in != NULL); \
assert(out != NULL); \ assert(out != NULL); \
return futhark_values_##T##_##D##d(ctx->ctx, in, out); \ const int err = futhark_values_##T##_##D##d(ctx->ctx, in, out); \
if(err != FUTHARK_SUCCESS) { \
FMPI_RAISE_FUTHARK_ERROR(ctx, CPL_STRINGIFY(futhark_free_##T##_##D##d)"() failed!"); \
} \
return err; \
} }
FMPI_DEFINE_FUNCS_DT(FMPI_FUTHARK_DEFINITION, 1, FMPI_FUTHARK_TYPES) FMPI_DEFINE_FUNCS_DT(FMPI_FUTHARK_DEFINITION, 1, FMPI_FUTHARK_TYPES)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment