ACML
From Vd
AMD Core Math Library (ACML)
AMD Core Math Library (ACML) ACML consists of the following main components:
- A full implementation of Level 1, 2 and 3 Basic Linear Algebra Subroutines (BLAS), with key routines optimized for high performance on AMD Opteron™ processors.
- A full suite of Linear Algebra (LAPACK) routines. As well as taking advantage of the highly-tuned BLAS kernels, a key set of LAPACK routines has been further optimized to achieve considerably higher performance than standard LAPACK implementations.
- A comprehensive suite of Fast Fourier Transforms (FFTs) in both single-, double-, single-complex and double-complex data types.
- Fast scalar, vector, and array math transcendental library routines optimized for high performance on AMD Opteron processors.
- Random Number Generators in both single- and double-precision.
Documentation can be found at : ACML User Guide.
To link with the library the lib files can be found at /site/acml/ where you will find versions for different compilers. An example of a link line is : pathf90 -o dgbtim dgbtim.o /site/acml/pathscale64/lib/libacml.a
ACML is a versatile library that is a good first choice for mathematical functions. Generally this library yield the best performance for a general math kernel library.
There is an incompatibility with the currently (21Jan08) installed gfortran4 and acml for gfortran. This might yield missing symbols when linking.
How to use
The matrix routines can be used as follows:
g77 -o dgemm-test.x -L/site/acml/gnu64/lib/ dgemm-test.f -lacml -lacml_mv
program dgemmtest
C
parameter(N=100)
C
double precision a, b , c, alpha, beta
dimension a(N,N), b(N,N), c(N,N)
integer i,j
C
C Init matrices
C
do i=1,N
do j=1,N
a(j,i)=rand(0)
b(j,i)=rand(0)
enddo
enddo
C
write(*,*) a(1,1),a(N,N), b(1,1),b(N,N)
alpha = 1.0
beta = 1.0
C
call dgemm('n', 'n', N, N, N, alpha, a, N, b, N, beta, c, N)
C
write(*,*) c(1,1), c(N,N)
C
end
pathf90 -o fft-test.x -intrinsic=PGI -L/site/acml/pathscale64/lib/ fft-test.f -lacml
program ffttest
c
parameter (N=4)
double complex a, comm
dimension a(N), comm(5*N+100)
integer i, info
c
do i=1,N
a(i)=cmplx(rand(0),rand(0))
enddo
c
write(*,110) a
c
call cfft1d(-2, N, a, comm, info)
c
write(*,110) a
c
110 format(8(f6.2))
c
end
It might be neccecery to set the LD_LIBRARY_PATH to /site/acml/<compiler>/lib/ in order to resolve the link path.
A testrun with a vector length N=100000000 took 19.03 seconds, this is almost twice as fast as FFTW.