ceed-vector.c (6e536b992ff6bc401c55631f1bc4464446496b52) ceed-vector.c (d77c2f5d4a529fbf1d1bcf854512200df933820e)
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>

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

215 @ref User
216**/
217int CeedVectorCopy(CeedVector vec, CeedVector vec_copy) {
218 Ceed ceed;
219 CeedMemType mem_type, mem_type_copy;
220 CeedScalar *array;
221
222 // Get the preferred memory type
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>

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

215 @ref User
216**/
217int CeedVectorCopy(CeedVector vec, CeedVector vec_copy) {
218 Ceed ceed;
219 CeedMemType mem_type, mem_type_copy;
220 CeedScalar *array;
221
222 // Get the preferred memory type
223 CeedVectorGetCeed(vec, &ceed);
224 CeedGetPreferredMemType(ceed, &mem_type);
223 CeedCall(CeedVectorGetCeed(vec, &ceed));
224 CeedCall(CeedGetPreferredMemType(ceed, &mem_type));
225
226 // Get the preferred memory type
225
226 // Get the preferred memory type
227 CeedVectorGetCeed(vec_copy, &ceed);
228 CeedGetPreferredMemType(ceed, &mem_type_copy);
227 CeedCall(CeedVectorGetCeed(vec_copy, &ceed));
228 CeedCall(CeedGetPreferredMemType(ceed, &mem_type_copy));
229
230 // Check that both have same memory type
231 if (mem_type != mem_type_copy) mem_type = CEED_MEM_HOST;
232
233 // Copy the values from vec to vec_copy
234 CeedCall(CeedVectorGetArray(vec, mem_type, &array));
235 CeedCall(CeedVectorSetArray(vec_copy, mem_type, CEED_COPY_VALUES, array));
236

--- 758 unchanged lines hidden ---
229
230 // Check that both have same memory type
231 if (mem_type != mem_type_copy) mem_type = CEED_MEM_HOST;
232
233 // Copy the values from vec to vec_copy
234 CeedCall(CeedVectorGetArray(vec, mem_type, &array));
235 CeedCall(CeedVectorSetArray(vec_copy, mem_type, CEED_COPY_VALUES, array));
236

--- 758 unchanged lines hidden ---