4 Replies Latest reply on Jul 10, 2009 10:26 AM by devilshawk

    ACML in C++



      How I can use ACML in C++? I am using Fedora 9 with gcc 4.3.0, I want to use Lapack, Do you know some reference for its routines? There is something in AMD's page but I don't understand it.


        • ACML in C++

          Use the C versions of ACML.  C code can be called from C++ without any problems, and acml.h already includes the correct extern "C" statements. So you do not need to worry about this.


          You might have trouble with using STL objects as arguments.  I don't think the STL forces data to be contiguious like plain old arrays, which LAPACK and BLAS being built around fortran expect.



          #include <acml.h>




          Should work just as it does in C.



            • ACML in C++

              Or if you do not mind to abide by the terms of the LGPL, you can find a somewhat incomplete template based C++ interface to your favorite standard conforming LAPACK/BLAS implementation at


                • ACML in C++

                  If somebody is using the C++ wrapper lib the location of the gitweb viewer changed to http://git.devilshawk.net . The lib can now easily be downloaded with "git clone git://devilshawk.net/numerics.git" .

                  The library additionally gained some nice features:

                  -) now builds a dynamic lib

                  -) benchmarking test application under tests dir

                  -) Operators +/-/* for things that can be mapped to DGEMM/ZGEMM calls (Beware if it can not be mapped, an exception will be thrown ). Now you can just write:

                  Full<double> A,B,C;

                  C = A * B;

                  in your code and DGEMM will be called

                • ACML in C++

                  I am having trouble using C++ library #include <complex> with ACML. I think the C++ library is supposed to be standard and the #include <acml.h> also defines a 'complex' type/struct so my complier does not like it.

                  I have renamed all complex types in the ACML header COMPLEX_ACML and this allows comiplation (MSVS 2008), however I do not want to have to do this on every release of a new ACML version or get any users of my code to have to do it to there ACML distribution.

                  What other choices do I have?