@@ -16,7 +16,7 @@ CXXFLAGS=-std=c++17 -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I. -Iunittest_l
1616CFLAGS =-Ofast -march=native -I. -Iunittest_llmc
1717# CFLAGS=-O2 -march=native -I. -Iunittest_llmc
1818
19- LDFLAGS =$(STDLIB ) -L$(GPUCPP ) /third_party/lib -ldl -ldawn
19+ LDFLAGS =$(STDLIB ) -L$(GPUCPP ) /third_party/lib -ldl -ldawn -fsanitize=address
2020FLAGS =$(CXXFLAGS ) $(LDFLAGS )
2121
2222ifeq ($(shell [ -d /opt/homebrew/opt/libomp/lib ] && echo "exists") , exists)
@@ -103,6 +103,10 @@ build/gpt2_webgpu: llm.c gpt2_124M.bin llm.c gpt2_webgpu.cpp ops.cpp
103103 mkdir -p build
104104 $(CC ) $(CXXFLAGS ) -Illm.c $(LDFLAGS ) -o $@ gpt2_webgpu.cpp ops.cpp
105105
106+ build/gpt2_webgpu_aot : llm.c gpt2_124M.bin llm.c gpt2_webgpu_aot.cpp ops_aot.cpp
107+ mkdir -p build
108+ $(CC ) $(CXXFLAGS ) -Illm.c $(LDFLAGS ) -o $@ gpt2_webgpu_aot.cpp ops_aot.cpp -g
109+
106110build/gpt2_webgpu.html : check-emsdk gpt2_webgpu.cpp term.html llm.c
107111 em++ gpt2_webgpu.cpp ops.cpp \
108112 --preload-file gpt2_tokenizer.bin@/gpt2_tokenizer.bin \
@@ -120,8 +124,8 @@ watch-web:
120124watch-native :
121125 ls * .cpp * .c * .hpp * .h | entr -s " rm -f build/gpt2_webgpu && rm -f build/ops.o && make build/gpt2_webgpu"
122126
123- run-native : build/gpt2_webgpu
124- . $(GPUCPP ) /source && ./build/gpt2_webgpu
127+ run-native : build/gpt2_webgpu_aot
128+ . $(GPUCPP ) /source && ./build/gpt2_webgpu_aot
125129
126130# server: build/train_gpt2.html build/test_gpt2.html build/gpt2_gpucpp.html
127131server : build/gpt2_webgpu.html
0 commit comments