Adjust Makefiles & source

oacc_loloum
sfilippone 6 months ago
parent e3a3e39caf
commit 93c9df0277

@ -1,11 +1,10 @@
.SUFFIXES: include ../Make.inc
.SUFFIXES: .F90 .f90 .o .s .c
# Compilers and flags # Compilers and flags
CC=mpicc #CC=mpicc
FC=mpif90 #FC=mpif90
FCOPT=-O0 -march=native #FCOPT=-O0 -march=native
OFFLOAD=-fopenacc -foffload=nvptx-none="-march=sm_70" #OFFLOAD=-fopenacc -foffload=nvptx-none="-march=sm_70"
# Directories # Directories
LIBDIR=../lib LIBDIR=../lib
@ -14,35 +13,49 @@ MODDIR=../modules
IMPLDIR=./impl # Adding the impl directory IMPLDIR=./impl # Adding the impl directory
# Include and library paths # Include and library paths
INCLUDES=-I$(LIBDIR) -I$(INCDIR) -I$(MODDIR) -I$(IMPLDIR) INCLUDES=-I$(LIBDIR) -I$(INCDIR) -I$(MODDIR)
LIBS=-L$(LIBDIR) -lpsb_util -lpsb_ext -lpsb_base -lopenblas -lmetis FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCDIR) $(FMFLAG)$(MODDIR) $(FIFLAG).
CINCLUDES=
#LIBS=-L$(LIBDIR) -lpsb_util -lpsb_ext -lpsb_base -lopenblas -lmetis
# Source files # Source files
FOBJS= psb_i_oacc_vect_mod.o psb_d_oacc_vect_mod.o \ FOBJS= psb_i_oacc_vect_mod.o psb_d_oacc_vect_mod.o \
psb_oacc_mod.o psb_d_oacc_csr_mat_mod.o \ psb_oacc_mod.o psb_d_oacc_csr_mat_mod.o
impl/psb_d_oacc_csr_vect_mv.o
# Library name # Library name
LIBNAME=libpsb_openacc.a LIBNAME=libpsb_openacc.a
# Rules OBJS=$(COBJS) $(FOBJS)
all: $(LIBNAME)
$(LIBNAME): $(FOBJS) # Rules
ar cr $(LIBNAME) $(FOBJS) lib: objs ilib
ar cur $(LIBNAME) $(OBJS)
/bin/cp -p $(LIBNAME) $(LIBDIR) /bin/cp -p $(LIBNAME) $(LIBDIR)
clean: objs: $(OBJS) iobjs
/bin/rm -fr *.o $(LIBNAME) *.mod impl/*.o /bin/cp -p *$(.mod) $(MODDIR)
.f90.o: iobjs: $(OBJS)
$(FC) $(FCOPT) $(OFFLOAD) $(INCLUDES) -c $< -o $@ $(MAKE) -C impl objs
.c.o: ilib: $(OBJS)
$(CC) -c $< -o $@ $(MAKE) -C impl lib
.F90.o: psb_oacc_mod.o : psb_i_oacc_vect_mod.o psb_d_oacc_vect_mod.o \
$(FC) $(FCOPT) $(OFFLOAD) $(INCLUDES) -c $< -o $@ psb_d_oacc_csr_mat_mod.o
clean: cclean iclean
/bin/rm -f $(FOBJS) *$(.mod) *.a
veryclean: clean
cclean:
/bin/rm -f $(COBJS)
iclean:
$(MAKE) -C impl clean
.F90.s: .c.o:
$(FC) $(FCOPT) $(INCLUDES) -c -S $< -o $@ $(CC) $(CCOPT) $(CCOPENACC) $(CINCLUDES) $(CDEFINES) -c $< -o $@
.f90.o:
$(FC) $(FCOPT) $(FCOPENACC) $(FINCLUDES) -c $< -o $@
.F90.o:
$(FC) $(FCOPT) $(FCOPENACC) $(FINCLUDES) $(FDEFINES) -c $< -o $@
.cpp.o:
$(CXX) $(CXXOPT) $(CXXOPENACC) $(CXXINCLUDES) $(CXXDEFINES) -c $< -o $@

@ -3,7 +3,7 @@ module psb_d_oacc_csr_mat_mod
use iso_c_binding use iso_c_binding
use psb_d_mat_mod use psb_d_mat_mod
use psb_d_oacc_vect_mod use psb_d_oacc_vect_mod
use oaccsparse_mod !use oaccsparse_mod
integer(psb_ipk_), parameter, private :: is_host = -1 integer(psb_ipk_), parameter, private :: is_host = -1
integer(psb_ipk_), parameter, private :: is_sync = 0 integer(psb_ipk_), parameter, private :: is_sync = 0

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save