Skip to content

Commit

Permalink
ggml : fix restrict usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jul 6, 2023
1 parent 36680f6 commit dfd9fce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,15 @@ extern "C" {
// Internal types and functions exposed for tests and benchmarks
//

typedef void (*ggml_to_float_t)(const void * x, float * y, int k);
typedef void (*ggml_from_float_t)(const float * x, void * y, int k);
typedef void (*ggml_vec_dot_t)(const int n, float * s, const void * x, const void * y);
#ifdef __cplusplus
// restrict not standard in C++
#define GGML_RESTRICT
#else
#define GGML_RESTRICT restrict
#endif
typedef void (*ggml_to_float_t) (const void * GGML_RESTRICT x, float * GGML_RESTRICT y, int k);
typedef void (*ggml_from_float_t)(const float * GGML_RESTRICT x, void * GGML_RESTRICT y, int k);
typedef void (*ggml_vec_dot_t) (const int n, float * GGML_RESTRICT s, const void * GGML_RESTRICT x, const void * GGML_RESTRICT y);

typedef struct {
ggml_to_float_t to_float;
Expand Down

0 comments on commit dfd9fce

Please sign in to comment.