Skip to content

Commit c6e32cb

Browse files
committed
update
1 parent cdab7b9 commit c6e32cb

File tree

7 files changed

+583
-577
lines changed

7 files changed

+583
-577
lines changed

.editorconfig

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# https://EditorConfig.org
2-
3-
# Top-most EditorConfig file
4-
root = true
5-
6-
# Unix-style newlines with a newline ending every file, utf-8 charset
7-
[*]
8-
end_of_line = lf
9-
insert_final_newline = true
10-
trim_trailing_whitespace = true
11-
charset = utf-8
12-
indent_style = space
13-
indent_size = 4
14-
15-
[Makefile]
16-
indent_style = tab
17-
18-
[*.txt]
19-
insert_final_newline = unset
20-
21-
[*.md]
22-
insert_final_newline = unset
1+
# https://EditorConfig.org
2+
3+
# Top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file, utf-8 charset
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
charset = utf-8
12+
indent_style = space
13+
indent_size = 4
14+
15+
[Makefile]
16+
indent_style = tab
17+
18+
[*.txt]
19+
insert_final_newline = unset
20+
21+
[*.md]
22+
insert_final_newline = unset

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "thirdparty/ggml"]
2-
path = thirdparty/ggml
3-
url = https://github.com/ggerganov/ggml.git
1+
[submodule "thirdparty/ggml"]
2+
path = thirdparty/ggml
3+
url = https://github.com/ggerganov/ggml.git

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# ggml-zig
2-
3-
Zig bindings for [ggml: Tensor library for machine learning](https://github.com/ggerganov/ggml) <img src="https://img.shields.io/github/stars/ggerganov/ggml?style=social"/>.
1+
# ggml-zig
2+
3+
Zig bindings for [ggml: Tensor library for machine learning](https://github.com/ggerganov/ggml) <img src="https://img.shields.io/github/stars/ggerganov/ggml?style=social"/>.

build.zig

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
const std = @import("std");
2-
3-
// Zig Version: 0.11.0-dev.3798+a5e15eced
4-
// Zig Build Command: zig build
5-
// Zig Run Command: zig build -h
6-
// zig build run_zig_test0
7-
// zig build run_zig_test1
8-
// zig build run_zig_test2
9-
// zig build run_zig_test3
10-
pub fn build(b: *std.Build) void {
11-
// Standard target options allows the person running `zig build` to choose
12-
// what target to build for. Here we do not override the defaults, which
13-
// means any target is allowed, and the default is native. Other options
14-
// for restricting supported target set are available.
15-
const target = b.standardTargetOptions(.{});
16-
17-
// Standard optimization options allow the person running `zig build` to select
18-
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
19-
// set a preferred release mode, allowing the user to decide how to optimize.
20-
const optimize = b.standardOptimizeOption(.{});
21-
// const optimize = .ReleaseFast;
22-
// const optimize = .ReleaseSmall;
23-
24-
// zig_examples
25-
const zig_examples = .{
26-
27-
};
28-
inline for (zig_examples) |name| {
29-
const exe = b.addExecutable(.{
30-
.name = name,
31-
.root_source_file = .{ .path = std.fmt.comptimePrint("examples/{s}/main.zig", .{name}) },
32-
.target = target,
33-
.optimize = optimize,
34-
});
35-
exe.addIncludePath("./thirdparty/ggml/include");
36-
exe.addIncludePath("./thirdparty/ggml/include/ggml");
37-
exe.addCSourceFiles(&.{
38-
"./thirdparty/ggml/src/ggml.c",
39-
}, &.{"-std=c11"});
40-
exe.linkLibC();
41-
b.installArtifact(exe);
42-
const run_cmd = b.addRunArtifact(exe);
43-
// This allows the user to pass arguments to the application in the build
44-
// command itself, like this: `zig build run -- arg1 arg2 etc`
45-
run_cmd.step.dependOn(b.getInstallStep());
46-
if (b.args) |args| run_cmd.addArgs(args);
47-
const run_step = b.step("run_zig_" ++ name, "Run zig_examples");
48-
run_step.dependOn(&run_cmd.step);
49-
}
50-
51-
// zig_tests
52-
const zig_tests = .{
53-
"test0",
54-
"test1",
55-
"test2",
56-
"test3",
57-
};
58-
inline for (zig_tests) |name| {
59-
const exe = b.addExecutable(.{
60-
.name = name,
61-
.root_source_file = .{ .path = std.fmt.comptimePrint("tests/{s}.zig", .{name}) },
62-
.target = target,
63-
.optimize = optimize,
64-
});
65-
exe.addIncludePath("./thirdparty/ggml/include");
66-
exe.addIncludePath("./thirdparty/ggml/include/ggml");
67-
exe.addCSourceFiles(&.{
68-
"./thirdparty/ggml/src/ggml.c",
69-
}, &.{"-std=c11"});
70-
exe.linkLibC();
71-
b.installArtifact(exe);
72-
const run_cmd = b.addRunArtifact(exe);
73-
// This allows the user to pass arguments to the application in the build
74-
// command itself, like this: `zig build run -- arg1 arg2 etc`
75-
run_cmd.step.dependOn(b.getInstallStep());
76-
if (b.args) |args| run_cmd.addArgs(args);
77-
const run_step = b.step("run_zig_" ++ name, "Run zig_tests");
78-
run_step.dependOn(&run_cmd.step);
79-
}
80-
}
81-
1+
const std = @import("std");
2+
3+
// Zig Version: 0.11.0-dev.3867+ff37ccd29
4+
// Zig Build Command: zig build
5+
// Zig Run Command: zig build -h
6+
// zig build run_zig_test0
7+
// zig build run_zig_test1
8+
// zig build run_zig_test2
9+
// zig build run_zig_test3
10+
pub fn build(b: *std.Build) void {
11+
// Standard target options allows the person running `zig build` to choose
12+
// what target to build for. Here we do not override the defaults, which
13+
// means any target is allowed, and the default is native. Other options
14+
// for restricting supported target set are available.
15+
const target = b.standardTargetOptions(.{});
16+
17+
// Standard optimization options allow the person running `zig build` to select
18+
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
19+
// set a preferred release mode, allowing the user to decide how to optimize.
20+
const optimize = b.standardOptimizeOption(.{});
21+
// const optimize = .ReleaseFast;
22+
// const optimize = .ReleaseSmall;
23+
24+
// zig_examples
25+
const zig_examples = .{
26+
27+
};
28+
inline for (zig_examples) |name| {
29+
const exe = b.addExecutable(.{
30+
.name = name,
31+
.root_source_file = .{ .path = std.fmt.comptimePrint("examples/{s}/main.zig", .{name}) },
32+
.target = target,
33+
.optimize = optimize,
34+
});
35+
exe.addIncludePath("./thirdparty/ggml/include");
36+
exe.addIncludePath("./thirdparty/ggml/include/ggml");
37+
exe.addCSourceFiles(&.{
38+
"./thirdparty/ggml/src/ggml.c",
39+
}, &.{"-std=c11"});
40+
exe.linkLibC();
41+
b.installArtifact(exe);
42+
const run_cmd = b.addRunArtifact(exe);
43+
// This allows the user to pass arguments to the application in the build
44+
// command itself, like this: `zig build run -- arg1 arg2 etc`
45+
run_cmd.step.dependOn(b.getInstallStep());
46+
if (b.args) |args| run_cmd.addArgs(args);
47+
const run_step = b.step("run_zig_" ++ name, "Run zig_examples");
48+
run_step.dependOn(&run_cmd.step);
49+
}
50+
51+
// zig_tests
52+
const zig_tests = .{
53+
"test0",
54+
"test1",
55+
"test2",
56+
"test3",
57+
};
58+
inline for (zig_tests) |name| {
59+
const exe = b.addExecutable(.{
60+
.name = name,
61+
.root_source_file = .{ .path = std.fmt.comptimePrint("tests/{s}.zig", .{name}) },
62+
.target = target,
63+
.optimize = optimize,
64+
});
65+
exe.addIncludePath("./thirdparty/ggml/include");
66+
exe.addIncludePath("./thirdparty/ggml/include/ggml");
67+
exe.addCSourceFiles(&.{
68+
"./thirdparty/ggml/src/ggml.c",
69+
}, &.{"-std=c11"});
70+
exe.linkLibC();
71+
b.installArtifact(exe);
72+
const run_cmd = b.addRunArtifact(exe);
73+
// This allows the user to pass arguments to the application in the build
74+
// command itself, like this: `zig build run -- arg1 arg2 etc`
75+
run_cmd.step.dependOn(b.getInstallStep());
76+
if (b.args) |args| run_cmd.addArgs(args);
77+
const run_step = b.step("run_zig_" ++ name, "Run zig_tests");
78+
run_step.dependOn(&run_cmd.step);
79+
}
80+
}
81+

0 commit comments

Comments
 (0)