49 template <
typename dataTypeOut>
inline __SE_TEMPLATE_v1
q15tofl_se_init(int32_t blockSize);
53 typedef typename c7x::short_hvec vecIn;
54 typedef typename c7x::make_full_vector<float>::type vecOut;
55 __SE_ELETYPE SE_ELETYPE = c7x::se_eletype<vecIn>::value;
56 __SE_VECLEN SE_VECLEN = c7x::se_veclen<vecOut>::value;
58 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
59 se0Params.ICNT0 = blockSize;
60 se0Params.ELETYPE = SE_ELETYPE;
61 se0Params.VECLEN = SE_VECLEN;
62 se0Params.DIMFMT = __SE_DIMFMT_1D;
63 se0Params.PROMOTE = __SE_PROMOTE_2X_SIGNEXT;
70 typedef typename c7x::short_qvec vecIn;
71 typedef typename c7x::make_full_vector<double>::type vecOut;
72 __SE_ELETYPE SE_ELETYPE = c7x::se_eletype<vecIn>::value;
73 __SE_VECLEN SE_VECLEN = c7x::se_veclen<vecOut>::value;
75 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
76 se0Params.ICNT0 = blockSize;
77 se0Params.ELETYPE = SE_ELETYPE;
78 se0Params.VECLEN = SE_VECLEN;
79 se0Params.DIMFMT = __SE_DIMFMT_1D;
80 se0Params.PROMOTE = __SE_PROMOTE_4X_SIGNEXT;
85 template <
typename dataTypeOut>
95 uint32_t blockSize = pKerPrivArgs->
blockSize;
96 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
98 typedef typename c7x::make_full_vector<dataTypeOut>::type vecOut;
100 __SA_VECLEN SA_VECLEN = c7x::sa_veclen<vecOut>::value;
105 __SE_TEMPLATE_v1 se0Params = q15tofl_se_init<dataTypeOut>(blockSize);
111 __SA_TEMPLATE_v1 sa0Params = __gen_SA_TEMPLATE_v1();
112 sa0Params.ICNT0 = blockSize;
113 sa0Params.VECLEN = SA_VECLEN;
114 sa0Params.DIMFMT = __SA_DIMFMT_1D;
133 template <
typename dataTypeOut>
inline void q15tofl_convert(dataTypeOut *restrict pOutLocal, int32_t blockSize);
137 typedef typename c7x::int_vec vecLoad;
138 typedef typename c7x::make_full_vector<float>::type vecOut;
139 int32_t eleCount = c7x::element_count_of<vecOut>::value;
140 vecOut outDat, scale;
142 scale = (vecOut) (1.0 / 32768);
144 for (int32_t counter = 0; counter < blockSize; counter += eleCount) {
145 vecLoad inDat = c7x::strm_eng<0, vecLoad>::get_adv();
146 vecOut inDatConv = __int_to_float(c7x::as_int_vec(inDat));
147 outDat = inDatConv * scale;
150 __vpred vpred = c7x::strm_agen<0, vecOut>::get_vpred();
151 vecOut *addr = c7x::strm_agen<0, vecOut>::get_adv(pOutLocal);
152 __vstore_pred(vpred, addr, outDat);
158 typedef typename c7x::long_vec vecLoad;
159 typedef typename c7x::make_full_vector<double>::type vecOut;
160 int32_t eleCount = c7x::element_count_of<vecOut>::value;
161 vecOut outDat, scale;
163 scale = (vecOut) (1.0 / 32768);
165 for (int32_t counter = 0; counter < blockSize; counter += eleCount) {
166 vecLoad inDat = c7x::strm_eng<0, vecLoad>::get_adv();
167 vecOut inDatConv = __low_int_to_double(c7x::as_int_vec(inDat));
168 outDat = inDatConv * scale;
171 __vpred vpred = c7x::strm_agen<0, vecOut>::get_vpred();
172 vecOut *addr = c7x::strm_agen<0, vecOut>::get_adv(pOutLocal);
173 __vstore_pred(vpred, addr, outDat);
177 template <
typename dataTypeOut>
183 int32_t blockSize = pKerPrivArgs->
blockSize;
185 __SE_TEMPLATE_v1 se0Params;
186 __SA_TEMPLATE_v1 sa0Params;
188 int16_t *restrict pInLocal = (int16_t *) pIn;
189 dataTypeOut *restrict pOutLocal = (dataTypeOut *) pOut;
191 DSPLIB_DEBUGPRINTFN(0,
"pInLocal: %p pOutLocal: %p blockSize: %d\n", pInLocal, pOutLocal, blockSize);
193 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
197 __SE0_OPEN(pInLocal, se0Params);
198 __SA0_OPEN(sa0Params);
200 q15tofl_convert<dataTypeOut>(pOutLocal, blockSize);
#define SE_SE0_PARAM_OFFSET
#define SE_SA0_PARAM_OFFSET
DSPLIB_STATUS DSPLIB_q15tofl_exec_ci(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main execution function for the C7x implementation of the kernel....
template DSPLIB_STATUS DSPLIB_q15tofl_exec_ci< float >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_q15tofl_init_ci< float >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_q15tofl_InitArgs *pKerInitArgs)
void q15tofl_convert< float >(float *restrict pOutLocal, int32_t blockSize)
__SE_TEMPLATE_v1 q15tofl_se_init(int32_t blockSize)
void q15tofl_convert(dataTypeOut *restrict pOutLocal, int32_t blockSize)
void q15tofl_convert< double >(double *restrict pOutLocal, int32_t blockSize)
template DSPLIB_STATUS DSPLIB_q15tofl_init_ci< double >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_q15tofl_InitArgs *pKerInitArgs)
DSPLIB_STATUS DSPLIB_q15tofl_init_ci(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_q15tofl_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
__SE_TEMPLATE_v1 q15tofl_se_init< float >(int32_t blockSize)
__SE_TEMPLATE_v1 q15tofl_se_init< double >(int32_t blockSize)
template DSPLIB_STATUS DSPLIB_q15tofl_exec_ci< double >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_q15tofl.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
A structure for a 1 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
uint8_t bufPblock[DSPLIB_Q15TOFL_IXX_IXX_OXX_PBLOCK_SIZE]
Buffer to save SE & SA configuration parameters
int32_t blockSize
Size of input buffer for different batches DSPLIB_q15tofl_init that will be retrieved and used by DSP...