Skip to content

Commit

Permalink
fix vs array problems
Browse files Browse the repository at this point in the history
  • Loading branch information
meiqua committed May 24, 2020
1 parent f86b8e2 commit 029fd50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ELSE()
ENDIF()

# SET(PLATFORM_COMPILE_FLAGS "-DMIPP_NO_INTRINSICS") # close SIMD
SET(COMMON_COMPILE_FLAGS "-fopenmp -Wall -Wno-sign-compare") # -fno-strict-aliasing
SET(COMMON_COMPILE_FLAGS "-fopenmp") # -fno-strict-aliasing
SET(CMAKE_CXX_FLAGS "${PLATFORM_COMPILE_FLAGS} ${COMMON_COMPILE_FLAGS} $ENV{CXXFLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
Expand Down
25 changes: 13 additions & 12 deletions fusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ class Gauss5x1Node_32S_16S_4bit_smaller : public FilterNode {
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

int32_t* parent_buf_ptr[gauss_size];
int32_t** parent_buf_center = parent_buf_ptr + gauss_size/2;
std::vector<int32_t*> parent_buf_ptr(gauss_size);
int32_t** parent_buf_center = &parent_buf_ptr[gauss_size/2];
parent_buf_center[0] = in_headers[0].ptr<int32_t>(r, c);
for(int i=1; i<=gauss_size/2; i++){
parent_buf_center[i] = in_headers[0].ptr<int32_t>(r+i, c);
Expand Down Expand Up @@ -251,8 +251,8 @@ class Gauss5x1Node_32S_16S_4bit_smaller : public FilterNode {
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

int32_t* parent_buf_ptr[gauss_size];
int32_t** parent_buf_center = parent_buf_ptr + gauss_size/2;
std::vector<int32_t*> parent_buf_ptr(gauss_size);
int32_t** parent_buf_center = &parent_buf_ptr[gauss_size/2];
parent_buf_center[0] = in_headers[0].ptr<int32_t>(r, c);
for(int i=1; i<=gauss_size/2; i++){
parent_buf_center[i] = in_headers[0].ptr<int32_t>(r+i, c);
Expand Down Expand Up @@ -328,8 +328,8 @@ class Gauss5x1withPyrdownNode_32S_16S_4bit_smaller : public FilterNode {
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

int32_t* parent_buf_ptr[gauss_size];
int32_t** parent_buf_center = parent_buf_ptr + gauss_size/2;
std::vector<int32_t*> parent_buf_ptr(gauss_size);
int32_t** parent_buf_center = &parent_buf_ptr[gauss_size/2];
parent_buf_center[0] = in_headers[0].ptr<int32_t>(r, c);
for(int i=1; i<=gauss_size/2; i++){
parent_buf_center[i] = in_headers[0].ptr<int32_t>(r+i, c);
Expand Down Expand Up @@ -372,8 +372,8 @@ class Gauss5x1withPyrdownNode_32S_16S_4bit_smaller : public FilterNode {
int c = start_c;
int16_t *buf_ptr = out_headers[0].ptr<int16_t>(r - op_row/2, c - op_col/2);

int32_t* parent_buf_ptr[gauss_size];
int32_t** parent_buf_center = parent_buf_ptr + gauss_size/2;
std::vector<int32_t*> parent_buf_ptr(gauss_size);
int32_t** parent_buf_center = &parent_buf_ptr[gauss_size/2];
parent_buf_center[0] = in_headers[0].ptr<int32_t>(r, c);
for(int i=1; i<=gauss_size/2; i++){
parent_buf_center[i] = in_headers[0].ptr<int32_t>(r+i, c);
Expand Down Expand Up @@ -1035,8 +1035,9 @@ class Spreadnx1Node_8U_8U : public FilterNode {
void update_simple(int start_r, int start_c, int end_r, int end_c) override {
for(int r = start_r; r < end_r; r++){
int c = start_c;
uint8_t *parent_buf_ptr[op_row];
uint8_t** parent_buf_ptr_center = parent_buf_ptr + op_row/2;

std::vector<uint8_t*> parent_buf_ptr(op_row);
uint8_t** parent_buf_ptr_center = &parent_buf_ptr[op_row/2];
parent_buf_ptr_center[0] = in_headers[0].ptr<uint8_t>(r, c);
for(int i=1; i<=op_row/2; i++){
parent_buf_ptr_center[+i] = in_headers[0].ptr<uint8_t>(r+i, c);
Expand All @@ -1060,8 +1061,8 @@ class Spreadnx1Node_8U_8U : public FilterNode {
const int simd_step = mipp::N<int8_t>();
for(int r = start_r; r < end_r; r++){
int c = start_c;
uint8_t *parent_buf_ptr[op_row];
uint8_t** parent_buf_ptr_center = parent_buf_ptr + op_row/2;
std::vector<uint8_t*> parent_buf_ptr(op_row);
uint8_t** parent_buf_ptr_center = &parent_buf_ptr[op_row/2];
parent_buf_ptr_center[0] = in_headers[0].ptr<uint8_t>(r, c);
for(int i=1; i<=op_row/2; i++){
parent_buf_ptr_center[+i] = in_headers[0].ptr<uint8_t>(r+i, c);
Expand Down

0 comments on commit 029fd50

Please sign in to comment.