ceed-memcheck-qfunction.c (3345ba21ea3223800ed4bc1b9a4502bd60b77d9f) ceed-memcheck-qfunction.c (2bf66f3ba75e883c03ae18c8a6b7ba12e94847f2)
1// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed.h>

--- 61 unchanged lines hidden (view full) ---

70 // Check for unset output values and restore arrays
71 {
72 const char *kernel_name, *kernel_path;
73
74 CeedCallBackend(CeedQFunctionGetSourcePath(qf, &kernel_path));
75 CeedCallBackend(CeedQFunctionGetKernelName(qf, &kernel_name));
76 CeedCallBackend(CeedQFunctionGetFields(qf, NULL, NULL, NULL, &output_fields));
77 for (CeedInt i = 0; i < num_out; i++) {
1// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed.h>

--- 61 unchanged lines hidden (view full) ---

70 // Check for unset output values and restore arrays
71 {
72 const char *kernel_name, *kernel_path;
73
74 CeedCallBackend(CeedQFunctionGetSourcePath(qf, &kernel_path));
75 CeedCallBackend(CeedQFunctionGetKernelName(qf, &kernel_name));
76 CeedCallBackend(CeedQFunctionGetFields(qf, NULL, NULL, NULL, &output_fields));
77 for (CeedInt i = 0; i < num_out; i++) {
78 CeedInt field_size;
78 const char *field_name;
79 CeedInt field_size;
79
80 // Note: need field size because vector may be longer than needed for output
81 CeedCallBackend(CeedQFunctionFieldGetSize(output_fields[i], &field_size));
80
81 // Note: need field size because vector may be longer than needed for output
82 CeedCallBackend(CeedQFunctionFieldGetSize(output_fields[i], &field_size));
83 CeedCallBackend(CeedQFunctionFieldGetName(output_fields[i], &field_name));
82 for (CeedSize j = 0; j < field_size * (CeedSize)Q; j++) {
83 CeedCheck(!isnan(impl->outputs[i][j]), ceed, CEED_ERROR_BACKEND,
84 for (CeedSize j = 0; j < field_size * (CeedSize)Q; j++) {
85 CeedCheck(!isnan(impl->outputs[i][j]), ceed, CEED_ERROR_BACKEND,
84 "QFunction output %" CeedInt_FMT " entry %" CeedSize_FMT " is NaN after restoring write-only access: %s:%s ", i, j, kernel_path,
85 kernel_name);
86 "QFunction output %" CeedInt_FMT " '%s' entry %" CeedSize_FMT " is NaN after restoring write-only access: %s:%s ", i, field_name, j,
87 kernel_path, kernel_name);
86 }
87 CeedCallBackend(CeedVectorRestoreArray(V[i], &impl->outputs[i]));
88 VALGRIND_DISCARD(output_block_ids[i]);
89 }
90 }
91 CeedCallBackend(CeedQFunctionRestoreContextData(qf, &ctx_data));
92 return CEED_ERROR_SUCCESS;
93}

--- 32 unchanged lines hidden ---
88 }
89 CeedCallBackend(CeedVectorRestoreArray(V[i], &impl->outputs[i]));
90 VALGRIND_DISCARD(output_block_ids[i]);
91 }
92 }
93 CeedCallBackend(CeedQFunctionRestoreContextData(qf, &ctx_data));
94 return CEED_ERROR_SUCCESS;
95}

--- 32 unchanged lines hidden ---