From cfe22bca6edd08094698112abcb3b53fbaa40305 Mon Sep 17 00:00:00 2001 From: Mike Wall Date: Thu, 12 Aug 2021 13:39:40 -0400 Subject: [PATCH] Modification to enable Cray fortran build Change parameter alpha to a variable in scale_matrix_typed.F90. This enables the test code to build using CCE 12 Cray fortran. Also tidy up the Spock offload build script in a minor way. --- scripts/build_spock_offload_cce.sh | 3 +-- tests/Fortran-tests/scale_matrix_typed.F90 | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build_spock_offload_cce.sh b/scripts/build_spock_offload_cce.sh index c8f6c5321..e2345e47d 100644 --- a/scripts/build_spock_offload_cce.sh +++ b/scripts/build_spock_offload_cce.sh @@ -13,12 +13,11 @@ export CXX=${CXX:=CC} export BLAS_VENDOR=${BLAS_VENDOR:=Auto} export BML_OPENMP=${BML_OPENMP:=yes} export INSTALL_DIR=${INSTALL_DIR:="${MY_PATH}/install"} -export BML_MAGMA=${BML_MAGMA:=yes} +export BML_MAGMA=${BML_MAGMA:=no} export MAGMA_ROOT=${MAGMA_HOME} export BML_TESTING=${BML_TESTING:=yes} export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release} export CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS:="-ef -DCRAY_SDK"} -#export EXTRA_CFLAGS=${EXTRA_CFLAGS:="-Ofast -DUSE_OMP_OFFLOAD -DCRAY_SDK"} export CMAKE_C_FLAGS=${CMAKE_C_FLAGS:="-Ofast -DUSE_OMP_OFFLOAD -DCRAY_SDK"} export EXTRA_LINK_FLAGS=${EXTRA_LINK_FLAGS:="-L${LIBSCI_BASE_DIR}/cray/9.0/x86_64/lib"} diff --git a/tests/Fortran-tests/scale_matrix_typed.F90 b/tests/Fortran-tests/scale_matrix_typed.F90 index 49bbf5d4b..6e1cde9e2 100644 --- a/tests/Fortran-tests/scale_matrix_typed.F90 +++ b/tests/Fortran-tests/scale_matrix_typed.F90 @@ -18,7 +18,7 @@ function test_scale_matrix_typed(matrix_type, element_kind, element_precision, n integer, intent(in) :: n, m logical :: test_result - real(DUMMY_PREC), parameter :: alpha = 1.2_MP + real(DUMMY_PREC) :: alpha real(DUMMY_PREC) :: abs_tol type(bml_matrix_t) :: a @@ -27,6 +27,8 @@ function test_scale_matrix_typed(matrix_type, element_kind, element_precision, n DUMMY_KIND(DUMMY_PREC), allocatable :: a_dense(:, :) DUMMY_KIND(DUMMY_PREC), allocatable :: c_dense(:, :) + alpha = 1.2_MP + if(element_precision == sp)then abs_tol = 1e-6 elseif(element_precision == dp)then