47 #include "../common/c71/DSPLIB_inlines.h"
57 #define SE_PARAM_BASE (0x0000)
58 #define SE_SE0_PARAM_OFFSET (SE_PARAM_BASE)
59 #define SE_SA0_PARAM_OFFSET (SE_SE0_PARAM_OFFSET + SE_PARAM_SIZE)
61 template <
typename dataType>
68 __SE_TEMPLATE_v1 se0Params;
69 __SA_TEMPLATE_v1 sa0Params;
71 __SE_ELETYPE SE_ELETYPE;
72 __SE_VECLEN SE_VECLEN;
73 __SA_VECLEN SA_VECLEN;
77 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
78 uint32_t blockSize = pKerPrivArgs->
blockSize;
80 typedef typename c7x::make_full_vector<dataType>::type vec;
81 SE_VECLEN = c7x::se_veclen<vec>::value;
82 SA_VECLEN = c7x::sa_veclen<vec>::value;
83 SE_ELETYPE = c7x::se_eletype<vec>::value;
86 int32_t eleCount = c7x::element_count_of<vec>::value;
87 printf(
"Enter eleCount %d\n", eleCount);
93 se0Params = __gen_SE_TEMPLATE_v1();
95 se0Params.ICNT0 = blockSize;
96 se0Params.ELETYPE = SE_ELETYPE;
97 se0Params.VECLEN = SE_VECLEN;
98 se0Params.DIMFMT = __SE_DIMFMT_1D;
103 sa0Params = __gen_SA_TEMPLATE_v1();
105 sa0Params.ICNT0 = blockSize;
106 sa0Params.DIM1 = blockSize;
107 sa0Params.VECLEN = SA_VECLEN;
108 sa0Params.DIMFMT = __SA_DIMFMT_1D;
156 template <
typename dataType>
161 uint32_t blockSize = pKerPrivArgs->
blockSize;
163 __SE_TEMPLATE_v1 se0Params;
164 __SA_TEMPLATE_v1 sa0Params;
166 dataType *restrict pInLocal1 = (dataType *) pIn1;
167 dataType *restrict pInLocal2 = (dataType *) pIn2;
168 dataType *restrict pOutLocal = (dataType *) pOut;
170 #if DSPLIB_DEBUGPRINT
171 printf(
"Enter DSPLIB_add_exec_ci\n");
174 typedef typename c7x::make_full_vector<dataType>::type vec;
175 int32_t eleCount = c7x::element_count_of<vec>::value;
177 #if DSPLIB_DEBUGPRINT
178 printf(
"Enter eleCount %d\n", eleCount);
180 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
185 __SA0_OPEN(sa0Params);
188 __SE0_OPEN(pInLocal1, se0Params);
189 __SE1_OPEN(pInLocal2, se0Params);
192 __SA0_OPEN(sa0Params);
194 #if DSPLIB_DEBUGPRINT
195 printf(
"DSPLIB_DEBUGPRINT blockSize %d\n", blockSize);
199 for (int32_t counter = 0; counter < blockSize; counter += eleCount) {
200 vec a = c7x::strm_eng<0, vec>::get_adv();
201 vec b = c7x::strm_eng<1, vec>::get_adv();
205 __vpred tmp = c7x::strm_agen<0, vec>::get_vpred();
206 vec *VB1 = c7x::strm_agen<0, vec>::get_adv(pOutLocal);
208 __vstore_pred(tmp, VB1, out);
template DSPLIB_STATUS DSPLIB_add_init_ci< int32_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
#define SE_SE0_PARAM_OFFSET
template DSPLIB_STATUS DSPLIB_add_init_ci< int8_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_exec_ci< double >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_exec_ci< uint8_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_init_ci< uint32_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_exec_ci< int16_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
DSPLIB_STATUS DSPLIB_add_init_ci(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
template DSPLIB_STATUS DSPLIB_add_exec_ci< int8_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_init_ci< int16_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_init_ci< uint8_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_init_ci< uint16_t >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_init_ci< float >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
template DSPLIB_STATUS DSPLIB_add_init_ci< double >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_add_InitArgs *pKerInitArgs)
DSPLIB_STATUS DSPLIB_add_exec_ci(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
This function is the main execution function for the C7x implementation of the kernel....
template DSPLIB_STATUS DSPLIB_add_exec_ci< uint16_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_exec_ci< float >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_exec_ci< uint32_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_add_exec_ci< int32_t >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
#define SE_SA0_PARAM_OFFSET
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_add.
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
int32_t blockSize
Size of input buffer for different batches DSPLIB_add_init that will be retrieved and used by DSPLIB_...
uint8_t bufPblock[DSPLIB_ADD_IXX_IXX_OXX_PBLOCK_SIZE]
A structure for a 1 dimensional buffer descriptor.