Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78fafca

Browse filesBrowse files
committed
ggml : do not use _GNU_SOURCE gratuitously
1 parent 447ccbe commit 78fafca
Copy full SHA for 78fafca

File tree

Expand file treeCollapse file tree

4 files changed

+10
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-11
lines changed
Open diff view settings
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ CFLAGS = -I. $(OPT) -std=c11 -fPIC
4949
CXXFLAGS = -I. -I./examples $(OPT) -std=c++11 -fPIC
5050
LDFLAGS =
5151

52+
# clock_gettime came in POSIX.1b (1993)
53+
# CLOCK_MONOTONIC came in POSIX.1-2001 / SUSv3 as optional
54+
# posix_memalign came in POSIX.1-2001 / SUSv3
55+
# M_PI is an XSI extension since POSIX.1-2001 / SUSv3, came in XPG1 (1985)
56+
# ref: https://github.com/ggerganov/whisper.cpp/pull/1027
57+
CFLAGS += -D_XOPEN_SOURCE=600
58+
CXXFLAGS += -D_XOPEN_SOURCE=600
59+
5260
ifdef LLAMA_DEBUG
5361
CFLAGS += -O0 -g
5462
CXXFLAGS += -O0 -g
Collapse file

‎ggml.c‎

Copy file name to clipboardExpand all lines: ggml.c
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define _GNU_SOURCE // Defines CLOCK_MONOTONIC on Linux
21
#define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows
32

43
#include "ggml.h"
@@ -13387,8 +13386,7 @@ static void ggml_compute_forward_conv_2d_sk_p0_f16_f32(
1338713386
const int nk1 = ne01;
1338813387

1338913388
// size of the convolution row - the kernel size unrolled across all channels
13390-
// round-up so it is more suitable for SIMD
13391-
const int ew0 = ggml_up32(nk0*nk1*ne02);
13389+
const int ew0 = nk0*nk1*ne02;
1339213390

1339313391
GGML_ASSERT(nb00 == sizeof(ggml_fp16_t));
1339413392
GGML_ASSERT(nb10 == sizeof(float));
Collapse file

‎llama-util.h‎

Copy file name to clipboardExpand all lines: llama-util.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ __attribute__((format(gnu_printf, 1, 2)))
5353
__attribute__((format(printf, 1, 2)))
5454
#endif
5555
#endif
56+
5657
static std::string format(const char * fmt, ...) {
5758
va_list ap, ap2;
5859
va_start(ap, fmt);
Collapse file

‎llama.cpp‎

Copy file name to clipboardExpand all lines: llama.cpp
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
// Defines fileno on msys:
2-
#ifndef _GNU_SOURCE
3-
#define _GNU_SOURCE
4-
#include <cstddef>
5-
#include <cstdint>
6-
#include <cstdio>
7-
#endif
8-
91
#include "llama-util.h"
102
#include "llama.h"
113

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.