parent
9728147fe3
commit
2f57d46df4
@ -1,97 +1,97 @@
|
|||||||
BASE_DIR=../../../
|
BASE_DIR=../../../
|
||||||
|
|
||||||
AWSM_CC=awsm
|
AWSM_CC=awsm
|
||||||
|
|
||||||
NATIVE_CC=clang
|
NATIVE_CC=clang
|
||||||
NATIVE_CFLAGS = -I. -DCPU_FREQ=3600 -O3 -lm -DSOD_DISABLE_CNN -DLIBCOX_DISABLE_DISK_IO
|
NATIVE_CFLAGS = -I. -DCPU_FREQ=3600 -O3 -lm -DSOD_DISABLE_CNN -DLIBCOX_DISABLE_DISK_IO
|
||||||
|
|
||||||
OPTFLAGS=-O3 -flto
|
OPTFLAGS=-O3 -flto
|
||||||
|
|
||||||
WASM_CC=wasm32-unknown-unknown-wasm-clang
|
WASM_CC=wasm32-unknown-unknown-wasm-clang
|
||||||
WASM_LDFLAGS=-Wl,-z,stack-size=524288,--allow-undefined,--no-threads,--stack-first,--no-entry,--export-all,--export=main,--export=dummy
|
WASM_LDFLAGS=-Wl,-z,stack-size=524288,--allow-undefined,--no-threads,--stack-first,--no-entry,--export-all,--export=main,--export=dummy
|
||||||
WASM_CFLAGS=${WASM_LDFLAGS} -nostartfiles -DWASM -I. -DSOD_DISABLE_CNN -lm -DLIBCOX_DISABLE_DISK_IO
|
WASM_CFLAGS=${WASM_LDFLAGS} -nostartfiles -DWASM -I. -DSOD_DISABLE_CNN -lm -DLIBCOX_DISABLE_DISK_IO
|
||||||
|
|
||||||
MEMC_64=64bit_nix.c
|
MEMC_64=64bit_nix.c
|
||||||
|
|
||||||
# for aWsm compiler
|
# for aWsm compiler
|
||||||
# Currently only uses wasmception backing
|
# Currently only uses wasmception backing
|
||||||
AWSM_DIR=${BASE_DIR}/awsm/
|
AWSM_DIR=${BASE_DIR}/awsm/
|
||||||
AWSM_RT_DIR=${AWSM_DIR}/runtime/
|
AWSM_RT_DIR=${AWSM_DIR}/runtime/
|
||||||
AWSM_RT_MEM=${AWSM_RT_DIR}/memory/
|
AWSM_RT_MEM=${AWSM_RT_DIR}/memory/
|
||||||
AWSM_RT_LIBC=${AWSM_RT_DIR}/libc/wasmception_backing.c
|
AWSM_RT_LIBC=${AWSM_RT_DIR}/libc/wasmception_backing.c
|
||||||
AWSM_RT_ENV=${AWSM_RT_DIR}/libc/env.c
|
AWSM_RT_ENV=${AWSM_RT_DIR}/libc/env.c
|
||||||
AWSM_RT_RT=${AWSM_RT_DIR}/runtime.c
|
AWSM_RT_RT=${AWSM_RT_DIR}/runtime.c
|
||||||
AWSM_RT_MEMC=${AWSM_RT_MEM}/${MEMC_64}
|
AWSM_RT_MEMC=${AWSM_RT_MEM}/${MEMC_64}
|
||||||
DUMMY=${AWSM_DIR}/code_benches/dummy.c
|
DUMMY=${AWSM_DIR}/code_benches/dummy.c
|
||||||
|
|
||||||
# for SLEdge serverless runtime
|
# for SLEdge serverless runtime
|
||||||
SLEDGE_RT_DIR=${BASE_DIR}/runtime/
|
SLEDGE_RT_DIR=${BASE_DIR}/runtime/
|
||||||
SLEDGE_RT_INC=${SLEDGE_RT_DIR}/include/
|
SLEDGE_RT_INC=${SLEDGE_RT_DIR}/include/
|
||||||
SLEDGE_MEMC=${SLEDGE_RT_DIR}/compiletime/memory/${MEMC_64}
|
SLEDGE_MEMC=${SLEDGE_RT_DIR}/compiletime/memory/${MEMC_64}
|
||||||
|
|
||||||
SLEDGE_BIN_DIR=${SLEDGE_RT_DIR}/bin/
|
SLEDGE_BIN_DIR=${SLEDGE_RT_DIR}/bin/
|
||||||
WASMISA=${SLEDGE_RT_DIR}/compiletime/instr.c
|
WASMISA=${SLEDGE_RT_DIR}/compiletime/instr.c
|
||||||
|
|
||||||
SAMPLES = resize_image \
|
SAMPLES = resize_image \
|
||||||
license_plate_detection
|
license_plate_detection
|
||||||
|
|
||||||
#SAMPLES = batch_img_loading \
|
#SAMPLES = batch_img_loading \
|
||||||
# blob_detection \
|
# blob_detection \
|
||||||
# canny_edge_detection \
|
# canny_edge_detection \
|
||||||
# cnn_coco \
|
# cnn_coco \
|
||||||
# cnn_face_detection \
|
# cnn_face_detection \
|
||||||
# cnn_object_detection \
|
# cnn_object_detection \
|
||||||
# cnn_voc \
|
# cnn_voc \
|
||||||
# crop_image \
|
# crop_image \
|
||||||
# dilate_image \
|
# dilate_image \
|
||||||
# erode_image \
|
# erode_image \
|
||||||
# grayscale_image \
|
# grayscale_image \
|
||||||
# hilditch_thin \
|
# hilditch_thin \
|
||||||
# hough_lines_detection \
|
# hough_lines_detection \
|
||||||
# license_plate_detection \
|
# license_plate_detection \
|
||||||
# minutiae \
|
# minutiae \
|
||||||
# otsu_image \
|
# otsu_image \
|
||||||
# realnet_face_detection \
|
# realnet_face_detection \
|
||||||
# realnet_face_detection_embedded \
|
# realnet_face_detection_embedded \
|
||||||
# realnet_train_model \
|
# realnet_train_model \
|
||||||
# resize_image \
|
# resize_image \
|
||||||
# rnn_text_gen \
|
# rnn_text_gen \
|
||||||
# rotate_image \
|
# rotate_image \
|
||||||
# sobel_operator_img
|
# sobel_operator_img
|
||||||
|
|
||||||
all: clean dir copy
|
all: dir copy
|
||||||
|
|
||||||
dir:
|
dir:
|
||||||
mkdir -p bin/
|
@mkdir -p bin/
|
||||||
|
|
||||||
copy:
|
copy:
|
||||||
cp samples/*.png bin/
|
cp samples/*.png bin/
|
||||||
cp samples/*.jpg bin/
|
cp samples/*.jpg bin/
|
||||||
|
|
||||||
.PHONY: samples.wasm
|
.PHONY: samples.wasm
|
||||||
samples.wasm: resize_image.wasm license_plate_detection.wasm
|
samples.wasm: resize_image.wasm license_plate_detection.wasm
|
||||||
|
|
||||||
.PHONY: samples.so
|
.PHONY: samples.so
|
||||||
samples.so: resize_image.so license_plate_detection.so
|
samples.so: resize_image.so license_plate_detection.so
|
||||||
|
|
||||||
.PHONY: samples.out
|
.PHONY: samples.out
|
||||||
samples.out: resize_image.out license_plate_detection.out
|
samples.out: resize_image.out license_plate_detection.out
|
||||||
|
|
||||||
%.wasm: samples/%.c
|
%.wasm: samples/%.c
|
||||||
$(WASM_CC) $(WASM_CFLAGS) $(OPTFLAGS) sod.c $< $(DUMMY) -o bin/$@
|
@$(WASM_CC) $(WASM_CFLAGS) $(OPTFLAGS) sod.c $< $(DUMMY) -o bin/$@
|
||||||
|
|
||||||
%.out: %.wasm
|
%.out: %.wasm
|
||||||
$(AWSM_CC) $< -o $(<:.wasm=.bc)
|
@$(AWSM_CC) $< -o $(<:.wasm=.bc)
|
||||||
$(NATIVE_CC) ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -DUSE_MEM_VM bin/$(<:.wasm=.bc) $(AWSM_RT_LIBC) $(AWSM_RT_RT) $(AWSM_RT_ENV) $(AWSM_RT_MEMC) -o $@
|
@$(NATIVE_CC) ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -DUSE_MEM_VM bin/$(<:.wasm=.bc) $(AWSM_RT_LIBC) $(AWSM_RT_RT) $(AWSM_RT_ENV) $(AWSM_RT_MEMC) -o $@
|
||||||
|
|
||||||
%.so: %.wasm
|
%.so: %.wasm
|
||||||
$(AWSM_CC) --inline-constant-globals --runtime-globals bin/$< -o bin/$(@:.so=.bc)
|
@$(AWSM_CC) --inline-constant-globals --runtime-globals bin/$< -o bin/$(@:.so=.bc)
|
||||||
$(NATIVE_CC) --shared -fPIC ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -DUSE_MEM_VM -I${SLEDGE_RT_INC} bin/$(@:.so=.bc) $(WASMISA) ${SLEDGE_MEMC} -o bin/$@
|
@$(NATIVE_CC) --shared -fPIC ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -DUSE_MEM_VM -I${SLEDGE_RT_INC} bin/$(@:.so=.bc) $(WASMISA) ${SLEDGE_MEMC} -o bin/$@
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f bin/*
|
rm -f bin/*
|
||||||
rm -f *.wasm
|
rm -f *.wasm
|
||||||
rm -f *.bc
|
rm -f *.bc
|
||||||
rm -f *.so
|
rm -f *.so
|
||||||
rm -f *.out
|
rm -f *.out
|
||||||
|
Loading…
Reference in new issue