Skip to content

Commit

Permalink
Revert "Fix bug in Buffer.transpose"
Browse files Browse the repository at this point in the history
  • Loading branch information
petewarden committed Mar 13, 2015
1 parent b6f0d3b commit 375e1ee
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 280 deletions.
4 changes: 2 additions & 2 deletions source/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ LOCAL_C_INCLUDES += ./src/lib/include \
/Users/petewarden/android_ndk/sources/cxx-stl/gnu-libstdc++/4.6/include \
/Users/petewarden/android_ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include

LOCAL_CFLAGS := -DUSE_EIGEN_GEMM -DUSE_NEON -D__MATH_FPABI=0
LOCAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7
LOCAL_CFLAGS := -DUSE_EIGEN_GEMM -DUSE_NEON
LOCAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7

LOCAL_CFLAGS += -fopenmp -O3
LOCAL_LDFLAGS += -fopenmp -llog
Expand Down
2 changes: 1 addition & 1 deletion source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LIBLDLIBS += -lblas
endif

ifeq ($(GEMM),eigen)
LIBCPPFLAGS += -I../eigen -DUSE_EIGEN_GEMM=1 -D__MATH_FPABI=1 -mfloat-abi=hard
LIBCPPFLAGS += -I../eigen -DUSE_EIGEN_GEMM=1
endif

ifeq ($(TARGET),pi)
Expand Down
8 changes: 2 additions & 6 deletions source/src/lib/graph/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,7 @@ void Buffer::transpose() {
const int elementCount = originalDims.elementCount();
const size_t byteCount = (elementCount * bytesPerElement);
void* newDataBytes = malloc(byteCount);

void* oldData = _data;
void* oldQuantizedData = _quantizedData;


if (bitsPerElement == 32) {
jpfloat_t* originalData = _data;
jpfloat_t* newData = (jpfloat_t*)(newDataBytes);
Expand Down Expand Up @@ -588,8 +585,7 @@ void Buffer::transpose() {
}

if (_doesOwnData) {
free(oldData);
free(oldQuantizedData);
free(_data);
}

_dims = newDims;
Expand Down
18 changes: 0 additions & 18 deletions source/src/lib/math/matrix_local_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include <mkl_vml_functions.h>
#endif // USE_MKL_GEMM

#ifdef USE_NEON
#include <math_neon.h>
#endif

#include "buffer.h"

Buffer* matrix_local_response(Buffer* input, int windowSize, jpfloat_t k, jpfloat_t alpha, jpfloat_t beta) {
Expand All @@ -44,7 +40,6 @@ Buffer* matrix_local_response(Buffer* input, int windowSize, jpfloat_t k, jpfloa

const int inputChannels = inputDims[3];


Buffer* magnitude = new Buffer(inputDims);

Buffer* magBuffer = new Buffer(Dimensions(inputChannels));
Expand Down Expand Up @@ -112,19 +107,6 @@ Buffer* matrix_local_response(Buffer* input, int windowSize, jpfloat_t k, jpfloa
vsPow(elementCount, magnitudeData, repeatedBeta, outputData);
free(repeatedBeta);
vsMul(elementCount, inputData, outputData, outputData);
#elif defined(USE_NEON)
while (inputData < inputDataEnd) {

const jpfloat_t inputValue = *inputData;
const jpfloat_t magnitudeValue = *magnitudeData;

jpfloat_t outputValue = (powf_neon(magnitudeValue, -beta) * inputValue);
*outputData = outputValue;

inputData += 1;
magnitudeData += 1;
outputData += 1;
}
#else // USE_ACCELERATE_GEMM
while (inputData < inputDataEnd) {

Expand Down
75 changes: 0 additions & 75 deletions source/src/lib/third_party/math_neon.h

This file was deleted.

178 changes: 0 additions & 178 deletions source/src/lib/third_party/math_powf.cpp

This file was deleted.

0 comments on commit 375e1ee

Please sign in to comment.