aboutsummaryrefslogtreecommitdiff
path: root/ggml.h
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-07-06 19:41:31 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-07-06 19:41:31 +0300
commitdfd9fce6d65599bf33df43e616e85aa639bdae4c (patch)
treeeb37de9135f016c241540a0f75de6094c2efd7fe /ggml.h
parent36680f6e40e4440c3ec3385d0b7e5ca8bb6c37f7 (diff)
ggml : fix restrict usage
Diffstat (limited to 'ggml.h')
-rw-r--r--ggml.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/ggml.h b/ggml.h
index 24ca8ae..d0710c5 100644
--- a/ggml.h
+++ b/ggml.h
@@ -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;