mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 16:47:37 +00:00
122c78b521
No functional change.
31 lines
719 B
C++
31 lines
719 B
C++
// header used in NNUE evaluation function
|
|
|
|
#ifndef NNUE_EVALUATE_NNUE_H_INCLUDED
|
|
#define NNUE_EVALUATE_NNUE_H_INCLUDED
|
|
|
|
#include "nnue_feature_transformer.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace Eval::NNUE {
|
|
|
|
// Hash value of evaluation function structure
|
|
constexpr std::uint32_t kHashValue =
|
|
FeatureTransformer::GetHashValue() ^ Network::GetHashValue();
|
|
|
|
// Deleter for automating release of memory area
|
|
template <typename T>
|
|
struct AlignedDeleter {
|
|
void operator()(T* ptr) const {
|
|
ptr->~T();
|
|
std_aligned_free(ptr);
|
|
}
|
|
};
|
|
|
|
template <typename T>
|
|
using AlignedPtr = std::unique_ptr<T, AlignedDeleter<T>>;
|
|
|
|
} // namespace Eval::NNUE
|
|
|
|
#endif // #ifndef NNUE_EVALUATE_NNUE_H_INCLUDED
|