ceed-vector.c (c52157525785c51910c8fadbbfd077683f26126a) ceed-vector.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>

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

83 @ref Backend
84**/
85int CeedVectorGetState(CeedVector vec, uint64_t *state) {
86 *state = vec->state;
87 return CEED_ERROR_SUCCESS;
88}
89
90/**
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>

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

83 @ref Backend
84**/
85int CeedVectorGetState(CeedVector vec, uint64_t *state) {
86 *state = vec->state;
87 return CEED_ERROR_SUCCESS;
88}
89
90/**
91 @brief Add a reference to a CeedVector
92
93 @param[in,out] vec CeedVector to increment reference counter
94
95 @return An error code: 0 - success, otherwise - failure
96
97 @ref Backend
98**/
99int CeedVectorAddReference(CeedVector vec) {
100 vec->ref_count++;
101 return CEED_ERROR_SUCCESS;
102}
103
104/**
105 @brief Get the backend data of a CeedVector
106
107 @param[in] vec CeedVector to retrieve state
108 @param[out] data Variable to store data
109
110 @return An error code: 0 - success, otherwise - failure
111
112 @ref Backend

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

170
171 CeedCall(CeedGetObjectDelegate(ceed, &delegate, "Vector"));
172 CeedCheck(delegate, ceed, CEED_ERROR_UNSUPPORTED, "Backend does not support VectorCreate");
173 CeedCall(CeedVectorCreate(delegate, length, vec));
174 return CEED_ERROR_SUCCESS;
175 }
176
177 CeedCall(CeedCalloc(1, vec));
91 @brief Get the backend data of a CeedVector
92
93 @param[in] vec CeedVector to retrieve state
94 @param[out] data Variable to store data
95
96 @return An error code: 0 - success, otherwise - failure
97
98 @ref Backend

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

156
157 CeedCall(CeedGetObjectDelegate(ceed, &delegate, "Vector"));
158 CeedCheck(delegate, ceed, CEED_ERROR_UNSUPPORTED, "Backend does not support VectorCreate");
159 CeedCall(CeedVectorCreate(delegate, length, vec));
160 return CEED_ERROR_SUCCESS;
161 }
162
163 CeedCall(CeedCalloc(1, vec));
178 (*vec)->ceed = ceed;
179 CeedCall(CeedReference(ceed));
164 CeedCall(CeedReferenceCopy(ceed, &(*vec)->ceed));
180 (*vec)->ref_count = 1;
181 (*vec)->length = length;
182 (*vec)->state = 0;
183 CeedCall(ceed->VectorCreate(length, *vec));
184 return CEED_ERROR_SUCCESS;
185}
186
187/**

--- 717 unchanged lines hidden ---
165 (*vec)->ref_count = 1;
166 (*vec)->length = length;
167 (*vec)->state = 0;
168 CeedCall(ceed->VectorCreate(length, *vec));
169 return CEED_ERROR_SUCCESS;
170}
171
172/**

--- 717 unchanged lines hidden ---