Skip to content

Commit

Permalink
sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
Sopel97 committed Jul 13, 2021
1 parent 666f0f8 commit 4c71e9d
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 336 deletions.
10 changes: 6 additions & 4 deletions src/nnue-regular.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ static alignas(64) int32_t hidden1_biases[8][16];
static alignas(64) int32_t hidden2_biases[8][32];
static int32_t output_biases[8][1];

#endif

INLINE void affine_propagate(clipped_t *input, int32_t *output,
unsigned inDims, unsigned outDims, int32_t *biases, weight_t *weights)
{
Expand Down Expand Up @@ -532,6 +534,7 @@ INLINE void clip_propagate(int32_t *input, clipped_t *output, unsigned numDims)
#endif
}

#ifdef NNUE_REGULAR
struct NetData {
alignas(64) clipped_t input[1024];
int32_t hidden1_values[32];
Expand Down Expand Up @@ -583,8 +586,9 @@ Value nnue_evaluate(const Position *pos)
return (out_value + psqt_val) / FV_SCALE;
}
}
#endif

static const char* read_output_weights(weight_t *w, const char *d)
static const char* read_output_weights_dense(weight_t *w, const char *d)
{
for (unsigned i = 0; i < 32; i++) {
unsigned c = i;
Expand All @@ -598,7 +602,7 @@ static const char* read_output_weights(weight_t *w, const char *d)
return d;
}

INLINE unsigned wt_idx(unsigned r, unsigned c, unsigned dims)
INLINE unsigned wt_idx_dense(unsigned r, unsigned c, unsigned dims)
{
(void)dims;

Expand All @@ -624,5 +628,3 @@ INLINE unsigned wt_idx(unsigned r, unsigned c, unsigned dims)

return k;
}

#endif
Loading

0 comments on commit 4c71e9d

Please sign in to comment.