8 Replies Latest reply on Jun 26, 2014 4:24 PM by shane_story

    Integer division by zero exception in dgemm


      Getting the following integer division by zero exception:


      First-chance exception at 0x000007FEE0AE19C2 (libacml_dll.dll) in vcproj_test.exe: 0xC0000094: Integer division by zero


      when calling (from C code)


      dgemm('N', 'T', 16, 16, 4096, 1.0, <16 x 4096 matrix>, 16, <16 x 4096 matrix>, 16, 0, <16 x 16 matrix>, 16);


      The setup is acml5.3.1\ifort64 on Win 7 pro 64 bit, Visual Studio 2013, Intel Core i7-4702HQ Processor. I also tried the PGI version of ACML 5.3.1, but shows the same error...

        • Re: Integer division by zero exception in dgemm

          Do you have the ability to post repro code; from initializing your data to the acml call?

            • Re: Integer division by zero exception in dgemm

              Yes, even simply setting all entries to zero reproduces the exception:


              #include <acml.h>

              #include <stdlib.h>



              int main()


                  const int m = 16;

                  const int n = 16;

                  const int k = 4096;


                  // matrices are stored in column-major order

                  double *A = calloc(m * k, sizeof(double));

                  double *B = calloc(k * n, sizeof(double));

                  double *C = calloc(m * n, sizeof(double));


                  // C = A*B

                  dgemm('N', 'N', m, n, k, 1.0, A, m, B, k, 0.0, C, m);

                  // Unhandled exception at 0x000007FEE4B719C2 (libacml_dll.dll) in vcproj2013.exe: 0xC0000094: Integer division by zero.


                  // clean up





                  return 0;



              The command line options to compile the program under Visual C 2013 are


              /GS /W3 /Zc:wchar_t /Zi /Gm /Od /Fd"x64\Debug\vc120.pdb" /fp:precise /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\vcproj2013.pch"