Skip to content

Commit 561cb2a

Browse files
committed
Try restricting compilation to ARM64.
# Conflicts: # src/llama-impl.h # src/llama-sampling.h # src/llama-vocab.cpp # src/llama-vocab.h # src/unicode-data.h
1 parent 64ae065 commit 561cb2a

File tree

13 files changed

+52
-0
lines changed

13 files changed

+52
-0
lines changed

include/llama.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#ifndef LLAMA_H
24
#define LLAMA_H
35

@@ -1261,3 +1263,5 @@ extern "C" {
12611263
#endif
12621264

12631265
#endif // LLAMA_H
1266+
1267+
#endif

src/llama-grammar.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#include "llama-grammar.h"
24

35
#include "llama-vocab.h"
@@ -1136,3 +1138,5 @@ void llama_grammar_accept_impl(struct llama_grammar & grammar, llama_token token
11361138
grammar.partial_utf8 = decoded.second;
11371139
GGML_ASSERT(!grammar.stacks.empty());
11381140
}
1141+
1142+
#endif

src/llama-grammar.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#pragma once
24

35
#include "llama-impl.h"
@@ -142,3 +144,5 @@ void llama_grammar_apply_impl(
142144
void llama_grammar_accept_impl(
143145
struct llama_grammar & grammar,
144146
llama_token token);
147+
148+
#endif

src/llama-impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#pragma once
24

35
#include "llama.h"
@@ -179,3 +181,5 @@ struct ring_buffer {
179181
size_t pos = 0;
180182
std::vector<T> data;
181183
};
184+
185+
#endif

src/llama-sampling.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#include "llama-sampling.h"
24

35
#include "llama-vocab.h"
@@ -2345,3 +2347,5 @@ void llama_perf_sampler_reset(struct llama_sampler * chain) {
23452347

23462348
ctx->t_sample_us = ctx->n_sample = 0;
23472349
}
2350+
2351+
#endif

src/llama-sampling.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#pragma once
24

35
// TODO: rename llama-sampling.h/.cpp to llama-sampler.h/.cpp ?
@@ -46,3 +48,5 @@ struct llama_sampler * llama_sampler_init_dry_testing(
4648
int32_t dry_allowed_length,
4749
int32_t dry_penalty_last_n,
4850
const std::vector<std::vector<llama_token>>& seq_breakers);
51+
52+
#endif

src/llama-vocab.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#include "llama-vocab.h"
24

35
#include "unicode.h"
@@ -1983,3 +1985,5 @@ std::string llama_detokenize(const struct llama_vocab & vocab, const std::vector
19831985
// NOTE: the original tokenizer decodes bytes after collecting the pieces.
19841986
return text;
19851987
}
1988+
1989+
#endif

src/llama-vocab.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#pragma once
24

35
#include "llama-impl.h"
@@ -168,3 +170,5 @@ std::string llama_detokenize(
168170
const struct llama_vocab & vocab,
169171
const std::vector<llama_token> & tokens,
170172
bool special);
173+
174+
#endif

src/llama.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
#include "llama-impl.h"
24
#include "llama-vocab.h"
35
#include "llama-sampling.h"
@@ -22369,3 +22371,5 @@ void llama_log_callback_default(ggml_log_level level, const char * text, void *
2236922371
fputs(text, stderr);
2237022372
fflush(stderr);
2237122373
}
22374+
22375+
#endif

src/unicode-data.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if defined(__arm64__)
2+
13
// generated with scripts/gen-unicode-data.py
24

35
#include "unicode-data.h"
@@ -7032,3 +7034,5 @@ const std::initializer_list<range_nfd> unicode_ranges_nfd = { // start, last, n
70327034
{0x02FA1C, 0x02FA1C, 0x009F3B},
70337035
{0x02FA1D, 0x02FA1D, 0x02A600},
70347036
};
7037+
7038+
#endif

0 commit comments

Comments
 (0)