7#ifndef __PHOENIX_TEMPLATE_ALLOC_H__
8#define __PHOENIX_TEMPLATE_ALLOC_H__
23#ifdef PHOENIX_GPU_MODE
24# define PHOENIX_AUTO_ALIGNED Phoenix::NONE
25# define PHOENIX_AUTO_PADDING Phoenix::NONE
27# define PHOENIX_AUTO_ALIGNED Phoenix::ALIGNED
28# define PHOENIX_AUTO_PADDING Phoenix::PADDING
43void phoenix_copyShape(
size_t *& destTabDim,
size_t & destNbDim,
const size_t * tabDim,
size_t nbDim);
45bool phoenix_isSameShape(
const size_t * tabDim1,
size_t nbDim1,
const size_t * tabDim2,
size_t nbDim2);
AllocMode
Allocation mode of the PTensor.
size_t phoenix_getPadding(size_t nbElement)
Get the padding with respect to the number of elements of the tables.
void phoenix_copyShape(size_t *&destTabDim, const size_t *tabDim, size_t nbDim)
Copy a shape of a tensor into an other.
void phoenix_newAlignedTab(T *&alignedPtr, size_t sizeOfVectorInT)
Alloc an aligned vector.
size_t phoenix_getFullSize(const size_t *tabDim, size_t nbDim)
Get the fulle size of the tensor.
T * phoenix_template_alloc_aligned1d(size_t nbValue)
Do a template allcoation of a type.
bool phoenix_isSameShape(const size_t *tabDim1, size_t nbDim1, const size_t *tabDim2, size_t nbDim2)
Say if two shapes are the same or not.
T * phoenix_template_alloc(size_t &padding, bool &isAligned, Phoenix::AllocMode mode, const size_t *tabDim, size_t nbDim)
Allocate a tensor.