early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,38 @@
diff --git a/cmake.config.h.in b/cmake.config.h.in
index 1f4c505..fd763cc 100644
--- a/cmake.config.h.in
+++ b/cmake.config.h.in
@@ -112,6 +112,10 @@
you don't. */
#cmakedefine01 HAVE_DECL_POSIX_MEMALIGN
+/* Define to 1 if you have the declaration of `_aligned_malloc', and to 0 if you
+ don't. */
+#cmakedefine01 HAVE_DECL_ALIGNED_MALLOC
+
/* Define to 1 if you have the declaration of `sinl', and to 0 if you don't.
*/
#cmakedefine01 HAVE_DECL_SINL
@@ -184,6 +188,9 @@
/* Define to 1 if you have the `memalign' function. */
#cmakedefine HAVE_MEMALIGN 1
+/* Define to 1 if you have the `_aligned_malloc' function. */
+#cmakedefine HAVE_ALIGNED_MALLOC 1
+
/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1
diff --git a/kernel/kalloc.c b/kernel/kalloc.c
index e42f6f3..ffc2257 100644
--- a/kernel/kalloc.c
+++ b/kernel/kalloc.c
@@ -103,7 +103,7 @@ void *X(kernel_malloc)(size_t n)
# undef real_free
# define real_free _mm_free
-# elif defined(_MSC_VER)
+# elif defined(_MSC_VER) || defined (HAVE_ALIGNED_MALLOC)
/* MS Visual C++ 6.0 with a "Processor Pack" supports SIMD
and _aligned_malloc/free (uses malloc.h) */
p = (void *) _aligned_malloc(n, MIN_ALIGNMENT);

View File

@@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49be67d..ef69fa6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,6 +66,7 @@ check_prototype_definition (cosl "long double cosl( long double arg )" "0" math.
check_prototype_definition (sinl "long double sinl( long double arg )" "0" math.h HAVE_DECL_SINL)
check_prototype_definition (memalign "void *memalign(size_t alignment, size_t size)" "0" malloc.h HAVE_DECL_MEMALIGN)
check_prototype_definition (posix_memalign "int posix_memalign(void **memptr, size_t alignment, size_t size)" "0" stdlib.h HAVE_DECL_POSIX_MEMALIGN)
+check_prototype_definition (_aligned_malloc "void* __cdecl _aligned_malloc(size_t _Size, size_t _Alignment)" "0" malloc.h HAVE_DECL_ALIGNED_MALLOC)
include (CheckSymbolExists)
check_symbol_exists (clock_gettime time.h HAVE_CLOCK_GETTIME)
@@ -75,6 +76,7 @@ check_symbol_exists (drand48 stdlib.h HAVE_DRAND48)
check_symbol_exists (srand48 stdlib.h HAVE_SRAND48)
check_symbol_exists (memalign malloc.h HAVE_MEMALIGN)
check_symbol_exists (posix_memalign stdlib.h HAVE_POSIX_MEMALIGN)
+check_symbol_exists (_aligned_malloc malloc.h HAVE_ALIGNED_MALLOC)
check_symbol_exists (mach_absolute_time mach/mach_time.h HAVE_MACH_ABSOLUTE_TIME)
check_symbol_exists (alloca alloca.h HAVE_ALLOCA)
if (NOT HAVE_ALLOCA)
@@ -131,6 +133,7 @@ endif ()
include (CheckCCompilerFlag)
+#All those checks fail due to linkage errors so we directly set HAVE_<ARCH> in the PORTFILE! We assume the user knows what (s)he is doing!
if (ENABLE_SSE)
foreach (FLAG "-msse" "/arch:SSE")
unset (HAVE_SSE CACHE)
@@ -180,8 +183,9 @@ if (ENABLE_AVX2)
endif ()
# AVX2 codelets require FMA support as well
+# AVX2 implicitly includes FMA using Visual Studio (also definition __FMA__ is not set)
if (ENABLE_AVX2)
- foreach (FLAG "-mfma" "/arch:FMA")
+ foreach (FLAG "-mfma" "/arch:AVX2")
unset (HAVE_FMA CACHE)
unset (HAVE_FMA)
check_c_compiler_flag (${FLAG} HAVE_FMA)

17
externals/vcpkg/ports/fftw3/omp_test.patch vendored Executable file
View File

@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3cfc20..9826bff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -385,6 +385,12 @@ if (BUILD_TESTS)
target_link_libraries (bench ${fftw3_lib})
endif ()
+ if (ENABLE_OPENMP)
+ target_link_libraries (bench ${fftw3_lib}_omp)
+ else ()
+ target_link_libraries (bench ${fftw3_lib})
+ endif ()
+
enable_testing ()

View File

@@ -0,0 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 335808a..90772b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -358,7 +358,7 @@ foreach(subtarget ${subtargets})
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endforeach ()
install(TARGETS ${fftw3_lib}
- EXPORT FFTW3LibraryDepends
+ EXPORT FFTW3${PREC_SUFFIX}LibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -419,11 +419,11 @@ configure_file (FFTW3ConfigVersion.cmake.in FFTW3${PREC_SUFFIX}ConfigVersion.cma
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
COMPONENT Development)
-export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3LibraryDepends.cmake)
-install(EXPORT FFTW3LibraryDepends
+export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3${PREC_SUFFIX}LibraryDepends.cmake)
+install(EXPORT FFTW3${PREC_SUFFIX}LibraryDepends
NAMESPACE FFTW3::
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
COMPONENT Development)
--- a/FFTW3Config.cmake.in
+++ b/FFTW3Config.cmake.in
@@ -10,7 +10,7 @@ set (FFTW3@PREC_SUFFIX@_LIBRARIES fftw3@PREC_SUFFIX@)
set (FFTW3@PREC_SUFFIX@_LIBRARY_DIRS @CMAKE_INSTALL_FULL_LIBDIR@)
set (FFTW3@PREC_SUFFIX@_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
-include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake")
+include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3@PREC_SUFFIX@LibraryDepends.cmake")
if (CMAKE_VERSION VERSION_LESS 2.8.3)
set (CMAKE_CURRENT_LIST_DIR)

74
externals/vcpkg/ports/fftw3/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,74 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://www.fftw.org/fftw-3.3.10.tar.gz"
FILENAME "fftw-3.3.10.tar.gz"
SHA512 2d34b5ccac7b08740dbdacc6ebe451d8a34cf9d9bfec85a5e776e87adf94abfd803c222412d8e10fbaa4ed46f504aa87180396af1b108666cde4314a55610b40
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
omp_test.patch
patch_targets.patch
fftw3_arch_fix.patch
aligned_malloc.patch
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
openmp ENABLE_OPENMP
threads ENABLE_THREADS
threads WITH_COMBINED_THREADS
avx2 ENABLE_AVX2
avx ENABLE_AVX
sse2 ENABLE_SSE2
sse ENABLE_SSE
)
set(ENABLE_FLOAT_CMAKE fftw3f)
set(ENABLE_LONG_DOUBLE_CMAKE fftw3l)
set(ENABLE_DEFAULT_PRECISION_CMAKE fftw3)
foreach(PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE ENABLE_DEFAULT_PRECISION)
if(PRECISION STREQUAL "ENABLE_LONG_DOUBLE")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-D${PRECISION}=ON
-DENABLE_OPENMP=${ENABLE_OPENMP}
-DENABLE_THREADS=${HAVE_THREADS}
-DWITH_COMBINED_THREADS=${HAVE_THREADS}
-DBUILD_TESTS=OFF
)
else()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-D${PRECISION}=ON
${FEATURE_OPTIONS}
-DBUILD_TESTS=OFF
)
endif()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME ${${PRECISION}_CMAKE} CONFIG_PATH lib/cmake)
endforeach()
file(READ "${SOURCE_PATH}/api/fftw3.h" _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(FFTW_DLL)" "0" _contents "${_contents}")
else()
string(REPLACE "defined(FFTW_DLL)" "1" _contents "${_contents}")
endif()
file(WRITE "${SOURCE_PATH}/include/fftw3.h" "${_contents}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()

37
externals/vcpkg/ports/fftw3/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,37 @@
{
"name": "fftw3",
"version": "3.3.10",
"port-version": 3,
"description": "FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).",
"homepage": "https://www.fftw.org/",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"avx": {
"description": "Builds part of the library with avx, sse2, sse"
},
"avx2": {
"description": "Builds part of the library with avx2, fma, avx, sse2, sse"
},
"openmp": {
"description": "Builds openmp enabled lib"
},
"sse": {
"description": "Builds part of the library with sse"
},
"sse2": {
"description": "Builds part of the library with sse2, sse"
},
"threads": {
"description": "Enable threads in fftw3"
}
}
}