PhoenixHardware
0.2.0
Tools to get hardware information
Toggle main menu visibility
Loading...
Searching...
No Matches
phoenix_template_alloc.h
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
#ifndef __PHOENIX_TEMPLATE_ALLOC_H__
8
#define __PHOENIX_TEMPLATE_ALLOC_H__
9
10
#include <iostream>
11
#include "
phoenix_alignement_type.h
"
12
#include "
phoenix_allocAlignedVector.h
"
13
14
namespace
Phoenix
{
16
enum
AllocMode
{
17
NONE
= 0,
18
ALIGNED
= 1,
19
PADDING
= 2
20
};
21
}
22
23
#ifdef PHOENIX_GPU_MODE
24
# define PHOENIX_AUTO_ALIGNED Phoenix::NONE
25
# define PHOENIX_AUTO_PADDING Phoenix::NONE
26
#else
27
# define PHOENIX_AUTO_ALIGNED Phoenix::ALIGNED
28
# define PHOENIX_AUTO_PADDING Phoenix::PADDING
29
#endif
30
31
template
<
typename
T>
32
size_t
phoenix_getPadding
(
size_t
nbElement);
33
34
template
<
typename
T>
35
T *
phoenix_template_alloc
(
size_t
& padding,
bool
& isAligned,
Phoenix::AllocMode
mode,
const
size_t
* tabDim,
size_t
nbDim);
36
template
<
typename
T>
37
T *
phoenix_template_alloc_aligned1d
(
size_t
nbValue);
38
template
<
typename
T>
39
void
phoenix_newAlignedTab
(T* & alignedPtr,
size_t
sizeOfVectorInT);
40
41
size_t
phoenix_getFullSize
(
const
size_t
* tabDim,
size_t
nbDim);
42
void
phoenix_copyShape
(
size_t
*& destTabDim,
const
size_t
* tabDim,
size_t
nbDim);
43
void
phoenix_copyShape
(
size_t
*& destTabDim,
size_t
& destNbDim,
const
size_t
* tabDim,
size_t
nbDim);
44
45
bool
phoenix_isSameShape
(
const
size_t
* tabDim1,
size_t
nbDim1,
const
size_t
* tabDim2,
size_t
nbDim2);
46
47
#include "
phoenix_template_alloc_impl.h
"
48
49
#endif
Phoenix
Definition
phoenix_template_alloc.h:14
Phoenix::AllocMode
AllocMode
Allocation mode of the PTensor.
Definition
phoenix_template_alloc.h:16
Phoenix::ALIGNED
@ ALIGNED
Definition
phoenix_template_alloc.h:18
Phoenix::PADDING
@ PADDING
Definition
phoenix_template_alloc.h:19
Phoenix::NONE
@ NONE
Definition
phoenix_template_alloc.h:17
phoenix_alignement_type.h
phoenix_allocAlignedVector.h
phoenix_getPadding
size_t phoenix_getPadding(size_t nbElement)
Get the padding with respect to the number of elements of the tables.
Definition
phoenix_template_alloc_impl.h:17
phoenix_copyShape
void phoenix_copyShape(size_t *&destTabDim, const size_t *tabDim, size_t nbDim)
Copy a shape of a tensor into an other.
Definition
phoenix_template_alloc.cpp:28
phoenix_newAlignedTab
void phoenix_newAlignedTab(T *&alignedPtr, size_t sizeOfVectorInT)
Alloc an aligned vector.
Definition
phoenix_template_alloc_impl.h:92
phoenix_getFullSize
size_t phoenix_getFullSize(const size_t *tabDim, size_t nbDim)
Get the fulle size of the tensor.
Definition
phoenix_template_alloc.cpp:15
phoenix_template_alloc_aligned1d
T * phoenix_template_alloc_aligned1d(size_t nbValue)
Do a template allcoation of a type.
Definition
phoenix_template_alloc_impl.h:72
phoenix_isSameShape
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.
Definition
phoenix_template_alloc.cpp:59
phoenix_template_alloc
T * phoenix_template_alloc(size_t &padding, bool &isAligned, Phoenix::AllocMode mode, const size_t *tabDim, size_t nbDim)
Allocate a tensor.
Definition
phoenix_template_alloc_impl.h:33
phoenix_template_alloc_impl.h
src
phoenix_template_alloc.h
Generated by
1.17.0