Skip to content

Commit

Permalink
windows fixes and license missing files to first official release
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarpomar committed Jun 25, 2020
1 parent c590151 commit 4230c37
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX /D__AVX__=1")
elseif (USE_SEE4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /D__SSE4_1__=1 /D__SSE2__=1")
elseif (USE_SEE)
elseif (USE_SEE2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /D__SSE2__=1")
endif ()
else ()
Expand Down
23 changes: 23 additions & 0 deletions libs/boost-align/LICENSE_1_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
23 changes: 23 additions & 0 deletions libs/boost-core/LICENSE_1_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
23 changes: 23 additions & 0 deletions libs/boost-sort/LICENSE_1_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
48 changes: 48 additions & 0 deletions libs/xxhash/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
xxHash Library
Copyright (c) 2012-2020 Yann Collet
All rights reserved.

BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

----------------------------------------------------

xxhsum command line interface
Copyright (c) 2013-2020 Yann Collet
All rights reserved.

GPL v2 License

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2 changes: 1 addition & 1 deletion src/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace veryfasttree {
buf.resize(size);
snprintf(&buf.front(), size, format.c_str(), args ...);
buf.resize(size - 1);
return std::move(buf);
return buf;
}

inline std::string strformat(const std::string &format) {
Expand Down
22 changes: 14 additions & 8 deletions src/operations/AVX256Operations.tcc
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@

#ifndef FASTTREE_AVX256OPERATIONS_TCC
#define FASTTREE_AVX256OPERATIONS_TCC

#include "AVX256Operations.h"
#include <cmath>

#if (defined _WIN32 || defined WIN32 || defined WIN64 || defined _WIN64) //Fix windows union operator[]
#define getf(array, i) ((float*)&array)[i]
#define getd(array, i) ((double*)&array)[i]
#else
#define getf(array, i) array[i]
#define getd(array, i) array[i]
#endif

template<>
inline float veryfasttree::AVX256Operations<float>::mm_sum(__m128 sum) {
sum = _mm_hadd_ps(sum, sum);
return sum[0] + sum[1];
return getf(sum, 0) + getf(sum, 1);
}

template<>
inline double veryfasttree::AVX256Operations<double>::mm_sum(__m256d sum) {
sum = _mm256_hadd_pd(sum, sum);
return sum[0] + sum[2];
return getd(sum, 0) + getd(sum, 2);
}

template<>
inline float veryfasttree::AVX256Operations<float>::mm_sum(__m256 sum1, __m128 sum2) {
sum2 = _mm_add_ps(*(__m128 *) &sum1, sum2);
sum2 = _mm_add_ps(*(__m128 *) &sum1[4], sum2);
sum2 = _mm_add_ps(*(__m128 *) &getf(sum1, 4), sum2);
sum2 = _mm_hadd_ps(sum2, sum2);
return sum2[0] + sum2[1];
return getf(sum2,0) + getf(sum2,1);
}

template<>
Expand Down Expand Up @@ -554,4 +559,5 @@ inline __m128 veryfasttree::AVX256Operations<Precision>::fastexpImpl(__m128 x) {
return _mm_mul_ps(x, _mm_castsi128_ps(u));
}

#endif
#undef getf
#undef getd
18 changes: 12 additions & 6 deletions src/operations/AVX512Operations.tcc
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@

#ifndef FASTTREE_AVX512OPERATIONS_TCC
#define FASTTREE_AVX512OPERATIONS_TCC

#include "AVX512Operations.h"
#include <cmath>

#if (defined _WIN32 || defined WIN32 || defined WIN64 || defined _WIN64) //Fix windows union operator[]
#define getf(array, i) ((float*)&array)[i]
#define getd(array, i) ((double*)&array)[i]
#else
#define getf(array, i) array[i]
#define getd(array, i) array[i]
#endif

template<>
inline float veryfasttree::AVX512Operations<float>::mm_sum(__m128 sum) {
sum = _mm_hadd_ps(sum, sum);
return sum[0] + sum[1];
return getf(sum, 0) + getf(sum, 1);
}

template<>
inline double veryfasttree::AVX512Operations<double>::mm_sum(__m256d sum) {
sum = _mm256_hadd_pd(sum, sum);
return sum[0] + sum[2];
return getd(sum, 0) + getd(sum, 2);
}

template<>
Expand Down Expand Up @@ -652,4 +657,5 @@ inline __m128 veryfasttree::AVX512Operations<Precision>::fastexpImpl(__m128 x) {
return _mm_mul_ps(x, _mm_castsi128_ps(u));
}

#endif
#undef getf
#undef getd
21 changes: 13 additions & 8 deletions src/operations/SSE128Operations.tcc
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@

#ifndef FASTTREE_SSE128OPERATIONS_TCC
#define FASTTREE_SSE128OPERATIONS_TCC

#include "SSE128Operations.h"
#include <cmath>

#if (defined _WIN32 || defined WIN32 || defined WIN64 || defined _WIN64) //Fix windows union operator[]
#define getf(array, i) ((float*)&array)[i]
#define getd(array, i) ((double*)&array)[i]
#else
#define getf(array, i) array[i]
#define getd(array, i) array[i]
#endif


template<>
template<>
inline float veryfasttree::SSE128Operations<float>::mm_sum(__m128 sum) {
#ifdef __SSE3__
sum = _mm_hadd_ps(sum, sum);
return sum[0] + sum[1];
return getf(sum, 0) + getf(sum, 1);
#else
/* stupider but faster */
alignas(ALIGNMENT) float f[4];
Expand All @@ -22,7 +28,7 @@ inline float veryfasttree::SSE128Operations<float>::mm_sum(__m128 sum) {
template<>
template<>
inline double veryfasttree::SSE128Operations<double>::mm_sum(__m128d sum) {
return sum[0] + sum[1];
return getd(sum, 0) + getd(sum, 1);
}

template<>
Expand Down Expand Up @@ -438,6 +444,5 @@ inline __m128d veryfasttree::SSE128Operations<Precision>::fastexpImpl(__m128d x)
return _mm_mul_pd(x, _mm_castsi128_pd(u));
}


#endif

#undef getf
#undef getd

0 comments on commit 4230c37

Please sign in to comment.