<commit_before>/** \file
 *
 *  \brief            General 1D and 2D array copy
 *
 *  \date             Created:  Jul 12, 2014
 *  \date             Modified: $Date$
 *
 *  \authors          mauro <<EMAIL>>
 *
 *  \version          $Revision$
 */
#ifndef LINALG_UTILITIES_COPY_ARRAY_H_
#define LINALG_UTILITIES_COPY_ARRAY_H_

#ifdef HAVE_CUDA
#include <cuda_runtime.h> // various CUDA routines
#include "../CUDA/cuda_checks.h"  // checkCUDA, checkCUBLAS, checkCUSPARSE
#endif

#include "../types.h"
#include "../exceptions.h"
#include "../streams.h"
#include "../BLAS/blas.h"

namespace LinAlg {

namespace Utilities {

#ifndef DOXYGEN_SKIP

/* \brief              Helper function specialized with to use xCOPY for
 *                      supported datatypes
 */
template <typename T>
inline void copy_1Darray_host(T* src_array, I_t length, T* dst_array) {
  for (I_t i = 0; i < length; ++i) dst_array[i] = src_array[i];
};
template <>
inline void copy_1Darray_host(S_t* src_array, I_t length, S_t* dst_array){
  LinAlg::BLAS::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(D_t* src_array, I_t length, D_t* dst_array){
  LinAlg::BLAS::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(C_t* src_array, I_t length, C_t* dst_array){
  LinAlg::BLAS::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(Z_t* src_array, I_t length, Z_t* dst_array){
  LinAlg::BLAS::xCOPY(length, src_array, 1, dst_array, 1);
};

#endif /* DOXYGEN_SKIP */


/** \brief              1D array copy
 *
 *  This function copies vectors from raw pointers. This is basically a<commit_msg>Fix namespace path of xCOPY<commit_after>/** \file
 *
 *  \brief            General 1D and 2D array copy
 *
 *  \date             Created:  Jul 12, 2014
 *  \date             Modified: $Date$
 *
 *  \authors          mauro <<EMAIL>>
 *
 *  \version          $Revision$
 */
#ifndef LINALG_UTILITIES_COPY_ARRAY_H_
#define LINALG_UTILITIES_COPY_ARRAY_H_

#ifdef HAVE_CUDA
#include <cuda_runtime.h> // various CUDA routines
#include "../CUDA/cuda_checks.h"  // checkCUDA, checkCUBLAS, checkCUSPARSE
#endif

#include "../types.h"
#include "../exceptions.h"
#include "../streams.h"
#include "../BLAS/blas.h"

namespace LinAlg {

namespace Utilities {

#ifndef DOXYGEN_SKIP

/* \brief              Helper function specialized with to use xCOPY for
 *                      supported datatypes
 */
template <typename T>
inline void copy_1Darray_host(T* src_array, I_t length, T* dst_array) {
  for (I_t i = 0; i < length; ++i) dst_array[i] = src_array[i];
};
template <>
inline void copy_1Darray_host(S_t* src_array, I_t length, S_t* dst_array){
  LinAlg::BLAS::FORTRAN::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(D_t* src_array, I_t length, D_t* dst_array){
  LinAlg::BLAS::FORTRAN::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(C_t* src_array, I_t length, C_t* dst_array){
  LinAlg::BLAS::FORTRAN::xCOPY(length, src_array, 1, dst_array, 1);
};
template <>
inline void copy_1Darray_host(Z_t* src_array, I_t length, Z_t* dst_array){
  LinAlg::BLAS::FORTRAN::xCOPY(length, src_array, 1, dst_array, 1);
};

#endif /* DOXYGEN_SKIP */


/** \brief              1D array copy
 *
 *  This function copies vectors from raw pointers. This is basically a
{'fraction_non_alphanumeric': 0.13133097762073026, 'fraction_numerical': 0.013545347467608953, 'mean_word_length': 3.499337748344371, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1439848', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1255, 'n_words': 317}