Vector helper container with vector operations.
More...
|
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<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<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<typename InType , typename OutType , unsigned int VectorLength, bool UseReduceTree> |
void | nvhls::reduction (nv_scvector< InType, VectorLength > in, OutType &out) |
| Function implementing vector reduction.
|
|
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<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.
|
|
Vector helper container with vector operations.
◆ vector_mul()
Function implementing vector multiplication.
- Template Parameters
-
InType1 | Input1 Scalar Type |
InType2 | Input2 Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
Unroll | Template 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;
...
nvhls::vector_mul<NVUINT2, NVUINT2, NVUINT4, 8,
true>(
v1,
v2,out);
...
Vector helper container with vector operations.
nvhls_t< W >::nvuint_t get_slc(type X, const unsigned int i)
Function that returns slice of bits.
Definition at line 210 of file nvhls_vector.h.
◆ vector_add()
Function implementing vector addition.
- Template Parameters
-
InType1 | Input1 Scalar Type |
InType2 | Input2 Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
Unroll | Template 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;
...
nvhls::vector_add<NVUINT2, NVUINT2, NVUINT3, 8,
true>(
v1,
v2,out);
...
Definition at line 258 of file nvhls_vector.h.
◆ vector_sub()
Function implementing vector subtraction.
- Template Parameters
-
InType1 | Input1 Scalar Type |
InType2 | Input2 Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
Unroll | Template 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;
...
nvhls::vector_sub<NVUINT2, NVUINT2, NVINT3, 8,
true>(
v1,
v2,out);
...
Definition at line 304 of file nvhls_vector.h.
◆ reduction()
Function implementing vector reduction.
- Template Parameters
-
InType | Input Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
UseReduceTree | Template 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.
◆ dp()
Function implementing vector dot-product.
- Template Parameters
-
InType1 | Input1 Scalar Type |
InType2 | Input2 Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
UseReduceTree | Template 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.
◆ vector_mac()
Function implementing vector multiply and add.
- Template Parameters
-
InType1 | Input1 Scalar Type |
InType2 | Input2 Scalar Type |
InType3 | Input3 Scalar Type |
OutType | Output Scalar Type |
VectorLength | Length of vector |
UseReduceTree | Template 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;
...
nvhls::vector_mac<NVUINT2, NVUINT2, NVUINT2, NVUINT8, 8,
true>(
v1,
v2,
v3, out);
...
Definition at line 462 of file nvhls_vector.h.