-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make nn_dot_product function arguments fixed array (#14)
- Loading branch information
Showing
6 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#ifndef NN_DOT_PRODUCT_H | ||
#define NN_DOT_PRODUCT_H | ||
|
||
#include "nn_error.h" | ||
#include <stddef.h> | ||
|
||
// NN_DOT_PRODUCT_MAX_VECTOR_SIZE defines the maximum size of a vector. | ||
#ifndef NN_DOT_PRODUCT_MAX_VECTOR_SIZE | ||
#define NN_DOT_PRODUCT_MAX_VECTOR_SIZE 64 | ||
#endif | ||
|
||
// NNDotProductFunction represents a function that calculates the dot product of two vectors. | ||
typedef float (*NNDotProductFunction)(const float *a, const float *b, size_t length); | ||
typedef float (*NNDotProductFunction)(const float a[NN_DOT_PRODUCT_MAX_VECTOR_SIZE], const float b[NN_DOT_PRODUCT_MAX_VECTOR_SIZE], size_t vector_size); | ||
|
||
// nn_dot_product calculates the dot product of two vectors. | ||
float nn_dot_product(const float *a, const float *b, size_t length); | ||
float nn_dot_product(const float a[NN_DOT_PRODUCT_MAX_VECTOR_SIZE], const float b[NN_DOT_PRODUCT_MAX_VECTOR_SIZE], size_t vector_size); | ||
|
||
#endif // NN_DOT_PRODUCT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters