[NNUE] Wrap aligned_alloc

For some systems std::aligned_alloc is not available even if c++17 is specified.
Wrap the function and use specific solutions.

Update macosx-version-min to the required minimum.

No functional change.
This commit is contained in:
Joost VandeVondele
2020-07-26 20:31:01 +02:00
parent 2b0ba70436
commit 98ffe0cd97
5 changed files with 31 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ namespace Eval::NNUE {
template <typename T>
void Initialize(AlignedPtr<T>& pointer) {
pointer.reset(reinterpret_cast<T*>(std::aligned_alloc(alignof(T), sizeof(T))));
pointer.reset(reinterpret_cast<T*>(std_aligned_alloc(alignof(T), sizeof(T))));
std::memset(pointer.get(), 0, sizeof(T));
}