Commit df25e996 authored by Daniel Wortmann's avatar Daniel Wortmann

Adding a CPP_MANAGED preprocessor macro to avoid some of these #ifdef CPP_GPU stuff

parent d4cd3fdb
......@@ -15,8 +15,8 @@ if (CLI_FLEUR_USE_GPU)
elseif(${CLI_FLEUR_USE_GPU} MATCHES "emu")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas -Minfo=accel ")
endif()
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=',MANAGED'")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=',MANAGED'")
#Now check for cusolverDN library
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda")
try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c
......@@ -29,4 +29,6 @@ if (CLI_FLEUR_USE_GPU)
endif()
else()
set(FLEUR_USE_GPU FALSE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MANAGED=''")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_MANAGED=''")
endif()
......@@ -12,13 +12,8 @@ MODULE m_types_mat
LOGICAL :: l_real !>Store either real or complex data
INTEGER :: matsize1=-1 !> matsize1=size(data_?,1),i.e. no of rows
INTEGER :: matsize2=-1 !> matsize2=size(data_?,2),i.e. no of columns
#ifdef CPP_GPU
REAL,MANAGED,ALLOCATABLE :: data_r(:,:)
COMPLEX,MANAGED,ALLOCATABLE :: data_c(:,:)
#else
REAL,ALLOCATABLE :: data_r(:,:)
COMPLEX,ALLOCATABLE :: data_c(:,:)
#endif
REAL,ALLOCATABLE CPP_MANAGED :: data_r(:,:)
COMPLEX,ALLOCATABLE CPP_MANAGED :: data_c(:,:)
CONTAINS
PROCEDURE :: alloc => t_mat_alloc !> allocate the data-arrays
PROCEDURE :: multiply=>t_mat_multiply !> do a matrix-matrix multiply
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment