mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Replace non-blas parts of trainers with our own blas-like routines.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "trainer.h"
|
||||
|
||||
#include "extra/stockfish_blas.h"
|
||||
|
||||
#include "learn/learn.h"
|
||||
|
||||
#include "nnue/layers/input_slice.h"
|
||||
@@ -208,13 +210,21 @@ namespace Eval::NNUE {
|
||||
for (IndexType b = 0; b < batch_size_; ++b) {
|
||||
const IndexType input_offset = kInputDimensions * b;
|
||||
const IndexType output_offset = kOutputDimensions * b;
|
||||
|
||||
#if defined(USE_BLAS)
|
||||
cblas_scopy(kOutputDimensions, &input[input_offset + Offset], 1,
|
||||
&output_[output_offset], 1);
|
||||
|
||||
cblas_scopy(
|
||||
kOutputDimensions, &input[input_offset + Offset], 1,
|
||||
&output_[output_offset], 1
|
||||
);
|
||||
#else
|
||||
for (IndexType i = 0; i < kOutputDimensions; ++i) {
|
||||
output_[output_offset + i] = input[input_offset + Offset + i];
|
||||
}
|
||||
|
||||
Blas::scopy(
|
||||
thread_pool,
|
||||
kOutputDimensions, &input[input_offset + Offset], 1,
|
||||
&output_[output_offset], 1
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user