From 656c75150574e204c968e89de94529b3f638cfe0 Mon Sep 17 00:00:00 2001 From: jeffry1829 Date: Sun, 28 Jan 2024 12:51:35 +0800 Subject: [PATCH] fix-OMP compile issue --- src/backend/utils_internal_cpu/Movemem_cpu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/utils_internal_cpu/Movemem_cpu.cpp b/src/backend/utils_internal_cpu/Movemem_cpu.cpp index c6799530..983a12b9 100644 --- a/src/backend/utils_internal_cpu/Movemem_cpu.cpp +++ b/src/backend/utils_internal_cpu/Movemem_cpu.cpp @@ -85,8 +85,10 @@ namespace cytnx { newshape[i] = old_shape[mapper[i]]; } std::vector shifter_new(old_shape.size()); + std::vector shifter_old(old_shape.size()); for (cytnx_int64 i = old_shape.size() - 1; i >= 0; i--) { + shifter_old[i] = accu_old; shifter_new[i] = accu_new; accu_old *= old_shape[i]; accu_new *= newshape[i]; @@ -227,8 +229,10 @@ namespace cytnx { newshape[i] = old_shape[mapper[i]]; } std::vector shifter_new(old_shape.size()); + std::vector shifter_old(old_shape.size()); for (cytnx_int64 i = old_shape.size() - 1; i >= 0; i--) { + shifter_old[i] = accu_old; shifter_new[i] = accu_new; accu_old *= old_shape[i]; accu_new *= newshape[i]; @@ -370,8 +374,10 @@ namespace cytnx { newshape[i] = old_shape[mapper[i]]; } std::vector shifter_new(old_shape.size()); + std::vector shifter_old(old_shape.size()); for (cytnx_int64 i = old_shape.size() - 1; i >= 0; i--) { + shifter_old[i] = accu_old; shifter_new[i] = accu_new; accu_old *= old_shape[i]; accu_new *= newshape[i]; @@ -512,8 +518,10 @@ namespace cytnx { newshape[i] = old_shape[mapper[i]]; } std::vector shifter_new(old_shape.size()); + std::vector shifter_old(old_shape.size()); for (cytnx_int64 i = old_shape.size() - 1; i >= 0; i--) { + shifter_old[i] = accu_old; shifter_new[i] = accu_new; accu_old *= old_shape[i]; accu_new *= newshape[i];