Re: [eigen] Attribute pure/const? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Attribute pure/const?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 25 Mar 2013 17:41:25 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=e9019VSeXqLaiAXFwbUJivOudhheXdOK7KAVO0u2rTI=; b=IYG8iflPUL3rtfsXyH8ZqH5J76UuN9RAXeX9QRYwpqUsazZGuCrW5uwTU+PwmHC244 ge4blY6/ZX6p9IuxdeoLRgA9ZA3Rc0+PGpBukFH8m33Fjm0cQJDfZ0POGiiIofW9geb0 8mvrfsuDA4wkSs02pxsGpKjV/QZcm4x+Zeb6eOll5cWI/BUtIj7/hCck607ixJp9vNwD ND4N4iBHHqpZV+f33Dv5/D3V9ytRvpmj7tMHTNGg0B+AW9KBbFdg2zc96Jjv/6KLkV2h xV99/9BlNIwef94p08EbeRWCDVeWt3yM9V6W3m3gJR2Rn0vqPwtFODjx1PpDB0p3lifJ T3/w==
Hi,
I think such attributes might be useful if the code of the function is
not available when the function is called. Since Eigen is a pure
header library, I think the compiler always has access to this
information.
Moreover, such attributes might apply for double or int, but not for
some custom scalar types.
gael
On Mon, Mar 25, 2013 at 3:51 PM, Rhys Ulerich <rhys.ulerich@xxxxxxxxx> wrote:
> Hi all,
>
> Has anyone played with annotating the Eigen sources with pure and/or
> constant attributes to see if they provide a speedup?
>
> I ask because -Wsuggest-attribute=pure, etc. loves to suggest Eigen
> functions, and because
> http://stackoverflow.com/questions/2798188/pure-const-function-attributes-in-different-compilers
> indicates there's fairly wide compiler support for such annotations.
>
> Thanks,
> Rhys
>
>