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>
71 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
72 __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);
126 template <
typename dTypeIn,
typename dTypeOut>
130 void *restrict pUpperVal,
131 void *restrict pLowerVal,
132 void *restrict pTrueVal,
133 void *restrict pFalseVal)
143 printf(
"Enter VXLIB_thresholdRange_exec_ci\n");
147 dTypeIn *restrict pInLocal = (dTypeIn *) pIn;
148 dTypeOut *restrict pOutLocal = (dTypeOut *) pOut;
150 dTypeIn *restrict pUpperValLocal = (dTypeIn *) pUpperVal;
151 dTypeIn *restrict pLowerValLocal = (dTypeIn *) pLowerVal;
152 dTypeIn *restrict pTrueValLocal = (dTypeIn *) pTrueVal;
153 dTypeIn *restrict pFalseValLocal = (dTypeIn *) pFalseVal;
156 printf(
"In VXLIB_thresholdRange_exec_ci, width: %d, height: %d\n", width, height);
159 if (*pLowerValLocal > *pUpperValLocal) {
165 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
168 __SE_TEMPLATE_v1 se0Params = *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SE0_PARAM_OFFSET);
169 __SA_TEMPLATE_v1 sa0Params = *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SA0_PARAM_OFFSET);
171 __SE0_OPEN(pInLocal, se0Params);
173 __SA0_OPEN(sa0Params);
176 typedef typename c7x::make_full_vector<dTypeIn>::type vec;
178 vec vUpper = (vec) *pUpperValLocal;
179 vec vLower = (vec) *pLowerValLocal;
180 vec vTrue = (vec) *pTrueValLocal;
181 vec vFalse = (vec) *pFalseValLocal;
183 for (uint32_t counter = 0; counter < size; counter++) {
185 vec a = c7x::strm_eng<0, vec>::get_adv();
187 __vpred vPred1 = __cmp_gt_pred(a, vUpper);
188 __vpred vPred2 = __cmp_gt_pred(vLower, a);
190 __vpred vPred = __or(vPred1, vPred2);
191 vec vOut = __select(vPred, vFalse, vTrue);
194 __vpred tmp = c7x::strm_agen<0, vec>::get_vpred();
195 vec * addr = c7x::strm_agen<0, vec>::get_adv(pOutLocal);
196 __vstore_pred(tmp, addr, vOut);
215 void *restrict pUpperVal,
216 void *restrict pLowerVal,
217 void *restrict pTrueVal,
218 void *restrict pFalseVal);
222 void *restrict pUpperVal,
223 void *restrict pLowerVal,
224 void *restrict pTrueVal,
225 void *restrict pFalseVal);
230 void *restrict pUpperVal,
231 void *restrict pLowerVal,
232 void *restrict pTrueVal,
233 void *restrict pFalseVal);
238 void *restrict pUpperVal,
239 void *restrict pLowerVal,
240 void *restrict pTrueVal,
241 void *restrict pFalseVal);
257 size_t numBlocks = pKerPrivArgs->
numBlocks;
258 size_t overheadCnt = 53;
259 *archCycles = 3 + numBlocks * 1;
260 *estCycles = overheadCnt + *archCycles;
template VXLIB_STATUS VXLIB_thresholdRange_init_ci< VXLIB_THRESHOLDRANGE_DTYPE_I16U_O16U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdRange_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdRange_init_ci< VXLIB_THRESHOLDRANGE_DTYPE_I16S_O16S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdRange_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdRange_exec_ci< VXLIB_THRESHOLDRANGE_TYPENAME_I16U_O16U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pUpperVal, void *restrict pLowerVal, void *restrict pTrueVal, void *restrict pFalseVal)
template VXLIB_STATUS VXLIB_thresholdRange_exec_ci< VXLIB_THRESHOLDRANGE_TYPENAME_I16S_O16S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pUpperVal, void *restrict pLowerVal, void *restrict pTrueVal, void *restrict pFalseVal)
VXLIB_STATUS VXLIB_thresholdRange_init_ci(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdRange_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
template VXLIB_STATUS VXLIB_thresholdRange_init_ci< VXLIB_THRESHOLDRANGE_DTYPE_I8U_O8U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdRange_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_thresholdRange_exec_ci< VXLIB_THRESHOLDRANGE_TYPENAME_I8U_O8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pUpperVal, void *restrict pLowerVal, void *restrict pTrueVal, void *restrict pFalseVal)
template VXLIB_STATUS VXLIB_thresholdRange_exec_ci< VXLIB_THRESHOLDRANGE_TYPENAME_I8S_O8S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pUpperVal, void *restrict pLowerVal, void *restrict pTrueVal, void *restrict pFalseVal)
VXLIB_STATUS VXLIB_thresholdRange_exec_ci(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pUpperVal, void *restrict pLowerVal, void *restrict pTrueVal, void *restrict pFalseVal)
This function is the main execution function for the C7x implementation of the kernel....
template VXLIB_STATUS VXLIB_thresholdRange_init_ci< VXLIB_THRESHOLDRANGE_DTYPE_I8S_O8S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdRange_InitArgs *pKerInitArgs)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_thresholdRange.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
@ VXLIB_ERR_INVALID_VALUE
void VXLIB_thresholdRange_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.
uint8_t bufPblock[VXLIB_THRESHOLDRANGE_IXX_OXX_PBLOCK_SIZE]
Array to hold SE/SA params.
size_t numBlocks
Number of blocks to be processed after simidfication.