summaryrefslogtreecommitdiff
path: root/ggml.h
diff options
context:
space:
mode:
authorCebtenzzre <cebtenzzre@gmail.com>2023-09-28 17:41:44 -0400
committerGitHub <noreply@github.com>2023-09-28 17:41:44 -0400
commitbc39553c901a91cfcb757863586250838c83eeab (patch)
tree507d1aedf8ad63e4ed84e37154de9abf31ba358a /ggml.h
parent0ccfc62a96a6b59a8faa14d1b350493f4cd51ae2 (diff)
build : enable more non-default compiler warnings (#3200)
Diffstat (limited to 'ggml.h')
-rw-r--r--ggml.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ggml.h b/ggml.h
index d61c28b2..460857fa 100644
--- a/ggml.h
+++ b/ggml.h
@@ -248,6 +248,14 @@
} \
} while (0)
+#ifndef NDEBUG
+#define GGML_UNREACHABLE() GGML_ASSERT(!"statement should not be reached")
+#elif defined(__GNUC__)
+#define GGML_UNREACHABLE() __builtin_unreachable()
+#else
+#define GGML_UNREACHABLE() ((void) 0)
+#endif
+
// used to copy the number of elements and stride in bytes of tensors into local variables.
// main purpose is to reduce code duplication and improve readability.
//