| ceed-qfunction.c (c52157525785c51910c8fadbbfd077683f26126a) | ceed-qfunction.c (db002c03923317a1c3814dcd861330002c00a8ea) |
|---|---|
| 1// Copyright (c) 2017-2022, 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-impl.h> --- 574 unchanged lines hidden (view full) --- 583 CeedCall(CeedQFunctionCreateInterior(delegate, vec_length, f, source, qf)); 584 return CEED_ERROR_SUCCESS; 585 } 586 587 CeedCheck(!strlen(source) || strrchr(source, ':'), ceed, CEED_ERROR_INCOMPLETE, 588 "Provided path to source does not include function name. Provided: \"%s\"\nRequired: \"\\abs_path\\file.h:function_name\"", source); 589 590 CeedCall(CeedCalloc(1, qf)); | 1// Copyright (c) 2017-2022, 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-impl.h> --- 574 unchanged lines hidden (view full) --- 583 CeedCall(CeedQFunctionCreateInterior(delegate, vec_length, f, source, qf)); 584 return CEED_ERROR_SUCCESS; 585 } 586 587 CeedCheck(!strlen(source) || strrchr(source, ':'), ceed, CEED_ERROR_INCOMPLETE, 588 "Provided path to source does not include function name. Provided: \"%s\"\nRequired: \"\\abs_path\\file.h:function_name\"", source); 589 590 CeedCall(CeedCalloc(1, qf)); |
| 591 (*qf)->ceed = ceed; 592 CeedCall(CeedReference(ceed)); | 591 CeedCall(CeedReferenceCopy(ceed, &(*qf)->ceed)); |
| 593 (*qf)->ref_count = 1; 594 (*qf)->vec_length = vec_length; 595 (*qf)->is_identity = false; 596 (*qf)->is_context_writable = true; 597 (*qf)->function = f; 598 (*qf)->user_flop_estimate = -1; 599 if (strlen(source)) { 600 size_t user_source_len = strlen(source); --- 251 unchanged lines hidden (view full) --- 852 853 @return An error code: 0 - success, otherwise - failure 854 855 @ref User 856**/ 857int CeedQFunctionSetContext(CeedQFunction qf, CeedQFunctionContext ctx) { 858 CeedCall(CeedQFunctionContextDestroy(&qf->ctx)); 859 qf->ctx = ctx; | 592 (*qf)->ref_count = 1; 593 (*qf)->vec_length = vec_length; 594 (*qf)->is_identity = false; 595 (*qf)->is_context_writable = true; 596 (*qf)->function = f; 597 (*qf)->user_flop_estimate = -1; 598 if (strlen(source)) { 599 size_t user_source_len = strlen(source); --- 251 unchanged lines hidden (view full) --- 851 852 @return An error code: 0 - success, otherwise - failure 853 854 @ref User 855**/ 856int CeedQFunctionSetContext(CeedQFunction qf, CeedQFunctionContext ctx) { 857 CeedCall(CeedQFunctionContextDestroy(&qf->ctx)); 858 qf->ctx = ctx; |
| 860 if (ctx) { 861 CeedCall(CeedQFunctionContextReference(ctx)); 862 } | 859 if (ctx) CeedCall(CeedQFunctionContextReference(ctx)); |
| 863 return CEED_ERROR_SUCCESS; 864} 865 866/** 867 @brief Set writability of CeedQFunctionContext when calling the `CeedQFunctionUser`. 868 869 The default value is `is_writable == true`. 870 --- 143 unchanged lines hidden --- | 860 return CEED_ERROR_SUCCESS; 861} 862 863/** 864 @brief Set writability of CeedQFunctionContext when calling the `CeedQFunctionUser`. 865 866 The default value is `is_writable == true`. 867 --- 143 unchanged lines hidden --- |