7#include "arcane/aleph/AlephArcane.h"
8#include "arcane/aleph/cuda/AlephCuda.h"
15template <
class T> CNC_Vector<T>::CNC_Vector(
unsigned int size,
unsigned int alignment)
20 allocate(size, alignment);
23template <
class T> CNC_Vector<T>::~CNC_Vector()
35 base_mem_ = (
char*)malloc(size *
sizeof(T) + alignment - 1);
38 while (((
unsigned long long)p) % alignment) {
42 for (
unsigned int i = 0; i < size; i++) {
52template <
class T>
void CNC_Vector<T>::set_all(
const T& value)
54 for (
unsigned int i = 0; i < size_; i++) {
61template <
class T> T& CNC_Vector<T>::operator()(
unsigned int i)
68template <
class T>
const T& CNC_Vector<T>::operator()(
unsigned int i)
const
75template <
class T> T& CNC_Vector<T>::operator[](
unsigned int index)
82template <
class T>
const T& CNC_Vector<T>::operator[](
unsigned int index)
const
89template <
class T> T& CNC_Vector<T>::from_linear_index(
unsigned int index)
96template <
class T>
const T& CNC_Vector<T>::from_linear_index(
unsigned int index)
const
103template <
class T>
unsigned int CNC_Vector<T>::size()
const
110template <
class T>
unsigned int CNC_Vector<T>::alignment()
const
117template <
class T>
void CNC_Vector<T>::clear()
140template <
class T>
unsigned int CNC_Vector<T>::mem_usage()
const
142 return size_ *
sizeof(T) +
sizeof(thisclass);
147template <
class T>
void CNC_Vector<T>::print()
const
149 for (
unsigned int index = 0; index < size_; index++) {
156template <
class T>
void CNC_Vector<T>::deallocate()
159 for (
unsigned int i = 0; i < size_; i++) {
void allocate(unsigned int size, unsigned int alignment=1)
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --