Boost logo

Ublas :

Subject: Re: [ublas] LAPACK/BLAS bindings
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-06-07 09:31:25


Peter Man wrote:

>
> The problem: for the netlib-lapack, no problem. For the ATLAS case, in
> step 2, the clapack getri function is called, in step 3, a zero-sized
> workspace is created but
> in step 4, exactly the same clapack getri would be called AGAIN, except
> that the boost_assert catches that the workspace is too small
> since it's zero-sized.
>

The getri stuff, now I remember. ATLAS-clapack doesn't even use the work or
lwork parameter. In order to keep the code re-compilable against multiple
backends, we can not drop the workspace argument from the free functions
and/or invoke member functions (we could turn these classes into functors at
some point).

What you propose sounds like a good idea to me, perhaps we could take it a
bit further,

* put the #ifndef stuff around the full minimal/optimal workspace invoke
functions
* make the last argument of the custom invoke function just "Workspace" (not
demanding a workspace1)
* put an #ifndef around the assert like you suggest; in case of lapack,
static assert that the workspace is a workspace1 (perhaps not that
important)
* further, make 2 different return calls, so that detail::getri is called
with fewer arguments and/or with 0/0 as last arguments.

I'll see if I can dig through the generator code a bit to see how this can
be integrated most easily.

Cheers,

Rutger