[vsipl++] ATLAS undefines
Jules Bergmann
jules at codesourcery.com
Thu Jun 1 01:27:13 UTC 2006
Assem,
To follow up on our IRC discussion, I was mistaken in my earlier email
below.
The BLAS provided in clapack/BLAS/SRC is a C implementation of the
Fortran BLAS API.
I.e. the cdotu it provides looks like this from C/C++
void cdotu(complex<float>* return_value,
int* n,
complex<float>* cx, int* incx,
complex<float>* cy, int* incy);
versus cblas_cdotu_sub, which would look like:
void cblas_cdotu_sub(
int n,
complex<float>* cx, int incx,
complex<float>* cy, int incy,
complex<float>* return_value);
(or more accurately, void* instead of complex<float>* because C doesn't
have complex<float> or complex when the API was created).
What we want to do is add a new way to configure VSIPL++ so that it uses
the Fortran BLAS provided in clapack/BLAS/SRC and the Lapack provided in
clapack/SRC.
The easiest way to do this is to have configure define
VSIP_IMPL_USE_CBLAS to 0 when using CLAPACK's BLAS.
We don't want to break the way VSIPL++ works when it gets configured to
use ATLAS (or MKL or ACML for that matter). I.e. when using ATLAS, we
should continue to have configure define VSIP_IMPL_USE_CBLAS to 1.
Moreover, we don't want to try to use clapack/BLAS/SRC's blaswrap.h to
abstract the difference between the Fortran and C BLAS APIs.
-- Jules
Jules Bergmann wrote:
> Assem,
>
> Thanks for posting this.
>
> It looks like we're trying to use the CBLAS bindings for
> CLAPACK/SRC/BLAS. Unfortunately, looking at the source, it is a Fortran
> API, with a few variances (the complex dot-product Fortran functions
> have been converted to C "subroutines" that return the result by
> reference). I suspect if you tried to build other tests you would see
> linker errors for functions like cblas_trsm, etc.
>
> For this, we should take an approach similar to how we handled ACML:
>
> - Have configure define VSIP_IMPL_USE_CBLAS = 4 when using
> CLAPACK/SRC/BLAS
>
> - In lapack.hpp, when VSIP_IMPL_USE_CBLAS == 4,
> - wrap the dot-product functions to have a CBLAS interface and
> define VSIP_IMPL_USE_CBLAS_DOT = 1.
>
> This should be done in a separate header file, similar to
> acml_cblas.hpp.
>
> - Use Fotran API for other BLAS functions
> (VSIP_IMPL_USE_CBLAS_OTHER = 0).
>
> Does that sound OK?
>
> -- Jules
>
> Assem Salama wrote:
>> Everyone,
>> As per Jule's request, this is the output of make when trying to
>> compile convolution.cpp in the tests dir. The BLAS that I got with
>> CLAPACK has functions similar to these but without the cblas prepended
>> and without _sub.
>>
>> Thanks,
>> Assem Salama
>>
>>
>> ------------------------------------------------------------------------
>>
>> g++ -g -O2 -I../src -I/drive2/assem/work/checkout/vpp/tests/../src
>> -I/include/atlas -I/include/fftw3
>> -I/drive2/assem/work/checkout/vpp/vendor/atlas/include
>> -I/drive2/assem/work/build/vpp_temp2/vendor/fftw/include -o
>> convolution.exe convolution.o -L/lib/atlas -L/lib/fftw3
>> -L/drive2/assem/work/build/vpp_temp2/vendor/atlas/lib
>> -L/drive2/assem/work/build/vpp_temp2/vendor/fftw/lib
>> -L/drive2/assem/work/build/vpp_temp2/vendor/clapack
>> -L/drive2/assem/work/build/vpp_temp2/lib -L../src/vsip -lvsip -llapack
>> -lF77 -lcblas -lfftw3f -lfftw3 -lfftw3l || rm -f convolution.exe
>> convolution.o: In function `dot':
>> /drive2/assem/work/checkout/vpp/tests/../src/vsip/impl/lapack.hpp:180:
>> undefined reference to `cblas_ddot'
>> /drive2/assem/work/checkout/vpp/tests/../src/vsip/impl/lapack.hpp:217:
>> undefined reference to `cblas_zdotu_sub'
>> /drive2/assem/work/checkout/vpp/tests/../src/vsip/impl/lapack.hpp:179:
>> undefined reference to `cblas_sdot'
>> /drive2/assem/work/checkout/vpp/tests/../src/vsip/impl/lapack.hpp:216:
>> undefined reference to `cblas_cdotu_sub'
>> collect2: ld returned 1 exit status
>
>
--
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
More information about the vsipl++
mailing list