[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge branch 'master' into refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gordicaleksa committed Jul 28, 2024
2 parents 95c0698 + fdd88cd commit 2d698d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ CC = gcc
CFLAGS = -Wall -O3
LDFLAGS = -lm

# turn on all the warnings
# https://github.com/mcinglis/c-style
CFLAGS += -Wall -Wextra -Wpedantic \
-Wformat=2 -Wno-unused-parameter -Wshadow \
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs

# Main targets
all: tensor1d libtensor1d.so

Expand All @@ -21,4 +28,4 @@ clean:
test:
pytest

.PHONY: all clean test
.PHONY: all clean test tensor1d
1 change: 1 addition & 0 deletions tensor1d.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Tensor* tensor_slice(Tensor* t, int start, int end, int step) {
s->size = ceil_div(end - start, step);
s->offset = t->offset + start * t->stride;
s->stride = t->stride * step;
s->repr = NULL;
storage_incref(s->storage); // increment the reference count
return s;
}
Expand Down

0 comments on commit 2d698d7

Please sign in to comment.