Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: veclib and LAPACK



On Jan 28, 2004, at 10:01 PM, email@hidden wrote:

Message: 7 From: Dallas Trinkle <email@hidden> Date: Wed, 28 Jan 2004 15:39:15 -0500 To: email@hidden Subject: Re: veclib and LAPACK

On Dec 16, 2003, at 10:01 PM, email@hidden wrote:
We're studying the options now.  [re: xlf and vecLib incompatibility]
This kind of thing wants to be addressed *really* carefully,
correctness wins over urgency IMO.

SCP

I know this is an "old" topic, but I just ran across the problem of xlf's passing of complex types differing from what vecLib is expecting; thanks to the archives, I confirmed my suspicions.

  However, I had two questions:

1. Is apple still considering either a new xlf compatible wrapper for the
complex BLAS libraries? If so, any idea when?

Just four Level 1 BLAS functions are at issue: CDOTC, CDOTU, ZDOTC, and ZDOTU. Each returns a COMPLEX (or DOUBLE COMPLEX) value. When xlf compiles a function invocation into a call to one of these routines, it expects to find the *return* value in the floating point register file. When g77 compiles a function invocation into a call to one of these routines, it expects to find the return value in a pre-allocated *memory* location. The vecLib implementation of these four functions is compatible with the g77 scheme, but not the xlf scheme.


xlf codes may incorporate the following "wrappers" that re-implement CDOTC, CDOTU, ZDOTC, and ZDOTU in terms of a utility *subroutine* already present in vecLib. There is no ABI conflict in the call/return scheme for these vecLib subroutines with xlf. It is crucial though, that the same compiler, e.g. xlf, compile the caller to these replacements as well as the replacements themselves so that the *function* return ABI matches. The utility subroutines (cblas_*_sub) are fully optimized for PowerPC.

!
! scp% /opt/ibmcmp/xlf/8.1/bin/xlf95 -o xlfabi xlfabi.f -Wl,-framework -Wl,vecLib
! ** abitest === End of Compilation 1 ===
! ** zdotc === End of Compilation 2 ===
! ** zdotu === End of Compilation 3 ===
! ** cdotc === End of Compilation 4 ===
! ** cdotu === End of Compilation 5 ===
! 1501-510 Compilation successful for file xlfabi.f.
! scp% ./xlfabi
! (0.000000000000000000E+00,-2.00000000000000000)
! (2.00000000000000000,0.000000000000000000E+00)
! (0.0000000000E+00,-2.000000000)
! (2.000000000,0.0000000000E+00)


        program abitest
        double complex zx(1), zy(1), ztemp
        double complex zdotc, zdotu
        complex cx(1), cy(1), ctemp
        complex cdotc, cdotu

        zx(1)=(1.0, 1.0)
        zy(1)=(1.0, -1.0)

        ztemp = zdotc(1, zx, 1, zy, 1)
        print *, ztemp

        ztemp = zdotu(1, zx, 1, zy, 1)
        print *, ztemp

        cx(1)=(1.0, 1.0)
        cy(1)=(1.0, -1.0)

        ctemp = cdotc(1, cx, 1, cy, 1)
        print *, ctemp

        ctemp = cdotu(1, cx, 1, cy, 1)
        print *, ctemp

        stop
        end

        double complex function zdotc(n, zx, incx, zy, incy)
        double complex zx(*), zy(*), z
        integer n, incx, incy

        call cblas_zdotc_sub(%val(n), zx, %val(incx), zy, %val(incy), z)

        zdotc = z
        return
        end

        double complex function zdotu(n, zx, incx, zy, incy)
        double complex zx(*), zy(*), z
        integer n, incx, incy

        call cblas_zdotu_sub(%val(n), zx, %val(incx), zy, %val(incy), z)

        zdotu = z
        return
        end

        complex function cdotc(n, cx, incx, cy, incy)
        complex cx(*), cy(*), c
        integer n, incx, incy

        call cblas_cdotc_sub(%val(n), cx, %val(incx), cy, %val(incy), c)

        cdotc = c
        return
        end

        complex function cdotu(n, cx, incx, cy, incy)
        complex cx(*), cy(*), c
        integer n, incx, incy

        call cblas_cdotu_sub(%val(n), cx, %val(incx), cy, %val(incy), c)

        cdotu = c
        return
        end

SCP
--
Steve Peters
Numerics and Vectorization
Apple Computer, Inc.


-- Steve Peters Phone: (408) 974-3242 Apple Computer, Inc. Fax: (408) 974-8986 1 Infinite Loop, MS 302-4K Cell: (408) 568-4133 Cupertino, CA 95014 _______________________________________________ scitech mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.