|Re: [eigen] No vectorization in presence of .cast<T>() calls|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] No vectorization in presence of .cast<T>() calls
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Fri, 17 Dec 2010 09:58:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=asZcE73zbOrf3IP/lpSQIexwg6dUg5X+zDi4SGaNQUE=; b=qxu8wM+F+mPIoztV332XUIuhYiN38QHuEEmITEbsFi/OTyeiakj/xhiZ+YbEl0qbLB FMAXbMV5WST9sFpFFTnGkrJs6NozjGJUzaYYi5dJvmghlLreDEJbSdUPNMdfVpKsAzXF AzF7dcNdtzQ//UFvVPDIwLc46w3NC9RWV4NaA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=w4btujEZGurH7h0FTzDHPxrGC/gQuEHZhTCMIiCg80dv+6WGg+vp62ACC4rgyw9tV4 nO4e4Egi9epY9+ITVhLpjdLW0NDcvxr7qumUxmgixjsxONu510eFfmET5f0qAdq8Cl7X yeU3Q+YpPfgy4NJS1jjpvVJCgLGwEOUtWaOd4=
On Fri, Dec 17, 2010 at 9:48 AM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
I think you need to mark the map as aligned (if it is aligned).
Besides that, wouldn't it be useful sometimes, if non-aligned data get's
also vectorized, e.g. if the load-overhead is smaller than the
performance gain? (Or is there some kind of cast possible already?)
No no, that is not the issue. It does not matter whether the map is aligned or not. The advantage of aligned maps is that it is possible to use aligned loads which are much faster than the unaligned ones. It does not affect vectorization itself.
For the moment I am just changing the code to
MatrixXf od_full = img_mat.cast<float>();
od_full = - std::log( od_full.array() / 255.0f + std::numeric_limits<float>::epsilon() );
which leads to no additional temporary and vectorization in the second line.