Skip to content

ARMV7 (with hard float flag) did not run with correct result  #1145

Open
@gangm

Description

@gangm

hello,

Resently, we are using openblas to setup caffe env in our ARMv7 platform, but we got a problem when run openblas with hard float flag.
we compiled the openblas used following command:
       make CC=arm-linux-gnueabihf-gcc FC=arm-linux-gnueabihf-gfortran HOSTCC=gcc TARGET=ARMV7 libs

then we had a simple test used following code:
int main()

{

const enum CBLAS_ORDER Order=CblasRowMajor;
const enum CBLAS_TRANSPOSE TransA=CblasNoTrans;
const enum CBLAS_TRANSPOSE TransB=CblasNoTrans;
const int M=4;
const int N=2;
const int K=3;
const float alpha=1;
const float beta=0;
const int lda=K;
const int ldb=N;
const int ldc=N;
const float A[M*K]={1.123434543534,2.33234241365,3.4534545454,4.45435435345,5.454554545,6.45452345345,7.454545465,8.454545245,9.2345245625,8.45234545,7.423564545,6.425452454};
const float B[K*N]={5.4523452345,4.34526547,3.462354544,2.52436254,1.262565262,0.265364564565};
float C[M*N];

cblas_sgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
for (int i = 0; i < M; i++)
{
    for (int j = 0; j < N; j++)
    {
        cout << C[i*M + j] << " ";
    }
    cout << endl;
}
}    

return EXIT_SUCCESS;
}

testing code compling command:
arm-linux-gnueabihf-g++ -mfpu=vfpv3 -mfloat-abi=hard -o test testblas.cpp /usr/local/arm/openblas/lib/libopenblas_armv7p-r0.2.20.dev.a -I/usr/local/arm/boost/include/ -lpthread

but, when we run the test code in our ARMv7 platform, we got a strange result, as below:
1.4013e-45 1.4013e-45
1.4013e-45 1.4013e-45
1.4013e-45 1.4013e-45
1.4013e-45 1.4013e-45

it is not the correct result...

when we used the openblas lib in our caffe code, it caused coredump when called openblas APIs.

can you help for this? thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions