|
Ublas : |
Subject: Re: [ublas] [bindings] New traits system
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-01-11 08:52:53
Thomas Klimpel wrote:
> The behavior of MKL is quite consistent with almost all other lapack
> driver subroutines, in that the size of workspace arrays that don't have
> an explicit size argument (LWORK, LRWORK or LIWORK) for the subroutine
> call doesn't get computed by the optimal workspace query.
>
> So the fix would be that lapack_generator.py would only query for sizes of
> workspace arrays that have an explicit size argument for the subroutine
> call, and use min_workspace for the others. I'm not even sure whether
> there is any lapack driver subroutine that has an LRWORK or LIWORK
> argument for the subroutine call, so it might well be that using
> min_workspace for LRWORK and LIWORK is always the right thing to do.
>
This functionality is already present in the generator.
If you look at the documentation of sgelsd.f, it is explicitly mentioned
that the minimum size of IWORK will be returned. I guess it is not... If the
generator would use dgelsd.f as leading for the real case of gelsd (where
it's not mentioned), it would already have worked.
The generator just looked for arguments mentioned in the documentation
describing the workspace query stuff. I had to add a piece that tries to
disprove this finding and reject workspace-arrays that are associated with
minimum sizes.
I've updated the generator and committed the updated gelsd.
As for your curiosity, yes there are (e.g., stevd). Passing two '-1''s for
workspace queries.
Cheers,
Rutger