MatchLib
Classes | Functions

Vector helper container with vector operations. More...

Classes

class  nvhls::nv_scvector< Type, VectorLength >
 Vector helper container with vector operations. More...
 

Functions

template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_mul (nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
 Function implementing vector multiplication. More...
 
template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_add (nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
 Function implementing vector addition. More...
 
template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_sub (nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< OutType, VectorLength > &out)
 Function implementing vector subtraction. More...
 
template<typename InType , typename OutType , unsigned int VectorLength, bool UseReduceTree>
void nvhls::reduction (nv_scvector< InType, VectorLength > in, OutType &out)
 Function implementing vector reduction. More...
 
template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool UseReduceTree>
void nvhls::dp (nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, OutType &out)
 Function implementing vector dot-product. More...
 
template<typename InType1 , typename InType2 , typename InType3 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_mac (nv_scvector< InType1, VectorLength > in1, nv_scvector< InType2, VectorLength > in2, nv_scvector< InType3, VectorLength > in3, nv_scvector< OutType, VectorLength > &out)
 Function implementing vector multiply and add. More...
 

Detailed Description

Vector helper container with vector operations.

Function Documentation

template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_mul ( nv_scvector< InType1, VectorLength >  in1,
nv_scvector< InType2, VectorLength >  in2,
nv_scvector< OutType, VectorLength > &  out 
)

Function implementing vector multiplication.

Template Parameters
InType1Input1 Scalar Type
InType2Input2 Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UnrollTemplate parameter to control unrolling
Overview
This function multiplies two input vectors of InType1 and InType2 type and produces output of type OutType. Length of all vectors is VectorLength. If InType1, InType2, OutType are user-defined types, then OutType = InType1*InType2 should be defined by the user using operator overloading
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1, v2;
nv_scvector<NVUINT4, 8> out;
...
nvhls::vector_mul<NVUINT2, NVUINT2, NVUINT4, 8, true>(v1,v2,out);
...

Definition at line 210 of file nvhls_vector.h.

template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_add ( nv_scvector< InType1, VectorLength >  in1,
nv_scvector< InType2, VectorLength >  in2,
nv_scvector< OutType, VectorLength > &  out 
)

Function implementing vector addition.

Template Parameters
InType1Input1 Scalar Type
InType2Input2 Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UnrollTemplate parameter to control unrolling
Overview
This function adds two input vectors of InType1 and InType2 type and produces output of type OutType. Length of all vectors is VectorLength. If InType1, InType2, OutType are user-defined types, then OutType = InType1+InType2 should be defined by the user using operator overloading
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1, v2;
nv_scvector<NVUINT3, 8> out;
...
nvhls::vector_add<NVUINT2, NVUINT2, NVUINT3, 8, true>(v1,v2,out);
...

Definition at line 258 of file nvhls_vector.h.

template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_sub ( nv_scvector< InType1, VectorLength >  in1,
nv_scvector< InType2, VectorLength >  in2,
nv_scvector< OutType, VectorLength > &  out 
)

Function implementing vector subtraction.

Template Parameters
InType1Input1 Scalar Type
InType2Input2 Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UnrollTemplate parameter to control unrolling
Overview
This function adds two input vectors of InType1 and InType2 type and produces output of type OutType. Length of all vectors is VectorLength. If InType1, InType2, OutType are user-defined types, then OutType = InType1-InType2 should be defined by the user using operator overloading
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1, v2;
nv_scvector<NVINT3, 8> out;
...
nvhls::vector_sub<NVUINT2, NVUINT2, NVINT3, 8, true>(v1,v2,out);
...

Definition at line 304 of file nvhls_vector.h.

template<typename InType , typename OutType , unsigned int VectorLength, bool UseReduceTree>
void nvhls::reduction ( nv_scvector< InType, VectorLength >  in,
OutType &  out 
)

Function implementing vector reduction.

Template Parameters
InTypeInput Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UseReduceTreeTemplate parameter to control datapath optimization by HLS tool
Overview
This function performs redcution of input vector of type InType and produces scalar output of type OutType. Length of all vectors is VectorLength. If InType and OutType, OutType are user-defined types, then OutType += InType, OutType = InType should be defined by the user using operator overloading
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1;
NVUINT5 out;
...
nvhls::reduction<NVUINT2, NVUINT5, 8, true>(v1,out);
...

Definition at line 350 of file nvhls_vector.h.

template<typename InType1 , typename InType2 , typename OutType , unsigned int VectorLength, bool UseReduceTree>
void nvhls::dp ( nv_scvector< InType1, VectorLength >  in1,
nv_scvector< InType2, VectorLength >  in2,
OutType &  out 
)

Function implementing vector dot-product.

Template Parameters
InType1Input1 Scalar Type
InType2Input2 Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UseReduceTreeTemplate parameter to control datapath optimization by HLS tool
Overview
This function performs dot-product of 2 input vectors of "InType1" and "InType2" types and produces output of type "OutType". Input vector length is "VectorLength". If InType1, InType2, and OutType are user-defined types, then OutType += InType1*InType2, OutType = InType1*InType2 operations should be defined by the user
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1, v2;
NVUINT7 out;
...
nvhls::dp<NVUINT2, NVUINT2, NVUINT7, 8, true>(v1, v2, out);
...

Definition at line 406 of file nvhls_vector.h.

template<typename InType1 , typename InType2 , typename InType3 , typename OutType , unsigned int VectorLength, bool Unroll>
void nvhls::vector_mac ( nv_scvector< InType1, VectorLength >  in1,
nv_scvector< InType2, VectorLength >  in2,
nv_scvector< InType3, VectorLength >  in3,
nv_scvector< OutType, VectorLength > &  out 
)

Function implementing vector multiply and add.

Template Parameters
InType1Input1 Scalar Type
InType2Input2 Scalar Type
InType3Input3 Scalar Type
OutTypeOutput Scalar Type
VectorLengthLength of vector
UseReduceTreeTemplate parameter to control datapath optimization by HLS tool
Overview
This function multiplies two input vectors of InType1 and InType2 type and adds another vector of type InType3 to produce output of type OutType. Length of all vectors is VectorLength. If InType1, InType2, OutType are user-defined types, then OutType = InType1*InType2 + InType3 should be defined by the user using operator overloading
A Simple Example
#include <nvhls_vector.h>
...
nv_scvector<NVUINT2, 8> v1, v2, v3;
nv_scvector<NVUINT8, 8> out;
...
nvhls::vector_mac<NVUINT2, NVUINT2, NVUINT2, NVUINT8, 8, true>(v1, v2, v3, out);
...

Definition at line 462 of file nvhls_vector.h.