]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-machine-learning/ti-machine-learning.git/blobdiff - src/common/util/timlUtilConv2ImageReshape.c
1. Enable network state write/read
[ti-machine-learning/ti-machine-learning.git] / src / common / util / timlUtilConv2ImageReshape.c
index dadcfa436c97b0c3f75f69f6a125a41a8047b569..b9de4281e5f9b5a623fdebb9e56659d9fcf76237 100644 (file)
  ******************************************************************************/\r
 \r
 #include "../api/timl.h"\r
-#ifdef TIML_ALT\r
+#ifdef TIML_CPU_ALT\r
 #include "../../alt/timlAlt.h"\r
+#elif defined TIML_ARM_DSP\r
+#include "../../dsp/timlDSP.h"\r
 #endif\r
 \r
 \r
@@ -54,7 +56,7 @@
  * \param[out] xReshape Reshaped feature map\r
  * \param[in]  x        Feature map\r
  * \param[in]  index    Reshaping index matrix\r
- * \param[in]  channel  The number of channels in the feature maps\r
+ * \param[in]  xNum     The number of feature maps\r
  * \param[in]  xDim     Dimension of the feature map (row*col)\r
  * \param[in]  indexDim Dimension of the index matrix\r
  * \param[in]  deviceId Device id\r
  */\r
 /******************************************************************************/\r
 \r
-int timlUtilConv2ImageReshape(float* xReshape, float* x, int *index, int channel, int xDim, int indexDim, int deviceId, int threadId)\r
+int timlUtilConv2ImageReshape(float* xReshape, float* x, int *index, int xNum, int xDim, int indexDim, int deviceId, int threadId)\r
 {\r
-#ifdef TIML_CPU\r
+#ifdef TIML_CPU_ALT\r
+   return timlUtilConv2ImageReshapeAlt(xReshape, x, index, xNum, xDim, indexDim, deviceId, threadId);\r
+#else\r
    int j;\r
    int p;\r
-   for (j = 0; j < channel; j++) {\r
+   for (j = 0; j < xNum; j++) {\r
       for (p = 0; p < indexDim; p++) {\r
          if (index[p] != -1) {\r
-            xReshape[p + j * indexDim] = x[index[p] + j * xDim];\r
+            xReshape[p + j*indexDim] = x[index[p] + j*xDim];\r
          }\r
          else {\r
-            xReshape[p + j * indexDim] = 0.0;\r
+            xReshape[p + j*indexDim] = 0.0;\r
          }\r
       }\r
    }\r
-\r
    return 0;\r
-#elif defined TIML_ALT\r
-   return timlUtilConv2ImageReshapeAlt(xReshape, x, index, channel, xDim, indexDim, deviceId, threadId);\r
+\r
 #endif\r
 }\r