mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Legacy build_dbcsr cleanup (#3319)
This commit is contained in:
parent
ae6dcbd3af
commit
b59d163280
3 changed files with 27 additions and 35 deletions
|
|
@ -51,6 +51,7 @@ FYPPEXE := $(TOOLSDIR)/build_utils/fypp/bin/fypp
|
|||
SRCDIR := $(DBCSRHOME)/src
|
||||
TESTSDIR := $(DBCSRHOME)/tests
|
||||
ARCHFILE :=
|
||||
CXXSTD := -std=c++14
|
||||
|
||||
PYTHON := /usr/bin/env python3
|
||||
|
||||
|
|
@ -103,25 +104,29 @@ endif
|
|||
|
||||
# Set ACCFLAGS ==============================================================
|
||||
|
||||
# Adjust C++ standard level
|
||||
override ACCFLAGS := $(CXXSTD) $(filter-out -std=c++11,$(ACCFLAGS))
|
||||
|
||||
# If compiling with nvcc
|
||||
ifeq (cuda,$(USE_ACCEL))
|
||||
override ACCFLAGS += -D__CUDA
|
||||
FCFLAGS += -D__CUDA
|
||||
CXXFLAGS += -D__CUDA
|
||||
override ACCFLAGS := -D__CUDA -DARCH_NUMBER=$(ARCH_NUMBER) $(filter-out -D__CUDA,$(ACCFLAGS))
|
||||
CXXFLAGS := -D__CUDA $(filter-out -D__CUDA,$(CXXFLAGS))
|
||||
FCFLAGS := -D__CUDA $(filter-out -D__CUDA,$(FCFLAGS))
|
||||
#if "-arch" has not yet been set in ACCFLAGS
|
||||
ifeq (,$(findstring -arch,$(ACCFLAGS)))
|
||||
override ACCFLAGS += -arch sm_$(ARCH_NUMBER)
|
||||
override ACCFLAGS := -arch sm_$(ARCH_NUMBER) $(ACCFLAGS)
|
||||
endif
|
||||
ifeq (,$(findstring -Xcompiler,$(ACCFLAGS)))
|
||||
override ACCFLAGS += -Xcompiler="$(CXXFLAGS)"
|
||||
override ACCFLAGS := $(ACCFLAGS) -Xcompiler="$(CXXFLAGS)"
|
||||
endif
|
||||
# If compiling with hipcc
|
||||
else ifeq (hip,$(USE_ACCEL))
|
||||
override ACCFLAGS += -D__HIP
|
||||
FCFLAGS += -D__HIP
|
||||
override ACCFLAGS := -D__HIP -DARCH_NUMBER=$(ARCH_NUMBER) $(filter-out -D__HIP,$(ACCFLAGS))
|
||||
CXXFLAGS := -D__HIP $(filter-out -D__HIP,$(CXXFLAGS))
|
||||
FCFLAGS := -D__HIP $(filter-out -D__HIP,$(FCFLAGS))
|
||||
# OpenCL backend
|
||||
else ifeq (opencl,$(USE_ACCEL))
|
||||
CFLAGS := $(if $(ACCFLAGS),$(ACCFLAGS),$(CFLAGS)) -D__OPENCL
|
||||
CFLAGS := -D__OPENCL $(filter-out -D__OPENCL $(CXXSTD),$(if $(ACCFLAGS),$(ACCFLAGS),$(CFLAGS)))
|
||||
endif
|
||||
|
||||
# Set the configuration =====================================================
|
||||
|
|
@ -261,41 +266,29 @@ FYPPFLAGS ?= -n
|
|||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# Compile the CUDA/HIP files
|
||||
ifneq ($(ACC),)
|
||||
# if compiling CUDA/HIP backend
|
||||
ifneq (opencl,$(USE_ACCEL))
|
||||
%.o: %.cpp
|
||||
%.o: %.cpp parameters.h smm_acc_kernels.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
libsmm_acc.o: libsmm_acc.cpp parameters.h smm_acc_kernels.h
|
||||
$(ACC) -c $(ACCFLAGS) -DARCH_NUMBER=$(ARCH_NUMBER) $<
|
||||
libsmm_acc_benchmark.o: libsmm_acc_benchmark.cpp parameters.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
libsmm_acc_init.o: libsmm_acc_init.cpp libsmm_acc_init.h parameters.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
endif
|
||||
endif
|
||||
|
||||
# if compiling CUDA backend
|
||||
ifneq ($(ACC),)
|
||||
ifeq (cuda,$(USE_ACCEL))
|
||||
calculate_norms.o: calculate_norms.cpp
|
||||
$(ACC) -x cu -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
%.o: %.cpp
|
||||
%.o: %.cu parameters.h smm_acc_kernels.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
calculate_norms.o: calculate_norms.cpp
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' -x cu $<
|
||||
acc_cuda.o: acc_cuda.cpp acc_cuda.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
%.o: %.cu
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
# if compiling HIP backend
|
||||
else ifeq (hip,$(USE_ACCEL))
|
||||
else
|
||||
calculate_norms.o: calculate_norms.cpp
|
||||
$(OFFLOAD_CC) -D__HIP -c $(OFFLOAD_FLAGS) -I'$(SRCDIR)' $<
|
||||
%.o: %.cpp
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
acc_hip.o: acc_hip.cpp acc_hip.h
|
||||
$(ACC) -c $(ACCFLAGS) -I'$(SRCDIR)' $<
|
||||
endif
|
||||
|
||||
# if compiling OpenCL backend
|
||||
else ifeq (opencl,$(USE_ACCEL))
|
||||
else
|
||||
OPENCL_KRNLGEN := $(LIBSMM_ACC_ABS_DIR)/../opencl/acc_opencl.sh
|
||||
OPENCL_KERNELS := $(wildcard $(LIBSMM_ACC_ABS_DIR)/../opencl/smm/kernels/*.cl)
|
||||
OPENCL_DEFAULT := $(wildcard $(LIBSMM_ACC_ABS_DIR)/../opencl/smm/tune_multiply.csv)
|
||||
|
|
|
|||
|
|
@ -331,20 +331,20 @@ CONTAINS
|
|||
END DO
|
||||
DEALLOCATE (f_envs)
|
||||
|
||||
! Finalize libraries (Offload)
|
||||
CALL dbm_library_finalize()
|
||||
|
||||
CALL grid_library_finalize()
|
||||
|
||||
! Finalize the DBCSR configuration
|
||||
CALL dbcsr_finalize_lib()
|
||||
CALL pw_gpu_finalize()
|
||||
! Finalize the DBCSR library
|
||||
CALL dbcsr_finalize_lib()
|
||||
|
||||
CALL mp_para_env_release(default_para_env)
|
||||
ierr = 0
|
||||
CALL cp_rm_default_logger()
|
||||
|
||||
CALL cp_dlaf_finalize()
|
||||
|
||||
! *** deallocate the bibliography ***
|
||||
! Deallocate the bibliography
|
||||
CALL remove_all_references()
|
||||
CALL rm_timer_env()
|
||||
CALL rm_mp_perf_env()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ FCDEBFLAGS = ${FCDEBFLAGS}
|
|||
CFLAGS = ${CFLAGS}
|
||||
CXXFLAGS = ${CXXFLAGS}
|
||||
FCFLAGS = ${FCFLAGS}
|
||||
CXXFLAGS = ${CXXFLAGS}
|
||||
#
|
||||
LDFLAGS = ${LDFLAGS}
|
||||
LDFLAGS_C = ${LDFLAGS_C}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue