NicolaLancellotti commented on code in PR #13815:
URL: https://github.com/apache/tvm/pull/13815#discussion_r1089042287


##########
python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel/multi_channel_convolve.py:
##########
@@ -179,20 +179,26 @@ def _dual_int16_channel_convolve_impl(_tensor_h, 
tensor_w, channels, kernel_h, k
         extern "C"
         #endif
         int32_t {_get_func_name("int16", tensor_w, channels, kernel_h, 
kernel_w, suffix)}(
-            uint32_t *out,
-            uint32_t *tensor,
-            uint32_t *kernel) {{
+            int32_t *out,
+            int16_t *tensor,
+            int16_t *kernel) {{
 
-          uint32_t sum_c0 = 0;
-          uint32_t sum_c1 = 0;
+          int32_t sum_c0 = 0;
+          int32_t sum_c1 = 0;
+
+          int32_t kernel_i32[{kernel_h} * {kernel_w}];
+          memcpy(kernel_i32, kernel, {kernel_h} * {kernel_w} * 
sizeof(int32_t));

Review Comment:
   Hi Gavin, this is a functional change to remove the type punning error.  So 
performance can be worse.
   But, it is not right to rely on undefined behaviours to have better 
performance.
   Do you know any other way to address this undefined behaviour, without the 
`memcpy`s?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to