48 #define SE_PARAM_BASE (0x0000)
49 #define SE0_PARAM_OFFSET (SE_PARAM_BASE)
50 #define SA0_PARAM_OFFSET (SE0_PARAM_OFFSET + VXLIB_SE_PARAM_SIZE)
60 template <u
int32_t dTypeIn, u
int32_t dTypeOut>
72 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
73 __SA_TEMPLATE_v1 sa0Params = __gen_SA_TEMPLATE_v1();
75 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
78 pKerPrivArgs->
numBlocks = VXLIB_SE0SA0_init<dTypeIn, dTypeIn>(&se0Params, &sa0Params, bufParamsIn, bufParamsOut);
125 template <
typename dTypeIn,
typename dTypeOut>
129 void *restrict pThresholdVal,
130 void *restrict pTrueVal,
131 void *restrict pFalseVal)
139 dTypeIn *restrict pInLocal = (dTypeIn *) pIn;
140 dTypeOut *restrict pOutLocal = (dTypeOut *) pOut;
142 dTypeIn *restrict pThresholdValLocal = (dTypeIn *) pThresholdVal;
143 dTypeIn *restrict pTrueValLocal = (dTypeIn *) pTrueVal;
144 dTypeIn *restrict pFalseValLocal = (dTypeIn *) pFalseVal;
147 printf(
"Enter VXLIB_Thresholdbinary_exec_ci\n");
151 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
154 __SE_TEMPLATE_v1 se0Params = *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SE0_PARAM_OFFSET);
155 __SA_TEMPLATE_v1 sa0Params = *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SA0_PARAM_OFFSET);
157 __SE0_OPEN(pInLocal, se0Params);
159 __SA0_OPEN(sa0Params);
162 typedef typename c7x::make_full_vector<dTypeIn>::type vec;
164 vec vThreshold = (vec) *pThresholdValLocal;
165 vec vTrue = (vec) *pTrueValLocal;
166 vec vFalse = (vec) *pFalseValLocal;
168 for (uint32_t counter = 0; counter < size; counter++) {
170 vec a = c7x::strm_eng<0, vec>::get_adv();
172 __vpred vPred = __cmp_gt_pred(a, vThreshold);
173 vec vout = __select(vPred, vTrue, vFalse);
176 __vpred tmp = c7x::strm_agen<0, vec>::get_vpred();
177 vec * addr = c7x::strm_agen<0, vec>::get_adv(pOutLocal);
178 __vstore_pred(tmp, addr, vout);
197 void *restrict pThresholdVal,
198 void *restrict pTrueVal,
199 void *restrict pFalseVal);
205 void *restrict pThresholdVal,
206 void *restrict pTrueVal,
207 void *restrict pFalseVal);
213 void *restrict pThresholdVal,
214 void *restrict pTrueVal,
215 void *restrict pFalseVal);
221 void *restrict pThresholdVal,
222 void *restrict pTrueVal,
223 void *restrict pFalseVal);
241 size_t numBlocks = pKerPrivArgs->
numBlocks;
242 size_t overheadCnt = 44;
243 *archCycles = 2 + numBlocks * 1;
244 *estCycles = overheadCnt + *archCycles;
VXLIB_STATUS VXLIB_thresholdBinary_init_ci(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
VXLIB_STATUS VXLIB_thresholdBinary_exec_ci(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
This function is the main execution function for the C7x implementation of the kernel....
template VXLIB_STATUS VXLIB_thresholdBinary_init_ci< VXLIB_THRESHOLDBINARY_DTYPE_I8U_O8U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdBinary_init_ci< VXLIB_THRESHOLDBINARY_DTYPE_I16S_O16S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdBinary_init_ci< VXLIB_THRESHOLDBINARY_DTYPE_I16U_O16U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdBinary_exec_ci< VXLIB_THRESHOLDBINARY_TYPENAME_I16U_O16U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
template VXLIB_STATUS VXLIB_thresholdBinary_exec_ci< VXLIB_THRESHOLDBINARY_TYPENAME_I16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
template VXLIB_STATUS VXLIB_thresholdBinary_init_ci< VXLIB_THRESHOLDBINARY_DTYPE_I8S_O8S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdBinary_exec_ci< VXLIB_THRESHOLDBINARY_TYPENAME_I8U_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
template VXLIB_STATUS VXLIB_thresholdBinary_exec_ci< VXLIB_THRESHOLDBINARY_TYPENAME_I8S_O8S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_thresholdBinary.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
void VXLIB_thresholdBinary_perfEst(VXLIB_kernelHandle handle, size_t *archCycles, size_t *estCycles)
This function estimates the archCycles and estCycles.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
size_t numBlocks
Number of blocks to be processed after simidfication.
uint8_t bufPblock[VXLIB_THRESHOLDBINARY_IXX_OXX_PBLOCK_SIZE]
Array to hold SE/SA params.