DSPLIB User Guide
DSPLIB_mulConstant_cn.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2 **+--------------------------------------------------------------------------+**
3 **| **** |**
4 **| **** |**
5 **| ******o*** |**
6 **| ********_///_**** |**
7 **| ***** /_//_/ **** |**
8 **| ** ** (__/ **** |**
9 **| ********* |**
10 **| **** |**
11 **| *** |**
12 **| |**
13 **| Copyright (c) 2016 Texas Instruments Incorporated |**
14 **| ALL RIGHTS RESERVED |**
15 **| |**
16 **| Permission to use, copy, modify, or distribute this software, |**
17 **| whether in part or in whole, for any purpose is forbidden without |**
18 **| a signed licensing agreement and NDA from Texas Instruments |**
19 **| Incorporated (TI). |**
20 **| |**
21 **| TI makes no representation or warranties with respect to the |**
22 **| performance of this computer program, and specifically disclaims |**
23 **| any responsibility for any damages, special or consequential, |**
24 **| connected with the use of this program. |**
25 **| |**
26 **+--------------------------------------------------------------------------+**
27 *******************************************************************************/
28 
30 
31 template <typename dataType, int32_t dataIn>
33 DSPLIB_mulConstant_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
34 {
36 
38  uint32_t blockSize = pKerPrivArgs->blockSize;
39 
40 #if DSPLIB_DEBUGPRINT
41  printf("Enter DSPLIB_mulConstant_exec_cn\n");
42 #endif
43 
44  dataType *pInLocal1 = (dataType *) pIn1;
45  dataType *pInLocal2 = (dataType *) pIn2;
46  dataType *pOutLocal = (dataType *) pOut;
47 
48 #if DSPLIB_DEBUGPRINT
49  printf("Enter pInLocal1 %p pInLocal2 %p pOut %p\n", pInLocal1, pInLocal2, pOut);
50 #endif
51 
52  dataType a, b, out;
53  a = *pInLocal1;
54 
55  for (int32_t counter = 0; counter < blockSize; counter++) {
56 
57  b = *pInLocal2++;
58 #if DSPLIB_DEBUGPRINT
59  if (counter <= 8)
60  printf("counter %d a %d b %d\n", counter, a, b);
61 #endif
62 
63  out = a * b;
64 #if DSPLIB_DEBUGPRINT
65  if (counter <= 8)
66  printf("counter %d y %d\n", counter, out);
67 #endif
68 
69  *pOutLocal++ = out;
70  }
71  return (status);
72 }
73 
74 // explicit insmulConstanttiation for the different data type versions
76  void *restrict pIn1,
77  void *restrict pIn2,
78  void *restrict pOut);
79 
81  void *restrict pIn1,
82  void *restrict pIn2,
83  void *restrict pOut);
85  void *restrict pIn1,
86  void *restrict pIn2,
87  void *restrict pOut);
89  void *restrict pIn1,
90  void *restrict pIn2,
91  void *restrict pOut);
93  void *restrict pIn1,
94  void *restrict pIn2,
95  void *restrict pOut);
97  void *restrict pIn1,
98  void *restrict pIn2,
99  void *restrict pOut);
101  void *restrict pIn1,
102  void *restrict pIn2,
103  void *restrict pOut);
105  void *restrict pIn1,
106  void *restrict pIn2,
107  void *restrict pOut);
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< float, DSPLIB_FLOAT32 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< uint32_t, DSPLIB_UINT32 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
DSPLIB_STATUS DSPLIB_mulConstant_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< int32_t, DSPLIB_INT32 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< int16_t, DSPLIB_INT16 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< double, DSPLIB_FLOAT64 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< int8_t, DSPLIB_INT8 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< uint8_t, DSPLIB_UINT8 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_mulConstant_exec_cn< uint16_t, DSPLIB_UINT16 >(DSPLIB_kernelHandle handle, void *restrict pIn1, void *restrict pIn2, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_mulConstant.
DSPLIB_STATUS_NAME
The enumeration of all status codes.
Definition: DSPLIB_types.h:151
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Definition: DSPLIB_types.h:172
@ DSPLIB_SUCCESS
Definition: DSPLIB_types.h:152
Structure that is reserved for internal use by the kernel.
int32_t blockSize
Size of input buffer for different batches DSPLIB_mulConstant_init that will be retrieved and used by...