-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile_hip
59 lines (51 loc) · 1.36 KB
/
Makefile_hip
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ifeq (x$(HIP_PATH),x)
HIP_PATH=
endif
HIPCC=hipcc
HIPCCOPT=\
-O3 \
-fno-strict-aliasing \
-fopenmp \
-Wall \
-mfma \
-fvectorize \
-fgpu-sanitize \
-Rpass-analysis=kernel-resource-usage \
-fhip-fp32-correctly-rounded-divide-sqrt \
-Wno-unused-result \
-Wno-unused-variable
# AMD Instinct MI100
#HIPCCOPT:= $(HIPCCOPT) \
# --offload-arch=gfx908 -D__GFX9__
# AMD Instinct MI2X0
#HIPCCOPT:= $(HIPCCOPT) \
# --offload-arch=gfx90a -D__GFX9__
# AMD Instinct MI300x
#HIPCCOPT:= $(HIPCCOPT) \
# --offload-arch=gfx942 -D__GFX9__
# AMD Instinct RDNA2
#HIPCCOPT:= $(HIPCCOPT) \
# --offload-arch=gfx1030,gfx1031,gfx1032,gfx1033 -D__GFX10__
# AMD Instinct RDNA3
HIPCCOPT:= $(HIPCCOPT) \
--offload-arch=gfx1100,gfx1101,gfx1102,gfx1103 -D__GFX11__
OBJS = main.o eigen_GPU_check.o
OBJSS = $(OBJS) eigen_GPU_batch.o
LIBS = libeigenGbatch.a
LIBOPT = -leigenGbatch
all: a.out $(LIBS)
a.out : $(OBJSS) $(LIBS)
$(HIPCC) -o $@ $(OBJSS) $(HIPCCOPT) -L./ -lhipsolver -lm -lgomp
cp a.out a.out-hip
main.o: main.cpp
$(HIPCC) -c -o $@ $< $(HIPCCOPT) -DPRINT_DIAGNOSTIC=0
libeigenGbatch.a: eigen_GPU_batch.o
ar cr libeigenGbatch.a $<
ranlib libeigenGbatch.a
eigen_GPU_batch.o: eigen_GPU_batch.cu
$(HIPCC) -c -o $@ $< $(HIPCCOPT)
$(HIPCC) -S $< $(HIPCCOPT)
eigen_GPU_check.o: eigen_GPU_check.cu
$(HIPCC) -c -o $@ $< $(HIPCCOPT)
clean:
-\rm a.out a.out-* *.o *.cu_o *.ptx lib*.a