Skip to content

Commit 6104b8d

Browse files
committed
Added Makefile.hip.isa to generate device ISA files for checking register usage
1 parent 5f37a97 commit 6104b8d

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

src/Makefile.hip.isa

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
include configs/make.hip.isa
2+
builddir=./
3+
ifdef EXTRA_CXX_FLAGS
4+
CXXFLAGS2 += $(EXTRA_CXX_FLAGS2)
5+
CXXFLAGS += $(EXTRA_CXX_FLAGS)
6+
endif
7+
8+
ifdef EXTRA_LINK_FLAGS
9+
linklibs += $(EXTRA_LINK_FLAGS)
10+
endif
11+
12+
OBJSW4 =
13+
14+
OBJ = curvitest.o curvilinear4sgc.o Events.o
15+
16+
17+
# prefix object files with build directory
18+
FSW4 = $(addprefix $(builddir)/,$(OBJSW4))
19+
FOBJ = $(addprefix $(builddir)/,$(OBJ)) $(addprefix $(builddir)/,$(QUADPACK))
20+
21+
# prefix
22+
sw4ck: $(FSW4) $(FOBJ)
23+
@echo "*** Configuration file: '" $(foundincfile) "' ***"
24+
@echo "********* User configuration variables **************"
25+
@echo "debug=" $(debug) " proj=" $(proj) " etree=" $(etree) " SW4ROOT"= $(SW4ROOT)
26+
@echo "CXX=" $(CXX) "EXTRA_CXX_FLAGS"= $(EXTRA_CXX_FLAGS)
27+
@echo "FC=" $(FC) " EXTRA_FORT_FLAGS=" $(EXTRA_FORT_FLAGS)
28+
@echo "EXTRA_LINK_FLAGS"= $(EXTRA_LINK_FLAGS)
29+
@echo "******************************************************"
30+
cd $(builddir); $(LINKER) $(LINKFLAGS) -o $@ $(OBJ) $(linklibs)
31+
# test: linking with openmp for the routine rhs4sgcurv.o
32+
# cd $(builddir); $(CXX) $(CXXFLAGS) -qopenmp -o $@ main.o $(OBJ) $(QUADPACK) $(linklibs)
33+
@echo "*** Build directory: " $(builddir) " ***"
34+
35+
$(builddir)/%.o:./%.C
36+
cd $(builddir); $(CXX) $(CXXFLAGS) -c $<
37+
38+
clean:
39+
rm sw4ck *.o *.bc *.s *.cui
40+
41+
format:
42+
clang-format -style Google -i src/*.C
43+
clang-format -style Google -i src/*.h
44+
45+
tags:
46+
etags -o src/TAGS src/*.C src/*.h

src/configs/make.hip.isa

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#use make -f Makefile.hipcc
2+
LINKER = hipcc
3+
CXX = $(PREP) hipcc
4+
RAJA_LOCATION = /home/users/coe0145/RAJA/Dev2/raja/install_90a
5+
6+
HIP_ROOT_DIR = $(HIP_PATH)
7+
8+
HSA_ROOT_DIR = ${ROCM_PATH}/hsa
9+
10+
GCC_LINK_LINE = -L $(HIP_ROOT_DIR)/lib -L $(HSA_ROOT_DIR)/lib -lhsa-runtime64 -lm -lstdc++ -ldl
11+
12+
13+
MORE_FLAGS = -I${ROCM_PATH}/include -isystem ${ROCM_PATH}/llvm/lib/clang/12.0.0/include/.. -isystem ${ROCM_PATH}/hsa/include -isystem ${ROCM_PATH}/hip/include -D__HIP_ARCH_GFX90a__=1 --cuda-gpu-arch=gfx90a -O3 -x hip -Winconsistent-missing-override --amdgpu-target=gfx90a --save-temps -DNO_RAJA=1 -Wall -Wno-unknown-pragmas
14+
LINKFLAGS = -std=c++11 --amdgpu-target=gfx90a
15+
EXTRA_CXX_FLAGS = -O3 -x hip -std=c++11 -I$(RAJA_LOCATION)/include -DENABLE_HIP $(MORE_FLAGS) -Winconsistent-missing-override
16+
17+
EXTRA_CXX_FLAGS2 = -O3 -std=c++11 -I $(CUDA_HOME)/include -I$(RAJA_LOCATION)/include -DRAJA_USE_RESTRICT_PTR -DCUDA_CODE -DENABLE_HIP $(MORE_FLAGS)
18+
19+
EXTRA_LINK_FLAGS = -L $(RAJA_LOCATION)/lib $(GCC_LINK_LINE)

0 commit comments

Comments
 (0)