Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
i-evi committed Oct 11, 2020
1 parent e7d7777 commit 292c0fb
Show file tree
Hide file tree
Showing 13 changed files with 639 additions and 452 deletions.
50 changes: 50 additions & 0 deletions demo/lua2vgg16.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
loadfile("./util/lua2cc.lua")()

network = {
networkName = "vgg16",
createScope = "vgg16",
parameterLv = 0,
inputLayers = {"in"},
outputLayers = {"out"},
l1 = conv2d ({input = "in",
stride = 1, padding = 1}),
l2 = relu ({}),
l3 = conv2d ({stride = 1, padding = 1}),
l4 = relu ({}),
l5 = maxPool2d ({stride = 2}),
l6 = conv2d ({stride = 1, padding = 1}),
l7 = relu ({}),
l8 = conv2d ({stride = 1, padding = 1}),
l9 = relu ({}),
l10 = maxPool2d ({stride = 2}),
l11 = conv2d ({stride = 1, padding = 1}),
l12 = relu ({}),
l13 = conv2d ({stride = 1, padding = 1}),
l14 = relu ({}),
l15 = conv2d ({stride = 1, padding = 1}),
l16 = relu ({}),
l17 = maxPool2d ({stride = 2}),
l18 = conv2d ({stride = 1, padding = 1}),
l19 = relu ({}),
l20 = conv2d ({stride = 1, padding = 1}),
l21 = relu ({}),
l22 = conv2d ({stride = 1, padding = 1}),
l23 = relu ({}),
l24 = maxPool2d ({stride = 2}),
l25 = conv2d ({stride = 1, padding = 1}),
l26 = relu ({}),
l27 = conv2d ({stride = 1, padding = 1}),
l28 = relu ({}),
l29 = conv2d ({stride = 1, padding = 1}),
l30 = relu ({}),
l31 = maxPool2d ({stride = 2}),
l32 = reshape ({shape = {-1, 1, 1}}),
l33 = fullyConnected ({}),
l34 = relu ({}),
l35 = fullyConnected ({}),
l36 = relu ({}),
l37 = fullyConnected ({}),
out = softmax ({input = "l37"})
}

ccCodeTranslator(network, {file = "vgg16.c"})
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DFLAG += # -g -fsanitize=address -fno-omit-frame-pointer
CFLAG += # -std=c89
CFLAG += -Wall # -Wpedantic

OFLAG += -O3
OFLAG += -O3 -march=native

# Enable OpenMP
OFLAG += -DENABLE_OPENMP -fopenmp
Expand Down Expand Up @@ -127,7 +127,7 @@ $(OBJS_PATH)/build:
all: $(APPS)

$(CATCOON_A): $(ALL_O)
cd $(OBJS_PATH) && $(AR) $@ $^ && $(MV) $@ ..
cd $(OBJS_PATH) && $(AR) $@ $(ALL_O) && $(MV) $@ ..

%.o: ./src/%.c
$(CC) -c -o $(OBJS_PATH)/$@ $< $(CFLAG) $(INC)
Expand Down
Loading

0 comments on commit 292c0fb

Please sign in to comment.