/*! \file 
 * \brief template definition of `__device__` function (CUDA) or function TestFunc
 * 
 * 
 */

#ifndef __INITARRAYFUNC_HPP__
#define __INITARRAYFUNC_HPP__

#ifdef __CUDACC__
#define DEVICE __device__
#else
#define DEVICE
#endif

/*! \brief template function used on device or host
 * 
 * \param Const  T value
 * \param i      integer value
 * 
 * \tparam T     type `int`, `float` or `double`
 * 
*/
template <class T> DEVICE T TestFunc(T Const, int i){
  //return (T)1.0;
  return Const*((T)(1-2*(i%2)));
}

#endif
