[ET Trac] [Einstein Toolkit] #2015: thorn Vectors does not provide a sum() reduction
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Mon Mar 6 16:44:02 CST 2017
#2015: thorn Vectors does not provide a sum() reduction
-------------------------+--------------------------------------------------
Reporter: rhaas | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: Cactus | Version: development version
Keywords: Vectors |
-------------------------+--------------------------------------------------
It would be very useful for some applications (eg interpolation) if thorn
Vectors provided a sum() function similar to the sum() member of
vecmathlib
https://bitbucket.org/eschnett/vecmathlib/src/477f9c85cf111e59a9042f230bb536d0765265fa/vec_avx_double4.h?at=master&fileviewer
=file-view-default#vec_avx_double4.h-537
{{{
real_t sum() const {
// return (*this)[0] + (*this)[1] + (*this)[2] + (*this)[3];
// __m256d x = _mm256_hadd_pd(v, v);
// __m128d xlo = _mm256_extractf128_pd(x, 0);
// __m128d xhi = _mm256_extractf128_pd(x, 1);
realvec_t x = *this;
x = _mm256_hadd_pd(x.v, x.v);
return x[0] + x[2];
}
}}}
Most likely one can just copy and paste the code from vecmathlib.
vecmathlib's license is not LGPL but permissive enough for inclusion and
we can also ask Erik if one can use it and change the license of the
affected code lines to LGPL in Cactus, the license is here:
https://bitbucket.org/eschnett/vecmathlib/src/477f9c85cf111e59a9042f230bb536d0765265fa/LICENCE?at=master&fileviewer
=file-view-default
{{{
Copyright (c) 2012, 2013 Erik Schnetter <eschnetter at gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy
of this software and associated documentation files (the "Software"), to
deal
in the Software without restriction, including without limitation the
rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
}}}
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/2015>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list