forked from AnswerDotAI/gpu.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (19 loc) · 712 Bytes
/
Makefile
File metadata and controls
25 lines (19 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CXX=clang++
PYTHON=python3
GPUCPP ?= $(PWD)/../..
LIBDIR ?= $(GPUCPP)/third_party/lib
LIBSPEC ?= . $(GPUCPP)/source
ifeq ($(shell $(CXX) -std=c++17 -x c++ -E -include array - < /dev/null > /dev/null 2>&1 ; echo $$?),0)
STDLIB :=
else
STDLIB := -stdlib=libc++
endif
FLAGS=-shared -fPIC -std=c++17 $(STDLIB) -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I$(GPUCPP)/third_party/headers/webgpu -L$(GPUCPP)/third_party/lib -lwebgpu_dawn \
`python3 -m pybind11 --includes` \
`python3-config --includes --ldflags`
SUFFIX=$(shell $(PYTHON)-config --extension-suffix)
gpu_cpp$(SUFFIX): gpu_cpp.cpp
$(CXX) $(FLAGS) -o $@ $<
test: test_gpu_cpp.py gpu_cpp$(SUFFIX)
$(PYTHON) test_gpu_cpp.py
.PHONY: test