-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 934 Bytes
/
Makefile
File metadata and controls
28 lines (20 loc) · 934 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
26
27
28
# Set up compiler, just compile a .ptx for the lowest arch possible. It does not matter as we are interested in SASS.
CC=cc
NVCC=/usr/local/cuda/bin/nvcc
NVDISASM=/usr/local/cuda/bin/nvdisasm
PYTHON=python3
architectures=sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86 sm_90
targets = $(architectures:=_instructions.txt) $(architectures:=_latencies.txt)
all: $(targets)
clean:
-rm -f $(targets)
# Generate the SASS versions.
%.cubin: example.cu
$(NVCC) -o $@ -arch=$(basename $@) -cubin $<
%.so: %.c
$(CC) -fPIC -shared -o $@ $< -ldl
# Not sure if the OMP things are needed, same with the flushing of stdout. We pipe it through strings to get only readable parts.
%_intercept.txt: %.cubin intercept.so
OMP_NUM_THREADS=1 OMP_THREAD_LIMIT=1 LD_PRELOAD=./intercept.so $(NVDISASM) $< | strings -n 1 > $@
%_instructions.txt %_latencies.txt: %_intercept.txt
$(PYTHON) funnel.py $<