diff --git a/.gitignore b/.gitignore index cb86d63..bec17ed 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,8 @@ # output files *.out + +# CI temporary things +ci/build* +ci/install* +ci/output* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a43ac0b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,117 @@ +cmake_minimum_required(VERSION 3.12) +set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + +project(FLCL VERSION 0.1.0 LANGUAGES Fortran C CXX) + +set(default_build_type "RelWithDebInfo") +set(BUILD_SHARED_LIBS OFF) + +include(CMakeDetermineFortranCompiler) +include(CMakeDetermineCCompiler) +include(CMakeDetermineCXXCompiler) + +find_package(Kokkos REQUIRED) + +include(CheckFortranCompilerFlag) +include(CheckCXXCompilerFlag) +include(CheckCCompilerFlag) + +# use, i.e. don't skip the full RPATH for the build tree +#set(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +#set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +#set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# the RPATH to be used when installing, but only if it's not a system directory +#list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) +#if("${isSystemDir}" STREQUAL "-1") +# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") +#endif("${isSystemDir}" STREQUAL "-1") + +add_link_options(LINKER:--disable-new-dtags) + + +add_library(flcl-fortran + OBJECT + src/flcl-util-strings-f.f90 + src/flcl-f.f90 + src/flcl-util-kokkos-f.f90 +) +target_include_directories(flcl-fortran + PUBLIC + $ + INTERFACE + $ + $ +) +set_target_properties( + flcl-fortran + PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mod" +) + +add_library(flcl-cxx + OBJECT + src/flcl-cxx.cpp + src/flcl-util-cxx.cpp +) +target_link_libraries(flcl-cxx + PRIVATE + Kokkos::kokkos +) + +add_library(FLCL + STATIC + $ + $ +) +target_include_directories(FLCL + INTERFACE + $ + $ +) +target_link_libraries(FLCL + INTERFACE + Kokkos::kokkos +) +add_library(FLCL::flcl ALIAS FLCL) + +include(CMakePackageConfigHelpers) + +write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/flclConfigVersion.cmake" + COMPATIBILITY SameMinorVersion +) + +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/flclConfig.cmake.in" + "${PROJECT_BINARY_DIR}/flclConfig.cmake" + INSTALL_DESTINATION lib/cmake/flcl +) + +install( + FILES + "${PROJECT_BINARY_DIR}/flclConfigVersion.cmake" + "${PROJECT_BINARY_DIR}/flclConfig.cmake" + DESTINATION lib/cmake/flcl +) + +install(TARGETS FLCL EXPORT flclTargets) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION .) +install( + EXPORT flclTargets + DESTINATION lib/cmake/flcl + NAMESPACE FLCL::) + +include(CTest) +add_subdirectory(test) + + + diff --git a/build/Makefile b/build/Makefile deleted file mode 100644 index c9af690..0000000 --- a/build/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (c) 2019. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for -# Los Alamos National Laboratory (LANL), which is operated by Triad National -# Security, LLC for the U.S. Department of Energy/National Nuclear Security -# Administration. All rights in the program are reserved by Triad National -# Security, LLC, and the U.S. Department of Energy/National Nuclear Security -# Administration. The Government is granted for itself and others acting on -# its behalf a nonexclusive, paid-up, irrevocable worldwide license in this -# material to reproduce, prepare derivative works, distribute copies to the -# public, perform publicly and display publicly, and to permit others to do so. -# -# This program is open source under the BSD-3 License. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#CXX=gcc -#FC=gfortran -#CXX=icpc -#FC=ifort - -include $(KOKKOS_ROOT)/Makefile.kokkos - -KOKKOS_INC= $(KOKKOS_CXXFLAGS) -KOKKOS_LIB=-L $(KOKKOS_ROOT)/lib $(KOKKOS_CXXLDFLAGS) $(KOKKOS_LIBS) $(KOKKOS_LINK_FLAGS) - -OMP = -fopenmp -#DEBUG = -g -DEBUG = -SRCDIR=../src -TESTSRCDIR=../test - -ifeq ($(FC),ifort) - FSTD = -std08 -endif -ifeq ($(FC),gfortran) - FSTD = -std=f2008 -endif - -ifeq ($(KOKKOS_DEVICES),Cuda) - CXX=$(NVCC_WRAPPER) -endif - -all: libflcl.a - -flcl-cxx.o: $(SRCDIR)/flcl-cxx.cpp $(SRCDIR)/flcl-cxx.hpp - $(CXX) $(DEBUG) -I$(SRCDIR)/ $(KOKKOS_INC) -c $(SRCDIR)/flcl-cxx.cpp - -flcl-f.o: $(SRCDIR)/flcl-f.f90 - $(FC) $(FSTD) $(DEBUG) -I$(SRCDIR)/ -c $(SRCDIR)/flcl-f.f90 - -flcl-util-cxx.o: $(SRCDIR)/flcl-util-cxx.cpp $(SRCDIR)/flcl-util-cxx.h - $(CXX) $(DEBUG) -I$(SRCDIR)/ $(KOKKOS_INC) -c $(SRCDIR)/flcl-util-cxx.cpp - -flcl-util-f.o: $(SRCDIR)/flcl-util-f.f90 $(SRCDIR)/flcl-f.f90 - $(FC) $(FSTD) $(DEBUG) -I$(SRCDIR)/ -c $(SRCDIR)/flcl-util-f.f90 - -libflcl.a: flcl-f.o flcl-cxx.o flcl-util-f.o flcl-util-cxx.o - ar rcs libflcl.a flcl-f.o flcl-cxx.o flcl-util-f.o flcl-util-cxx.o - -test-flcl-cxx.o: $(TESTSRCDIR)/test-flcl-cxx.cpp - $(CXX) $(DEBUG) -I$(SRCDIR) -I$(TESTSRCDIR)/ $(KOKKOS_INC) -c $(TESTSRCDIR)/test-flcl-cxx.cpp - -test-flcl-f.o: flcl-f.o $(TESTSRCDIR)/test-flcl-f.f90 - $(FC) $(FSTD) $(DEBUG) -I$(TESTSRCDIR)/ -c $(TESTSRCDIR)/test-flcl-f.f90 - -test-flcl-main.o: flcl-f.o test-flcl-f.o $(TESTSRCDIR)/test-flcl-f.f90 flcl-util-f.o - $(FC) $(FSTD) $(DEBUG) -I$(TESTSRCDIR)/ -c $(TESTSRCDIR)/test-flcl-main.f90 - -test-flcl.x: test-flcl-cxx.o test-flcl-f.o test-flcl-main.o libflcl.a - $(FC) $(FSTD) $(DEBUG) -I$(TESTSRCDIR)/ test-flcl-cxx.o test-flcl-f.o test-flcl-main.o -L. -lflcl $(KOKKOS_LIB) -lstdc++ -o test-flcl.x - -clean: - rm -f ./*.o ./*.x ./*.mod ./*.out ./libflcl.a diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.0.sh new file mode 100755 index 0000000..ed2fa2c --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-cuda-10.1/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-cuda-10.1 +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-cuda-10.1 +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.1.1.sh new file mode 100755 index 0000000..a08d600 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-cuda-10.1/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-cuda-10.1 +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-cuda-10.1 +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.0.sh new file mode 100755 index 0000000..4eca006 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-cuda-10.1-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-cuda-10.1-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-cuda-10.1-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest -V \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh new file mode 100755 index 0000000..37a8b15 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-cuda-10.1-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-cuda-10.1-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-cuda-10.1-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest -V \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.0.sh new file mode 100755 index 0000000..d6ff16e --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.1.1.sh new file mode 100755 index 0000000..e2527c2 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.0.sh new file mode 100755 index 0000000..1aa811e --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..efe37fa --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.0.sh new file mode 100755 index 0000000..2b9ee70 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.1.1.sh new file mode 100755 index 0000000..d3c86fb --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-serial-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.0.sh b/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.0.sh new file mode 100755 index 0000000..c412ec5 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-gcc-7.4.0-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-gcc-7.4.0-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-gcc-7.4.0-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh new file mode 100755 index 0000000..ed3710e --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-gcc-7.4.0-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-gcc-7.4.0-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-gcc-7.4.0-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-ppc-gcc.sh b/ci/flcl-run-ci-darwin-ppc-gcc.sh new file mode 100755 index 0000000..8a1a0dd --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-gcc.sh @@ -0,0 +1,38 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +echo 'Running ppc-gcc-serial-3.0' +./flcl-run-ci-darwin-ppc-gcc-serial-3.0.sh > output/ppc-gcc-serial-3.0.txt +grep "tests failed" output/ppc-gcc-serial-3.0.txt +echo 'Running ppc-gcc-serial-debug-3.0' +./flcl-run-ci-darwin-ppc-gcc-serial-debug-3.0.sh > output/ppc-gcc-serial-debug-3.0.txt +grep "tests failed" output/ppc-gcc-serial-debug-3.0.txt +echo 'Running pppc-gcc-openmp-3.0' +./flcl-run-ci-darwin-ppc-gcc-openmp-3.0.sh > output/ppc-gcc-openmp-3.0.txt +grep "tests failed" output/ppc-gcc-openmp-3.0.txt +echo 'Running ppc-gcc-openmp-debug-3.0' +./flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.0.sh > output/ppc-gcc-openmp-debug-3.0.txt +grep "tests failed" output/ppc-gcc-openmp-debug-3.0.txt +echo 'Running ppc-gcc-cuda-3.0' +./flcl-run-ci-darwin-ppc-gcc-cuda-3.0.sh > output/ppc-gcc-cuda-3.0.txt +grep "tests failed" output/ppc-gcc-cuda-3.0.txt +echo 'Running ppc-gcc-cuda-debug-3.0' +./flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.0.sh > output/ppc-gcc-cuda-debug-3.0.txt +grep "tests failed" output/ppc-gcc-cuda-debug-3.0.txt +echo 'Running ppc-gcc-serial-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-serial-3.1.1.sh > output/ppc-gcc-serial-3.1.1.txt +grep "tests failed" output/ppc-gcc-serial-3.1.1.txt +echo 'Running ppc-gcc-serial-debug-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh > output/ppc-gcc-serial-debug-3.1.1.txt +grep "tests failed" output/ppc-gcc-serial-debug-3.1.1.txt +echo 'Running pppc-gcc-openmp-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-openmp-3.1.1.sh > output/ppc-gcc-openmp-3.1.1.txt +grep "tests failed" output/ppc-gcc-openmp-3.1.1.txt +echo 'Running ppc-gcc-openmp-debug-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh > output/ppc-gcc-openmp-debug-3.1.1.txt +grep "tests failed" output/ppc-gcc-openmp-debug-3.1.1.txt +echo 'Running ppc-gcc-cuda-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-cuda-3.1.1.sh > output/ppc-gcc-cuda-3.1.1.txt +grep "tests failed" output/ppc-gcc-cuda-3.1.1.txt +echo 'Running ppc-gcc-cuda-debug-3.1.1' +./flcl-run-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh > output/ppc-gcc-cuda-debug-3.1.1.txt +grep "tests failed" output/ppc-gcc-cuda-debug-3.1.1.txt \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.0.sh b/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.0.sh new file mode 100755 index 0000000..1d55af0 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.0.sh @@ -0,0 +1,29 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-xl-16.1.1.6-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-xl-16.1.1.6-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-xl-16.1.1.6-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.1.1.sh new file mode 100755 index 0000000..8ebeeed --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-openmp-3.1.1.sh @@ -0,0 +1,29 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-xl-16.1.1.6-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-xl-16.1.1.6-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-xl-16.1.1.6-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.0.sh b/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.0.sh new file mode 100755 index 0000000..1486e26 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.0.sh @@ -0,0 +1,29 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-xl-16.1.1.6-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-xl-16.1.1.6-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-xl-16.1.1.6-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..1486e26 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh @@ -0,0 +1,29 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-xl-16.1.1.6-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-xl-16.1.1.6-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-xl-16.1.1.6-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-ppc-xl-serial-3.0.sh b/ci/flcl-run-ci-darwin-ppc-xl-serial-3.0.sh new file mode 100755 index 0000000..0fed472 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-serial-3.0.sh @@ -0,0 +1,28 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-xl-16.1.1.6-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-xl-16.1.1.6-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-xl-16.1.1.6-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +cmake --version +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r + # -DCMAKE_EXE_LINKER_FLAGS="-L/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/lib -libmc++" +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +# printenv | grep LD_LIBRARY_PATH diff --git a/ci/flcl-run-ci-darwin-ppc-xl-serial-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-xl-serial-3.1.1.sh new file mode 100755 index 0000000..32eb190 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-serial-3.1.1.sh @@ -0,0 +1,28 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-xl-16.1.1.6-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-xl-16.1.1.6-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-xl-16.1.1.6-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +cmake --version +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r + # -DCMAKE_EXE_LINKER_FLAGS="-L/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/lib -libmc++" +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +# printenv | grep LD_LIBRARY_PATH diff --git a/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.0.sh b/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.0.sh new file mode 100755 index 0000000..497f1e4 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.0.sh @@ -0,0 +1,28 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-ppc-xl-16.1.1.6-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-ppc-xl-16.1.1.6-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-ppc-xl-16.1.1.6-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +cmake --version +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r + # -DCMAKE_EXE_LINKER_FLAGS="-L/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/lib -libmc++" +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +# printenv | grep LD_LIBRARY_PATH diff --git a/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.1.1.sh new file mode 100755 index 0000000..3a39224 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl-serial-debug-3.1.1.sh @@ -0,0 +1,28 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-ppc-xl-16.1.1.6-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-ppc-xl-16.1.1.6-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-ppc-xl-16.1.1.6-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +# one of the important library dirs is not added +# to LD_LIBRARY path for XL module above: +setenv LD_LIBRARY_PATH /projects/opt/ppc64le/ibm/xlf-16.1.1.6/lib:$LD_LIBRARY_PATH +cmake --version +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX \ + -DCMAKE_Fortran_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/etc/xlf.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_Fortran_COMPILER=/projects/opt/ppc64le/ibm/xlf-16.1.1.6/xlf/16.1.1/bin/xlf2008_r + # -DCMAKE_EXE_LINKER_FLAGS="-L/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/lib -libmc++" +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +# printenv | grep LD_LIBRARY_PATH diff --git a/ci/flcl-run-ci-darwin-ppc-xl.sh b/ci/flcl-run-ci-darwin-ppc-xl.sh new file mode 100755 index 0000000..61b4fb3 --- /dev/null +++ b/ci/flcl-run-ci-darwin-ppc-xl.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +echo 'Running ppc-xl-serial-3.0' +./flcl-run-ci-darwin-ppc-xl-serial-3.0.sh > output/ppc-xl-serial-3.0.txt +grep "tests failed" output/ppc-xl-serial-3.0.txt +echo 'Running ppc-xl-serial-debug-3.0' +./flcl-run-ci-darwin-ppc-xl-serial-debug-3.0.sh > output/ppc-xl-serial-debug-3.0.txt +grep "tests failed" output/ppc-xl-serial-debug-3.0.txt +# echo 'Running ppc-xl-openmp-3.0' +# ./flcl-run-ci-darwin-ppc-xl-openmp-3.0.sh > output/ppc-xl-openmp-3.0.txt #XL + Kokkos OpenMP is broken in FLCL at the moment +# grep "tests failed" output/ppc-xl-openmp-3.0.txt +# echo 'Running ppc-xl-openmp-debug-3.0' +# ./flcl-run-ci-darwin-ppc-xl-openmp-debug-3.0.sh > output/ppc-xl-openmp-debug-3.0.txt #XL + Kokkos OpenMP is broken in FLCL at the moment +# grep "tests failed" output/ppc-xl-openmp-debug-3.0.txt +echo 'Running ppc-xl-serial-3.1.1' +./flcl-run-ci-darwin-ppc-xl-serial-3.1.1.sh > output/ppc-xl-serial-3.1.1.txt +grep "tests failed" output/ppc-xl-serial-3.1.1.txt +echo 'Running ppc-xl-serial-debug-3.1.1' +./flcl-run-ci-darwin-ppc-xl-serial-debug-3.1.1.sh > output/ppc-xl-serial-debug-3.1.1.txt +grep "tests failed" output/ppc-xl-serial-debug-3.1.1.txt +# echo 'Running ppc-xl-openmp-3.1.1' +# ./flcl-run-ci-darwin-ppc-xl-openmp-3.1.1.sh > output/ppc-xl-openmp-3.1.1.txt #XL + Kokkos OpenMP is broken in FLCL at the moment +# grep "tests failed" output/ppc-xl-openmp-3.1.1.txt +# echo 'Running ppc-xl-openmp-debug-3.1.1' +# ./flcl-run-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh > output/ppc-xl-openmp-debug-3.1.1.txt #XL + Kokkos OpenMP is broken in FLCL at the moment +# grep "tests failed" output/ppc-xl-openmp-debug-3.1.1.txt diff --git a/ci/flcl-run-ci-darwin-ppc.sh b/ci/flcl-run-ci-darwin-ppc.sh index 5327370..0cdae0e 100755 --- a/ci/flcl-run-ci-darwin-ppc.sh +++ b/ci/flcl-run-ci-darwin-ppc.sh @@ -1,27 +1,4 @@ #!/bin/tcsh -module purge -module load gcc -setenv KOKKOS_ROOT $HOME/kt/2.9-ppc-gnu-serial -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load gcc -setenv KOKKOS_ROOT $HOME/kt/2.9-ppc-gnu-openmp -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load gcc -module load cuda/10.1 -setenv KOKKOS_ROOT $HOME/kt/2.9-ppc-gnu-cuda-7.0 -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -make clean +# salloc -n 1 -p power9-asc -A asc-priority +./flcl-run-ci-darwin-ppc-gcc.sh +./flcl-run-ci-darwin-ppc-xl.sh diff --git a/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.0.sh new file mode 100755 index 0000000..06ab563 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-cuda-10.1/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-cuda-10.1 +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-cuda-10.1 +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest diff --git a/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.1.1.sh new file mode 100755 index 0000000..080fefb --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-cuda-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-cuda-10.1/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-cuda-10.1 +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-cuda-10.1 +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest diff --git a/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.0.sh new file mode 100755 index 0000000..4a8bb90 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-cuda-10.1-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-cuda-10.1-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-cuda-10.1-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh new file mode 100755 index 0000000..413e702 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-cuda-10.1-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-cuda-10.1-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-cuda-10.1-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.0.sh new file mode 100755 index 0000000..848e799 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.1.1.sh new file mode 100755 index 0000000..04cd682 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-openmp-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.0.sh new file mode 100755 index 0000000..c8dbb3d --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND diff --git a/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..f792bfe --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND diff --git a/ci/flcl-run-ci-darwin-x86-gcc-serial-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-serial-3.0.sh new file mode 100755 index 0000000..4218ee9 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-serial-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest diff --git a/ci/flcl-run-ci-darwin-x86-gcc-serial-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-serial-3.1.1.sh new file mode 100755 index 0000000..8b6d5f4 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-serial-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest diff --git a/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.0.sh new file mode 100755 index 0000000..9c27163 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-gcc-7.4.0-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-gcc-7.4.0-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-gcc-7.4.0-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.1.1.sh new file mode 100755 index 0000000..9f91d1c --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc-serial-debug-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-gcc-7.4.0-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-gcc-7.4.0-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-gcc-7.4.0-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-gcc.sh b/ci/flcl-run-ci-darwin-x86-gcc.sh new file mode 100755 index 0000000..35a074c --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-gcc.sh @@ -0,0 +1,38 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Running x86-gcc-serial-3.0' +./flcl-run-ci-darwin-x86-gcc-serial-3.0.sh > output/x86-gcc-serial-3.0.txt +grep "tests failed" output/x86-gcc-serial-3.0.txt +echo 'Running x86-gcc-serial-debug-3.0' +./flcl-run-ci-darwin-x86-gcc-serial-debug-3.0.sh > output/x86-gcc-serial-debug-3.0.txt +grep "tests failed" output/x86-gcc-serial-debug-3.0.txt +echo 'Running x86-gcc-openmp-3.0' +./flcl-run-ci-darwin-x86-gcc-openmp-3.0.sh > output/x86-gcc-openmp-3.0.txt +grep "tests failed" output/x86-gcc-openmp-3.0.txt +echo 'Running x86-gcc-openmp-debug-3.0' +./flcl-run-ci-darwin-x86-gcc-openmp-debug-3.0.sh > output/x86-gcc-openmp-debug-3.0.txt +grep "tests failed" output/x86-gcc-openmp-debug-3.0.txt +echo 'Running x86-gcc-cuda-3.0' +./flcl-run-ci-darwin-x86-gcc-cuda-3.0.sh > output/x86-gcc-cuda-3.0.txt +grep "tests failed" output/x86-gcc-cuda-3.0.txt +echo 'Running x86-gcc-cuda-debug-3.0' +./flcl-run-ci-darwin-x86-gcc-cuda-debug-3.0.sh > output/x86-gcc-cuda-debug-3.0.txt +grep "tests failed" output/x86-gcc-cuda-debug-3.0.txt +echo 'Running x86-gcc-serial-3.1.1' +./flcl-run-ci-darwin-x86-gcc-serial-3.1.1.sh > output/x86-gcc-serial-3.1.1.txt +grep "tests failed" output/x86-gcc-serial-3.1.1.txt +echo 'Running x86-gcc-serial-debug-3.1.1' +./flcl-run-ci-darwin-x86-gcc-serial-debug-3.1.1.sh > output/x86-gcc-serial-debug-3.1.1.txt +grep "tests failed" output/x86-gcc-serial-debug-3.1.1.txt +echo 'Running x86-gcc-openmp-3.1.1' +./flcl-run-ci-darwin-x86-gcc-openmp-3.1.1.sh > output/x86-gcc-openmp-3.1.1.txt +grep "tests failed" output/x86-gcc-openmp-3.1.1.txt +echo 'Running x86-gcc-openmp-debug-3.1.1' +./flcl-run-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh > output/x86-gcc-openmp-debug-3.1.1.txt +grep "tests failed" output/x86-gcc-openmp-debug-3.1.1.txt +echo 'Running x86-gcc-cuda-3.1.1' +./flcl-run-ci-darwin-x86-gcc-cuda-3.1.1.sh > output/x86-gcc-cuda-3.1.1.txt +grep "tests failed" output/x86-gcc-cuda-3.1.1.txt +echo 'Running x86-gcc-cuda-debug-3.1.1' +./flcl-run-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh > output/x86-gcc-cuda-debug-3.1.1.txt +grep "tests failed" output/x86-gcc-cuda-debug-3.1.1.txt \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.0.sh new file mode 100755 index 0000000..6bc1f6b --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-19.0.5-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-19.0.5-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-19.0.5-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.1.1.sh new file mode 100755 index 0000000..56bd7c7 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-19.0.5-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-19.0.5-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-19.0.5-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.0.sh new file mode 100755 index 0000000..973e786 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-19.0.5-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-19.0.5-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-19.0.5-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..487dd15 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-19.0.5-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-19.0.5-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-19.0.5-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.0.sh new file mode 100755 index 0000000..4ed7824 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-19.0.5-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-19.0.5-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-19.0.5-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -v diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.1.1.sh new file mode 100755 index 0000000..229bd19 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-serial-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-19.0.5-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-19.0.5-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-19.0.5-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -v diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.0.sh new file mode 100755 index 0000000..bda0f3c --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-19.0.5-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-19.0.5-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-19.0.5-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh new file mode 100755 index 0000000..0a7c9c5 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-19.0.5-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-19.0.5-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-19.0.5-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.0.sh new file mode 100755 index 0000000..e1336f7 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-20.0.1-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-20.0.1-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-20.0.1-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.1.1.sh new file mode 100755 index 0000000..0fd4e9a --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-20.0.1-openmp/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-20.0.1-openmp +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-20.0.1-openmp +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.0.sh new file mode 100755 index 0000000..0ed382d --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-20.0.1-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-20.0.1-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-20.0.1-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..3e2dd1c --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-20.0.1-openmp-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-20.0.1-openmp-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-20.0.1-openmp-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +setenv OMP_NUM_THREADS 4 +setenv OMP_PROC_BIND false +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V +unsetenv OMP_NUM_THREADS +unsetenv OMP_PROC_BIND \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.0.sh new file mode 100755 index 0000000..b244185 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-20.0.1-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-20.0.1-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-20.0.1-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -v diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.1.1.sh new file mode 100755 index 0000000..6bbabca --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-serial-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-20.0.1-serial/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-20.0.1-serial +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-20.0.1-serial +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -v diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.0.sh b/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.0.sh new file mode 100755 index 0000000..c7cbb27 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.0.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.0-x86-intel-20.0.1-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.0-x86-intel-20.0.1-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.0-x86-intel-20.0.1-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh b/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh new file mode 100755 index 0000000..5410dfc --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +setenv CI_PATH_PREFIX /home/$USER/kokkos-fortran-interop +setenv CI_KOKKOS_PATH /home/$USER/kt/3.1.1-x86-intel-20.0.1-serial-debug/lib64/cmake/Kokkos +setenv CI_BUILD_DIR $CI_PATH_PREFIX/ci/build-3.1.1-x86-intel-20.0.1-serial-debug +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/ci/install-3.1.1-x86-intel-20.0.1-serial-debug +rm -rf $CI_BUILD_DIR +rm -rf $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +cd $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cmake -DKokkos_DIR=$CI_KOKKOS_PATH \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR $CI_PATH_PREFIX +cmake --build $CI_BUILD_DIR +cmake --install $CI_BUILD_DIR +ctest -V diff --git a/ci/flcl-run-ci-darwin-x86-intel-openmp-debug.sh b/ci/flcl-run-ci-darwin-x86-intel-openmp-debug.sh new file mode 100755 index 0000000..6c30d3d --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-openmp-debug.sh @@ -0,0 +1,14 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Running x86-intel-19-openmp-debug-3.0' +./flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.0.sh > output/x86-intel-19-openmp-debug-3.0.txt +grep "tests failed" output/x86-intel-19-openmp-debug-3.0.txt +echo 'Running x86-intel-20-openmp-debug-3.0' +./flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.0.sh > output/x86-intel-20-openmp-debug-3.0.txt +grep "tests failed" output/x86-intel-20-openmp-debug-3.0.txt +echo 'Running x86-intel-19-openmp-debug-3.1.1' +./flcl-run-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh > output/x86-intel-19-openmp-debug-3.1.1.txt +grep "tests failed" output/x86-intel-19-openmp-debug-3.1.1.txt +echo 'Running x86-intel-20-openmp-debug-3.1.1' +./flcl-run-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh > output/x86-intel-20-openmp-debug-3.1.1.txt +grep "tests failed" output/x86-intel-20-openmp-debug-3.1.1.txt diff --git a/ci/flcl-run-ci-darwin-x86-intel-openmp.sh b/ci/flcl-run-ci-darwin-x86-intel-openmp.sh new file mode 100755 index 0000000..01491ec --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-openmp.sh @@ -0,0 +1,14 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Running x86-intel-19-openmp-3.0' +./flcl-run-ci-darwin-x86-intel-19-openmp-3.0.sh > output/x86-intel-19-openmp-3.0.txt +grep "tests failed" output/x86-intel-19-openmp-3.0.txt +echo 'Running x86-intel-20-openmp-3.0' +./flcl-run-ci-darwin-x86-intel-20-openmp-3.0.sh > output/x86-intel-20-openmp-3.0.txt +grep "tests failed" output/x86-intel-20-openmp-3.0.txt +echo 'Running x86-intel-19-openmp-3.1.1' +./flcl-run-ci-darwin-x86-intel-19-openmp-3.1.1.sh > output/x86-intel-19-openmp-3.1.1.txt +grep "tests failed" output/x86-intel-19-openmp-3.1.1.txt +echo 'Running x86-intel-20-openmp-3.1.1' +./flcl-run-ci-darwin-x86-intel-20-openmp-3.1.1.sh > output/x86-intel-20-openmp-3.1.1.txt +grep "tests failed" output/x86-intel-20-openmp-3.1.1.txt \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-serial-debug.sh b/ci/flcl-run-ci-darwin-x86-intel-serial-debug.sh new file mode 100755 index 0000000..0718828 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-serial-debug.sh @@ -0,0 +1,14 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Running x86-intel-19-serial-debug-3.0' +./flcl-run-ci-darwin-x86-intel-19-serial-debug-3.0.sh > output/x86-intel-19-serial-debug-3.0.txt +grep "tests failed" output/x86-intel-19-serial-debug-3.0.txt +echo 'Running x86-intel-20-serial-debug-3.0' +./flcl-run-ci-darwin-x86-intel-20-serial-debug-3.0.sh > output/x86-intel-20-serial-debug-3.0.txt +grep "tests failed" output/x86-intel-20-serial-debug-3.0.txt +echo 'Running x86-intel-19-serial-debug-3.1.1' +./flcl-run-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh > output/x86-intel-19-serial-debug-3.1.1.txt +grep "tests failed" output/x86-intel-19-serial-debug-3.1.1.txt +echo 'Running x86-intel-20-serial-debug-3.1.1' +./flcl-run-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh > output/x86-intel-20-serial-debug-3.1.1.txt +grep "tests failed" output/x86-intel-20-serial-debug-3.1.1.txt \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel-serial.sh b/ci/flcl-run-ci-darwin-x86-intel-serial.sh new file mode 100755 index 0000000..80b2570 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel-serial.sh @@ -0,0 +1,14 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Running x86-intel-19-serial-3.0' +./flcl-run-ci-darwin-x86-intel-19-serial-3.0.sh > output/x86-intel-19-serial-3.0.txt +grep "tests failed" output/x86-intel-19-serial-3.0.txt +echo 'Running x86-intel-20-serial-3.0' +./flcl-run-ci-darwin-x86-intel-20-serial-3.0.sh > output/x86-intel-20-serial-3.0.txt +grep "tests failed" output/x86-intel-20-serial-3.0.txt +echo 'Running x86-intel-19-serial-3.1.1' +./flcl-run-ci-darwin-x86-intel-19-serial-3.1.1.sh > output/x86-intel-19-serial-3.1.1.txt +grep "tests failed" output/x86-intel-19-serial-3.1.1.txt +echo 'Running x86-intel-20-serial-3.1.1' +./flcl-run-ci-darwin-x86-intel-20-serial-3.1.1.sh > output/x86-intel-20-serial-3.1.1.txt +grep "tests failed" output/x86-intel-20-serial-3.1.1.txt \ No newline at end of file diff --git a/ci/flcl-run-ci-darwin-x86-intel.sh b/ci/flcl-run-ci-darwin-x86-intel.sh new file mode 100755 index 0000000..68aa1f0 --- /dev/null +++ b/ci/flcl-run-ci-darwin-x86-intel.sh @@ -0,0 +1,6 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +./flcl-run-ci-darwin-x86-intel-serial.sh +./flcl-run-ci-darwin-x86-intel-serial-debug.sh +./flcl-run-ci-darwin-x86-intel-openmp.sh +./flcl-run-ci-darwin-x86-intel-openmp-debug.sh diff --git a/ci/flcl-run-ci-darwin-x86.sh b/ci/flcl-run-ci-darwin-x86.sh index c176bc4..f5763c0 100755 --- a/ci/flcl-run-ci-darwin-x86.sh +++ b/ci/flcl-run-ci-darwin-x86.sh @@ -1,45 +1,4 @@ #!/bin/tcsh -module purge -module load gcc -setenv KOKKOS_ROOT $HOME/kt/2.9-x86-gnu-serial -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load gcc -setenv KOKKOS_ROOT $HOME/kt/2.9-x86-gnu-openmp -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load gcc -module load cuda/10.1 -setenv KOKKOS_ROOT $HOME/kt/2.9-x86-gnu-cuda-3.5 -setenv CUDA_LAUNCH_BLOCKING 1 -setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load intel -setenv KOKKOS_ROOT $HOME/kt/2.9-x86-intel-serial -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -module purge -module load intel -setenv KOKKOS_ROOT $HOME/kt/2.9-x86-intel-openmp -cd $HOME/kokkos-fortran-interop/build -make clean -make libflcl.a -make test-flcl.x -time $HOME/kokkos-fortran-interop/build/test-flcl.x -make clean \ No newline at end of file +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +./flcl-run-ci-darwin-x86-gcc.sh +./flcl-run-ci-darwin-x86-intel.sh diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.0.sh new file mode 100755 index 0000000..74297c6 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.0.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-cuda-10.1 +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-cuda-10.1-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.1.1.sh new file mode 100755 index 0000000..6a7974e --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-3.1.1.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-cuda-10.1 +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-cuda-10.1-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.0.sh new file mode 100755 index 0000000..2ef310d --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.0.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-cuda-10.1-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-cuda-10.1-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh new file mode 100755 index 0000000..84e5be2 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-cuda-10.1-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-cuda-10.1-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.1.01/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.0.sh new file mode 100755 index 0000000..c693e03 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.1.1.sh new file mode 100755 index 0000000..3027feb --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.0.sh new file mode 100755 index 0000000..921c4ab --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.0.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..5666fb9 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh @@ -0,0 +1,22 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.0.sh new file mode 100755 index 0000000..73122d6 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.1.1.sh new file mode 100755 index 0000000..41417f6 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.0.sh new file mode 100755 index 0000000..a311d42 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-gcc-7.4.0-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh new file mode 100755 index 0000000..838d85e --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-gcc-7.4.0-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-gcc.sh b/ci/flcl-setup-ci-darwin-ppc-gcc.sh new file mode 100755 index 0000000..5cabecc --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-gcc.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +echo 'Setting up ppc gcc kokkos 3.0 serial' +./flcl-setup-ci-darwin-ppc-gcc-serial-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 serial debug' +./flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 openmp' +./flcl-setup-ci-darwin-ppc-gcc-openmp-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 openmp debug' +./flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 cuda' +./flcl-setup-ci-darwin-ppc-gcc-cuda-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 cuda debug' +./flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.0.sh +echo 'Setting up ppc gcc kokkos 3.1.1 serial' +./flcl-setup-ci-darwin-ppc-gcc-serial-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 serial debug' +./flcl-setup-ci-darwin-ppc-gcc-serial-debug-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 openmp' +./flcl-setup-ci-darwin-ppc-gcc-openmp-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 openmp debug' +./flcl-setup-ci-darwin-ppc-gcc-openmp-debug-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 cuda' +./flcl-setup-ci-darwin-ppc-gcc-cuda-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 cuda debug' +./flcl-setup-ci-darwin-ppc-gcc-cuda-debug-3.1.1.sh \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.0.sh new file mode 100755 index 0000000..c45ae3a --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.0.sh @@ -0,0 +1,25 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.1.1.sh new file mode 100755 index 0000000..4549f5b --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-3.1.1.sh @@ -0,0 +1,25 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.0.sh new file mode 100755 index 0000000..fc21c74 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.0.sh @@ -0,0 +1,25 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..b8de8dc --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh @@ -0,0 +1,25 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.0.sh new file mode 100755 index 0000000..3fe1e7b --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.0.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.1.1.sh new file mode 100755 index 0000000..d0d4c8e --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-serial-3.1.1.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.0.sh b/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.0.sh new file mode 100755 index 0000000..b895290 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.0.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-ppc-xl-16.1.1.6-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.1.1.sh new file mode 100755 index 0000000..6111306 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl-serial-debug-3.1.1.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-ppc-xl-16.1.1.6-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load ibm/xlc-16.1.1.6-xlf-16.1.1.6 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_CXX_COMPILER_ARG1=-F/projects/opt/ppc64le/ibm/xlc-16.1.1.6/xlC/16.1.1/etc/xlc.cfg.rhel.7.7.gcc.7.4.0.cuda.10.1 \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-ppc-xl.sh b/ci/flcl-setup-ci-darwin-ppc-xl.sh new file mode 100755 index 0000000..e5fb34a --- /dev/null +++ b/ci/flcl-setup-ci-darwin-ppc-xl.sh @@ -0,0 +1,18 @@ +#!/bin/tcsh +# salloc -n 1 -p power9-asc -A asc-priority +echo 'Setting up ppc gcc kokkos 3.0 serial' +./flcl-setup-ci-darwin-ppc-xl-serial-3.0.sh +echo 'Setting up ppc gcc kokkos 3.0 serial debug' +./flcl-setup-ci-darwin-ppc-xl-serial-debug-3.0.sh +echo 'NOT Setting up ppc gcc kokkos 3.0 openmp' +#./flcl-setup-ci-darwin-ppc-xl-openmp-3.0.sh +echo 'NOT Setting up ppc gcc kokkos 3.0 openmp debug' +#./flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.0.sh +echo 'Setting up ppc gcc kokkos 3.1.1 serial' +./flcl-setup-ci-darwin-ppc-xl-serial-3.1.1.sh +echo 'Setting up ppc gcc kokkos 3.1.1 serial debug' +./flcl-setup-ci-darwin-ppc-xl-serial-debug-3.1.1.sh +echo 'NOT Setting up ppc gcc kokkos 3.1.1 openmp' +#./flcl-setup-ci-darwin-ppc-xl-openmp-3.1.1.sh +echo 'NOT Setting up ppc gcc kokkos 3.1.1 openmp debug' +#./flcl-setup-ci-darwin-ppc-xl-openmp-debug-3.1.1.sh diff --git a/ci/flcl-setup-ci-darwin-ppc.sh b/ci/flcl-setup-ci-darwin-ppc.sh old mode 100644 new mode 100755 index 126af85..148b257 --- a/ci/flcl-setup-ci-darwin-ppc.sh +++ b/ci/flcl-setup-ci-darwin-ppc.sh @@ -1,21 +1,3 @@ #!/bin/tcsh -# salloc -n 1 -p power9-asc -A asc-priority -# cd ~/kt -# mkdir -p ~/kt/2.9-ppc-gnu-serial -# mkdir -p ~/kt/2.9-ppc-gnu-openmp -# mkdir -p ~/kt/2.9-ppc-gnu-cuda-3.5 -# module load gcc -# cd ~/kt/2.9-ppc-gnu-serial -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which g++` --with-serial -# make -j test -# make install -# cd ~/kt/2.9-ppc-gnu-openmp -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which g++` --with-openmp -# make -j test -# make install -# module load cuda/10.1 -# cd ~/kt/2.9-ppc-gnu-cuda-7.0 -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --with-cuda=$CUDADIR --arch=Volta70 --with-cuda-options=enable_lambda,force_uvm -# make -j test -# make install -# module purge +./flcl-setup-ci-darwin-ppc-gcc.sh +./flcl-setup-ci-darwin-ppc-xl.sh diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.0.sh new file mode 100755 index 0000000..d393fb6 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.0.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-cuda-10.1 +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-cuda-10.1-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.1.1.sh new file mode 100755 index 0000000..963966b --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-3.1.1.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-cuda-10.1 +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-cuda-10.1-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.0.sh new file mode 100755 index 0000000..bb22d94 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.0.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-cuda-10.1-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-cuda-10.1-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh new file mode 100755 index 0000000..30eb890 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +# salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-cuda-10.1-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-cuda-10.1-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +module load cuda/10.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_CXX_COMPILER=/home/$USER/kokkos/kokkos-3.0.00/bin/nvcc_wrapper \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ARCH_VOLTA70=ON \ + -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv CUDA_LAUNCH_BLOCKING 1 +setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 +make -j check +make install +module purge +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.0.sh new file mode 100755 index 0000000..97ca6e0 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.0.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.1.1.sh new file mode 100755 index 0000000..7a8f02a --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-3.1.1.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.0.sh new file mode 100755 index 0000000..c7a403c --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.0.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..d739874 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh @@ -0,0 +1,23 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +setenv OMP_PROC_BIND spread +setenv OMP_PLACES threads +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.0.sh new file mode 100755 index 0000000..86dcd03 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.1.1.sh new file mode 100755 index 0000000..9bba2e9 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-serial-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.0.sh new file mode 100755 index 0000000..38a2821 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-gcc-7.4.0-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.1.1.sh new file mode 100755 index 0000000..5c06fd2 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc-serial-debug-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-gcc-7.4.0-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load gcc/7.4.0 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-gcc.sh b/ci/flcl-setup-ci-darwin-x86-gcc.sh new file mode 100755 index 0000000..e3fb15d --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-gcc.sh @@ -0,0 +1,26 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Setting up x86 gcc kokkos 3.0 serial' +./flcl-setup-ci-darwin-x86-gcc-serial-3.0.sh +echo 'Setting up x86 gcc kokkos 3.0 serial debug' +./flcl-setup-ci-darwin-x86-gcc-serial-debug-3.0.sh +echo 'Setting up x86 gcc kokkos 3.0 openmp' +./flcl-setup-ci-darwin-x86-gcc-openmp-3.0.sh +echo 'Setting up x86 gcc kokkos 3.0 openmp debug' +./flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.0.sh +echo 'Setting up x86 gcc kokkos 3.0 cuda' +./flcl-setup-ci-darwin-x86-gcc-cuda-3.0.sh +echo 'Setting up x86 gcc kokkos 3.0 cuda debug' +./flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.0.sh +echo 'Setting up x86 gcc kokkos 3.1.1 serial' +./flcl-setup-ci-darwin-x86-gcc-serial-3.1.1.sh +echo 'Setting up x86 gcc kokkos 3.1.1 serial debug' +./flcl-setup-ci-darwin-x86-gcc-serial-debug-3.1.1.sh +echo 'Setting up x86 gcc kokkos 3.1.1 openmp' +./flcl-setup-ci-darwin-x86-gcc-openmp-3.1.1.sh +echo 'Setting up x86 gcc kokkos 3.1.1 openmp debug' +./flcl-setup-ci-darwin-x86-gcc-openmp-debug-3.1.1.sh +echo 'Setting up x86 gcc kokkos 3.1.1 cuda' +./flcl-setup-ci-darwin-x86-gcc-cuda-3.1.1.sh +echo 'Setting up x86 gcc kokkos 3.1.1 cuda debug' +./flcl-setup-ci-darwin-x86-gcc-cuda-debug-3.1.1.sh \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.0.sh new file mode 100755 index 0000000..3eccb2d --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00\ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.1.1.sh new file mode 100755 index 0000000..37f0ef7 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01\ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.0.sh new file mode 100755 index 0000000..d473e2d --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00\ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..b33d169 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01\ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.0.sh new file mode 100755 index 0000000..8e4560c --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.1.1.sh new file mode 100755 index 0000000..b52dee6 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.0.sh new file mode 100755 index 0000000..95d187d --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-19.0.5-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh new file mode 100755 index 0000000..dafb19b --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-19.0.5-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/19.0.5 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.0.sh new file mode 100755 index 0000000..2160cd0 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00\ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.1.1.sh new file mode 100755 index 0000000..4768a71 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-openmp +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-openmp-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01\ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.0.sh new file mode 100755 index 0000000..5201ba5 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.0.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00\ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh new file mode 100755 index 0000000..7d61359 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh @@ -0,0 +1,21 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +## set-up +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-openmp-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-openmp-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01\ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.0.sh new file mode 100755 index 0000000..12d9072 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.1.1.sh new file mode 100755 index 0000000..26cb3be --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-serial +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-serial-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.0.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.0.sh new file mode 100755 index 0000000..7e63782 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.0.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.0-x86-intel-20.0.1-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.0.00 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh new file mode 100755 index 0000000..412dd54 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh @@ -0,0 +1,20 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +setenv CI_PATH_PREFIX /home/$USER/kt +setenv CI_INSTALL_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-serial-debug +setenv CI_BUILD_DIR $CI_PATH_PREFIX/3.1.1-x86-intel-20.0.1-serial-debug-build +rm -rf $CI_INSTALL_DIR +rm -rf $CI_BUILD_DIR +mkdir -p $CI_INSTALL_DIR +mkdir -p $CI_BUILD_DIR +module load cmake/3.15.3 +module load intel/20.0.1 +cd $CI_BUILD_DIR +cmake /home/$USER/kokkos/kokkos-3.1.01 \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=$CI_INSTALL_DIR \ + -DKokkos_ENABLE_SERIAL=ON \ + -DKokkos_ENABLE_TESTS=ON +make -j check +make install +rm -rf $CI_BUILD_DIR diff --git a/ci/flcl-setup-ci-darwin-x86-intel.sh b/ci/flcl-setup-ci-darwin-x86-intel.sh new file mode 100755 index 0000000..2363046 --- /dev/null +++ b/ci/flcl-setup-ci-darwin-x86-intel.sh @@ -0,0 +1,34 @@ +#!/bin/tcsh +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +echo 'Setting up x86 intel 19 kokkos 3.0 serial' +./flcl-setup-ci-darwin-x86-intel-19-serial-3.0.sh +echo 'Setting up x86 intel 20 kokkos 3.0 serial' +./flcl-setup-ci-darwin-x86-intel-20-serial-3.0.sh +echo 'Setting up x86 intel 19 kokkos 3.1.1 serial' +./flcl-setup-ci-darwin-x86-intel-19-serial-3.1.1.sh +echo 'Setting up x86 intel 20 kokkos 3.1.1 serial' +./flcl-setup-ci-darwin-x86-intel-20-serial-3.1.1.sh +echo 'Setting up x86 intel 19 kokkos 3.0 serial debug' +./flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.0.sh +echo 'Setting up x86 intel 20 kokkos 3.0 serial debug' +./flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.0.sh +echo 'Setting up x86 intel 19 kokkos 3.1.1 serial debug' +./flcl-setup-ci-darwin-x86-intel-19-serial-debug-3.1.1.sh +echo 'Setting up x86 intel 20 kokkos 3.1.1 serial debug' +./flcl-setup-ci-darwin-x86-intel-20-serial-debug-3.1.1.sh +echo 'Setting up x86 intel 19 kokkos 3.0 openmp' +./flcl-setup-ci-darwin-x86-intel-19-openmp-3.0.sh +echo 'Setting up x86 intel 20 kokkos 3.0 openmp' +./flcl-setup-ci-darwin-x86-intel-20-openmp-3.0.sh +echo 'Setting up x86 intel 19 kokkos 3.1.1 openmp' +./flcl-setup-ci-darwin-x86-intel-19-openmp-3.1.1.sh +echo 'Setting up x86 intel 20 kokkos 3.1.1 openmp' +./flcl-setup-ci-darwin-x86-intel-20-openmp-3.1.1.sh +echo 'Setting up x86 intel 19 kokkos 3.0 openmp debug' +./flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.0.sh +echo 'Setting up x86 intel 20 kokkos 3.0 openmp debug' +./flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.0.sh +echo 'Setting up x86 intel 19 kokkos 3.1.1 openmp debug' +./flcl-setup-ci-darwin-x86-intel-19-openmp-debug-3.1.1.sh +echo 'Setting up x86 intel 20 kokkos 3.1.1 openmp debug' +./flcl-setup-ci-darwin-x86-intel-20-openmp-debug-3.1.1.sh \ No newline at end of file diff --git a/ci/flcl-setup-ci-darwin-x86.sh b/ci/flcl-setup-ci-darwin-x86.sh old mode 100644 new mode 100755 index 7c126c2..db89303 --- a/ci/flcl-setup-ci-darwin-x86.sh +++ b/ci/flcl-setup-ci-darwin-x86.sh @@ -1,35 +1,4 @@ #!/bin/tcsh -# salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel -# cd ~/kt -# mkdir -p ~/kt/2.9-x86-gnu-serial -# mkdir -p ~/kt/2.9-x86-gnu-openmp -# mkdir -p ~/kt/2.9-x86-gnu-cuda-3.5 -# mkdir -p ~/kt/2.9-x86-intel-serial -# mkdir -p ~/kt/2.9-x86-intel-openmp -# module load gcc -# cd ~/kt/2.9-x86-gnu-serial -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which g++` --with-serial -# make -j test -# make install -# cd ~/kt/2.9-x86-gnu-openmp -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which g++` --with-openmp -# make -j test -# make install -# module load cuda/10.1 -# cd ~/kt/2.9-x86-gnu-cuda-3.5 -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --with-cuda=$CUDADIR --arch=Kepler35 --with-cuda-options=enable_lambda,force_uvm -# setenv CUDA_LAUNCH_BLOCKING 1 -# setenv CUDA_MANAGED_FORCE_DEVICE_ALLOC 1 -# make -j test -# make install -# module purge -# module load intel -# cd ~/kt/2.9-x86-intel-serial -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which icpc` --with-serial -# make -j test -# make install -# cd ~/kt/2.9-x86-intel-openmp -# ../../kokkos/kokkos-2.9.00/generate_makefile.bash --prefix=`pwd` --compiler=`which icpc` --with-openmp -# make -j test -# make install -# module purge \ No newline at end of file +## salloc -n 1 --constraint=gpu_vendor:nvidia,cpu_vendor:Intel,gpu1_model:Tesla_K40c +./flcl-setup-ci-darwin-x86-gcc.sh +./flcl-setup-ci-darwin-x86-intel.sh diff --git a/cmake/flclConfig.cmake.in b/cmake/flclConfig.cmake.in new file mode 100644 index 0000000..c01975c --- /dev/null +++ b/cmake/flclConfig.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/flclTargets.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/src/flcl-cxx.cpp b/src/flcl-cxx.cpp index 6170195..58dd218 100644 --- a/src/flcl-cxx.cpp +++ b/src/flcl-cxx.cpp @@ -37,40 +37,42 @@ #include "flcl-cxx.hpp" +size_t one = 1; + extern "C" { // 1D flcl view allocation routines - void c_kokkos_allocate_v_l_1d(bool** A, flcl::view_l_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_l_1d(bool** A, flcl::view_l_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::view_l_1d_t(c_label, e0t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i32_1d(int32_t** A, flcl::view_i32_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i32_1d(int32_t** A, flcl::view_i32_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i32_1d_t(c_label, e0t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i64_1d(int64_t** A, flcl::view_i64_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i64_1d(int64_t** A, flcl::view_i64_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i64_1d_t(c_label, e0t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r32_1d(float** A, flcl::view_r32_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r32_1d(float** A, flcl::view_r32_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r32_1d_t(c_label, e0t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r64_1d(double** A, flcl::view_r64_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r64_1d(double** A, flcl::view_r64_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r64_1d_t(c_label, e0t)); *A = (*v_A)->data(); // below is a reminder of how to print the label @@ -78,124 +80,124 @@ extern "C" { } // 2D flcl view allocation routines - void c_kokkos_allocate_v_l_2d(bool** A, flcl::view_l_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_l_2d(bool** A, flcl::view_l_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::view_l_2d_t(c_label, e0t, e1t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i32_2d(int32_t** A, flcl::view_i32_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i32_2d(int32_t** A, flcl::view_i32_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i32_2d_t(c_label, e0t, e1t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i64_2d(int64_t** A, flcl::view_i64_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i64_2d(int64_t** A, flcl::view_i64_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i64_2d_t(c_label, e0t, e1t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r32_2d(float** A, flcl::view_r32_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r32_2d(float** A, flcl::view_r32_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r32_2d_t(c_label, e0t, e1t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r64_2d(double** A, flcl::view_r64_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r64_2d(double** A, flcl::view_r64_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r64_2d_t(c_label, e0t, e1t)); *A = (*v_A)->data(); } // 3D flcl view allocation routines - void c_kokkos_allocate_v_l_3d(bool** A, flcl::view_l_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_l_3d(bool** A, flcl::view_l_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::view_l_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i32_3d(int32_t** A, flcl::view_i32_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i32_3d(int32_t** A, flcl::view_i32_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i32_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_i64_3d(int64_t** A, flcl::view_i64_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_i64_3d(int64_t** A, flcl::view_i64_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::view_i64_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r32_3d(float** A, flcl::view_r32_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r32_3d(float** A, flcl::view_r32_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r32_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->data(); } - void c_kokkos_allocate_v_r64_3d(double** A, flcl::view_r64_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_v_r64_3d(double** A, flcl::view_r64_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::view_r64_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->data(); } // 1D flcl dualview allocation routines - void c_kokkos_allocate_dv_l_1d(bool** A, flcl::dualview_l_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_l_1d(bool** A, flcl::dualview_l_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_l_1d_t(c_label, e0t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i32_1d(int32_t** A, flcl::dualview_i32_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i32_1d(int32_t** A, flcl::dualview_i32_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i32_1d_t(c_label, e0t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i64_1d(int64_t** A, flcl::dualview_i64_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i64_1d(int64_t** A, flcl::dualview_i64_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i64_1d_t(c_label, e0t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r32_1d(float** A, flcl::dualview_r32_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r32_1d(float** A, flcl::dualview_r32_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r32_1d_t(c_label, e0t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r64_1d(double** A, flcl::dualview_r64_1d_t** v_A, const char** f_label, const int* e0) { - const int e0t = std::max(*e0, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r64_1d(double** A, flcl::dualview_r64_1d_t** v_A, const char* f_label, const size_t* e0) { + const size_t e0t = std::max(*e0, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r64_1d_t(c_label, e0t)); *A = (*v_A)->h_view.data(); // below is a reminder of how to print the label @@ -203,88 +205,88 @@ extern "C" { } // 2D flcl dualview allocation routines - void c_kokkos_allocate_dv_l_2d(bool** A, flcl::dualview_l_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_l_2d(bool** A, flcl::dualview_l_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_l_2d_t(c_label, e0t, e1t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i32_2d(int32_t** A, flcl::dualview_i32_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i32_2d(int32_t** A, flcl::dualview_i32_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i32_2d_t(c_label, e0t, e1t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i64_2d(int64_t** A, flcl::dualview_i64_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i64_2d(int64_t** A, flcl::dualview_i64_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i64_2d_t(c_label, e0t, e1t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r32_2d(float** A, flcl::dualview_r32_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r32_2d(float** A, flcl::dualview_r32_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r32_2d_t(c_label, e0t, e1t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r64_2d(double** A, flcl::dualview_r64_2d_t** v_A, const char** f_label, const int* e0, const int* e1) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r64_2d(double** A, flcl::dualview_r64_2d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r64_2d_t(c_label, e0t, e1t)); *A = (*v_A)->h_view.data(); } // 3D flcl dualview allocation routines - void c_kokkos_allocate_dv_l_3d(bool** A, flcl::dualview_l_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_l_3d(bool** A, flcl::dualview_l_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_l_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i32_3d(int32_t** A, flcl::dualview_i32_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i32_3d(int32_t** A, flcl::dualview_i32_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i32_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_i64_3d(int64_t** A, flcl::dualview_i64_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_i64_3d(int64_t** A, flcl::dualview_i64_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_i64_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r32_3d(float** A, flcl::dualview_r32_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r32_3d(float** A, flcl::dualview_r32_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r32_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->h_view.data(); } - void c_kokkos_allocate_dv_r64_3d(double** A, flcl::dualview_r64_3d_t** v_A, const char** f_label, const int* e0, const int* e1, const int* e2) { - const int e0t = std::max(*e0, 1); - const int e1t = std::max(*e1, 1); - const int e2t = std::max(*e2, 1); - std::string c_label( *f_label ); + void c_kokkos_allocate_dv_r64_3d(double** A, flcl::dualview_r64_3d_t** v_A, const char* f_label, const size_t* e0, const size_t* e1, const size_t* e2) { + const size_t e0t = std::max(*e0, one); + const size_t e1t = std::max(*e1, one); + const size_t e2t = std::max(*e2, one); + std::string c_label( f_label ); *v_A = (new flcl::dualview_r64_3d_t(c_label, e0t, e1t, e2t)); *A = (*v_A)->h_view.data(); } diff --git a/src/flcl-cxx.hpp b/src/flcl-cxx.hpp index 5506f38..16386a8 100644 --- a/src/flcl-cxx.hpp +++ b/src/flcl-cxx.hpp @@ -56,6 +56,15 @@ typedef struct _flcl_nd_array_t { void *data; } flcl_ndarray_t; +namespace flcl { +#ifdef KOKKOS_ENABLE_CUDA +using HostMemorySpace = Kokkos::CudaUVMSpace; +#else +using HostMemorySpace = Kokkos::HostSpace; +#endif +} // namespace flcl + + // Design thoughts: view types are intended to be used on host-host codes, or // host-gpu codes with UVM as the default memory space. This allows for an // incremental porting beginning with a Fortran driver, on the host, calling @@ -65,26 +74,32 @@ typedef struct _flcl_nd_array_t { // necessary memory transfer explicitly over larger compute regions. namespace flcl { + #ifdef KOKKOS_ENABLE_CUDA + using HostMemorySpace = Kokkos::CudaUVMSpace; + #else + using HostMemorySpace = Kokkos::HostSpace; + #endif + // 1D fortran-compatible view types - typedef Kokkos::View view_l_1d_t; - typedef Kokkos::View view_i32_1d_t; - typedef Kokkos::View view_i64_1d_t; - typedef Kokkos::View view_r32_1d_t; - typedef Kokkos::View view_r64_1d_t; + typedef Kokkos::View view_l_1d_t; + typedef Kokkos::View view_i32_1d_t; + typedef Kokkos::View view_i64_1d_t; + typedef Kokkos::View view_r32_1d_t; + typedef Kokkos::View view_r64_1d_t; // 2D fortran-compatible view types - typedef Kokkos::View view_l_2d_t; - typedef Kokkos::View view_i32_2d_t; - typedef Kokkos::View view_i64_2d_t; - typedef Kokkos::View view_r32_2d_t; - typedef Kokkos::View view_r64_2d_t; + typedef Kokkos::View view_l_2d_t; + typedef Kokkos::View view_i32_2d_t; + typedef Kokkos::View view_i64_2d_t; + typedef Kokkos::View view_r32_2d_t; + typedef Kokkos::View view_r64_2d_t; // 3D fortran-compatible view types - typedef Kokkos::View view_l_3d_t; - typedef Kokkos::View view_i32_3d_t; - typedef Kokkos::View view_i64_3d_t; - typedef Kokkos::View view_r32_3d_t; - typedef Kokkos::View view_r64_3d_t; + typedef Kokkos::View view_l_3d_t; + typedef Kokkos::View view_i32_3d_t; + typedef Kokkos::View view_i64_3d_t; + typedef Kokkos::View view_r32_3d_t; + typedef Kokkos::View view_r64_3d_t; // 1D fortran-compatible dualview types typedef Kokkos::DualView dualview_l_1d_t; @@ -108,7 +123,7 @@ namespace flcl { typedef Kokkos::DualView dualview_r64_3d_t; template - Kokkos::View + Kokkos::View view_from_ndarray(flcl_ndarray_t const &ndarray) { size_t dimensions[Kokkos::ARRAY_LAYOUT_MAX_RANK] = {}; size_t strides[Kokkos::ARRAY_LAYOUT_MAX_RANK] = {}; @@ -139,10 +154,10 @@ namespace flcl { }; // clang-format on - return Kokkos::View( + return Kokkos::View( reinterpret_cast(ndarray.data), layout); } -} +} // namespace flcl #endif // FLCL_CXX_HPP \ No newline at end of file diff --git a/src/flcl-f.f90 b/src/flcl-f.f90 index b591eb2..ac80a6d 100644 --- a/src/flcl-f.f90 +++ b/src/flcl-f.f90 @@ -38,6 +38,7 @@ module flcl_mod use, intrinsic :: iso_c_binding use, intrinsic :: iso_fortran_env + use flcl_util_strings_mod, only: char_add_null implicit none private @@ -49,9 +50,8 @@ module flcl_mod public kokkos_allocate_dualview public kokkos_deallocate_view public kokkos_deallocate_dualview - public char_add_null integer, parameter :: ND_ARRAY_MAX_RANK = 8 - + type, bind(C) :: nd_array_t integer(c_size_t) :: rank integer(c_size_t) :: dims(ND_ARRAY_MAX_RANK) @@ -68,6 +68,8 @@ module flcl_mod module procedure to_nd_array_i64_1d module procedure to_nd_array_r32_1d module procedure to_nd_array_r64_1d + module procedure to_nd_array_c32_1d + module procedure to_nd_array_c64_1d ! 2D specializations module procedure to_nd_array_l_2d @@ -75,6 +77,8 @@ module flcl_mod module procedure to_nd_array_i64_2d module procedure to_nd_array_r32_2d module procedure to_nd_array_r64_2d + module procedure to_nd_array_c32_2d + module procedure to_nd_array_c64_2d ! 3D specializations module procedure to_nd_array_l_3d @@ -82,6 +86,8 @@ module flcl_mod module procedure to_nd_array_i64_3d module procedure to_nd_array_r32_3d module procedure to_nd_array_r64_3d + module procedure to_nd_array_c32_3d + module procedure to_nd_array_c64_3d ! 4D specializations module procedure to_nd_array_l_4d @@ -89,6 +95,8 @@ module flcl_mod module procedure to_nd_array_i64_4d module procedure to_nd_array_r32_4d module procedure to_nd_array_r64_4d + module procedure to_nd_array_c32_4d + module procedure to_nd_array_c64_4d ! 5D specializations module procedure to_nd_array_l_5d @@ -96,6 +104,8 @@ module flcl_mod module procedure to_nd_array_i64_5d module procedure to_nd_array_r32_5d module procedure to_nd_array_r64_5d + module procedure to_nd_array_c32_5d + module procedure to_nd_array_c64_5d ! 6D specializations module procedure to_nd_array_l_6d @@ -103,6 +113,8 @@ module flcl_mod module procedure to_nd_array_i64_6d module procedure to_nd_array_r32_6d module procedure to_nd_array_r64_6d + module procedure to_nd_array_c32_6d + module procedure to_nd_array_c64_6d ! 7D specializations module procedure to_nd_array_l_7d @@ -110,6 +122,8 @@ module flcl_mod module procedure to_nd_array_i64_7d module procedure to_nd_array_r32_7d module procedure to_nd_array_r64_7d + module procedure to_nd_array_c32_7d + module procedure to_nd_array_c64_7d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos_allocate_view interface @@ -219,10 +233,10 @@ subroutine f_kokkos_allocate_v_l_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_v_l_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_v_l_1d end interface @@ -231,10 +245,10 @@ subroutine f_kokkos_allocate_v_i32_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_v_i32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_v_i32_1d end interface @@ -243,10 +257,10 @@ subroutine f_kokkos_allocate_v_i64_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_v_i64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_v_i64_1d end interface @@ -255,10 +269,10 @@ subroutine f_kokkos_allocate_v_r32_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_v_r32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_v_r32_1d end interface @@ -267,12 +281,13 @@ subroutine f_kokkos_allocate_v_r64_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_v_r64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_v_r64_1d end interface + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos_allocate_view 2D interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -281,11 +296,11 @@ subroutine f_kokkos_allocate_v_l_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_v_l_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_v_l_2d end interface @@ -294,11 +309,11 @@ subroutine f_kokkos_allocate_v_i32_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_v_i32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_v_i32_2d end interface @@ -307,11 +322,11 @@ subroutine f_kokkos_allocate_v_i64_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_v_i64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_v_i64_2d end interface @@ -320,11 +335,11 @@ subroutine f_kokkos_allocate_v_r32_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_v_r32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_v_r32_2d end interface @@ -333,11 +348,11 @@ subroutine f_kokkos_allocate_v_r64_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_v_r64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_v_r64_2d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -348,12 +363,12 @@ subroutine f_kokkos_allocate_v_l_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_v_l_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_v_l_3d end interface @@ -362,12 +377,12 @@ subroutine f_kokkos_allocate_v_i32_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_v_i32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_v_i32_3d end interface @@ -376,12 +391,12 @@ subroutine f_kokkos_allocate_v_i64_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_v_i64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_v_i64_3d end interface @@ -390,12 +405,12 @@ subroutine f_kokkos_allocate_v_r32_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_v_r32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_v_r32_3d end interface @@ -404,12 +419,12 @@ subroutine f_kokkos_allocate_v_r64_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_v_r64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_v_r64_3d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -420,10 +435,10 @@ subroutine f_kokkos_allocate_dv_l_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_dv_l_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_dv_l_1d end interface @@ -432,10 +447,10 @@ subroutine f_kokkos_allocate_dv_i32_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_dv_i32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_dv_i32_1d end interface @@ -444,10 +459,10 @@ subroutine f_kokkos_allocate_dv_i64_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_dv_i64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_dv_i64_1d end interface @@ -456,10 +471,10 @@ subroutine f_kokkos_allocate_dv_r32_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_dv_r32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_dv_r32_1d end interface @@ -468,10 +483,10 @@ subroutine f_kokkos_allocate_dv_r64_1d(c_A, v_A, n_A, e0) & & bind (c, name='c_kokkos_allocate_dv_r64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 end subroutine f_kokkos_allocate_dv_r64_1d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -482,11 +497,11 @@ subroutine f_kokkos_allocate_dv_l_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_dv_l_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_dv_l_2d end interface @@ -495,11 +510,11 @@ subroutine f_kokkos_allocate_dv_i32_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_dv_i32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_dv_i32_2d end interface @@ -508,11 +523,11 @@ subroutine f_kokkos_allocate_dv_i64_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_dv_i64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_dv_i64_2d end interface @@ -521,11 +536,11 @@ subroutine f_kokkos_allocate_dv_r32_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_dv_r32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_dv_r32_2d end interface @@ -534,11 +549,11 @@ subroutine f_kokkos_allocate_dv_r64_2d(c_A, v_A, n_A, e0, e1) & & bind (c, name='c_kokkos_allocate_dv_r64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 end subroutine f_kokkos_allocate_dv_r64_2d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -549,12 +564,12 @@ subroutine f_kokkos_allocate_dv_l_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_dv_l_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_dv_l_3d end interface @@ -563,12 +578,12 @@ subroutine f_kokkos_allocate_dv_i32_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_dv_i32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_dv_i32_3d end interface @@ -577,12 +592,12 @@ subroutine f_kokkos_allocate_dv_i64_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_dv_i64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_dv_i64_3d end interface @@ -591,12 +606,12 @@ subroutine f_kokkos_allocate_dv_r32_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_dv_r32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_dv_r32_3d end interface @@ -605,12 +620,12 @@ subroutine f_kokkos_allocate_dv_r64_3d(c_A, v_A, n_A, e0, e1, e2) & & bind (c, name='c_kokkos_allocate_dv_r64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: c_A - type (c_ptr), intent(out) :: v_A - type (c_ptr), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - integer (c_int), intent(in) :: e1 - integer (c_int), intent(in) :: e2 + type(c_ptr), intent(out) :: c_A + type(c_ptr), intent(out) :: v_A + character(kind=c_char), intent(in) :: n_A(*) + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 end subroutine f_kokkos_allocate_dv_r64_3d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -621,7 +636,7 @@ subroutine f_kokkos_deallocate_v_l_1d(v_A) & & bind (c, name='c_kokkos_deallocate_v_l_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_l_1d end interface @@ -630,7 +645,7 @@ subroutine f_kokkos_deallocate_v_i32_1d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i32_1d end interface @@ -639,7 +654,7 @@ subroutine f_kokkos_deallocate_v_i64_1d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i64_1d end interface @@ -648,7 +663,7 @@ subroutine f_kokkos_deallocate_v_r32_1d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r32_1d end interface @@ -657,7 +672,7 @@ subroutine f_kokkos_deallocate_v_r64_1d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r64_1d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -668,7 +683,7 @@ subroutine f_kokkos_deallocate_v_l_2d(v_A) & & bind (c, name='c_kokkos_deallocate_v_l_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_l_2d end interface @@ -677,7 +692,7 @@ subroutine f_kokkos_deallocate_v_i32_2d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i32_2d end interface @@ -686,7 +701,7 @@ subroutine f_kokkos_deallocate_v_i64_2d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i64_2d end interface @@ -695,7 +710,7 @@ subroutine f_kokkos_deallocate_v_r32_2d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r32_2d end interface @@ -704,7 +719,7 @@ subroutine f_kokkos_deallocate_v_r64_2d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r64_2d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -715,7 +730,7 @@ subroutine f_kokkos_deallocate_v_l_3d(v_A) & & bind (c, name='c_kokkos_deallocate_v_l_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_l_3d end interface @@ -724,7 +739,7 @@ subroutine f_kokkos_deallocate_v_i32_3d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i32_3d end interface @@ -733,7 +748,7 @@ subroutine f_kokkos_deallocate_v_i64_3d(v_A) & & bind (c, name='c_kokkos_deallocate_v_i64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_i64_3d end interface @@ -742,7 +757,7 @@ subroutine f_kokkos_deallocate_v_r32_3d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r32_3d end interface @@ -751,7 +766,7 @@ subroutine f_kokkos_deallocate_v_r64_3d(v_A) & & bind (c, name='c_kokkos_deallocate_v_r64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_v_r64_3d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -762,7 +777,7 @@ subroutine f_kokkos_deallocate_dv_l_1d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_l_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_l_1d end interface @@ -771,7 +786,7 @@ subroutine f_kokkos_deallocate_dv_i32_1d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i32_1d end interface @@ -780,7 +795,7 @@ subroutine f_kokkos_deallocate_dv_i64_1d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i64_1d end interface @@ -789,7 +804,7 @@ subroutine f_kokkos_deallocate_dv_r32_1d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r32_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r32_1d end interface @@ -798,7 +813,7 @@ subroutine f_kokkos_deallocate_dv_r64_1d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r64_1d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r64_1d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -809,7 +824,7 @@ subroutine f_kokkos_deallocate_dv_l_2d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_l_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_l_2d end interface @@ -818,7 +833,7 @@ subroutine f_kokkos_deallocate_dv_i32_2d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i32_2d end interface @@ -827,7 +842,7 @@ subroutine f_kokkos_deallocate_dv_i64_2d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i64_2d end interface @@ -836,7 +851,7 @@ subroutine f_kokkos_deallocate_dv_r32_2d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r32_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r32_2d end interface @@ -845,7 +860,7 @@ subroutine f_kokkos_deallocate_dv_r64_2d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r64_2d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r64_2d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -856,7 +871,7 @@ subroutine f_kokkos_deallocate_dv_l_3d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_l_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_l_3d end interface @@ -865,7 +880,7 @@ subroutine f_kokkos_deallocate_dv_i32_3d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i32_3d end interface @@ -874,7 +889,7 @@ subroutine f_kokkos_deallocate_dv_i64_3d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_i64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_i64_3d end interface @@ -883,7 +898,7 @@ subroutine f_kokkos_deallocate_dv_r32_3d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r32_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r32_3d end interface @@ -892,192 +907,191 @@ subroutine f_kokkos_deallocate_dv_r64_3d(v_A) & & bind (c, name='c_kokkos_deallocate_dv_r64_3d') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A end subroutine f_kokkos_deallocate_dv_r64_3d end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! contains !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine char_add_null( input_char, f_label ) - use, intrinsic :: iso_c_binding - implicit none - character(len=*), intent(in) :: input_char - character(len=:), allocatable, target, intent(inout):: f_label - - integer :: strlen - strlen = len(input_char) - allocate(character(len=strlen+1) :: f_label) - - f_label(1:strlen) = input_char(1:strlen) - f_label(strlen+1:strlen+1) = c_null_char - end subroutine + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos allocate view 1D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_v_l_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 + integer(c_size_t), intent(in) :: e0 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_l_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_v_l_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_v_l_1d subroutine kokkos_allocate_v_i32_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer (INT32), pointer, dimension(:), intent(inout) :: A - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - type (c_ptr) :: c_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i32_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_v_i32_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_v_i32_1d subroutine kokkos_allocate_v_i64_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT64), pointer, dimension(:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 + integer(c_size_t), intent(in) :: e0 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i64_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_v_i64_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_v_i64_1d subroutine kokkos_allocate_v_r32_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding - implicit none - real(REAL32), pointer, dimension(:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r32_1d(c_A, v_A, c_loc(f_label), e0) - call c_f_pointer(c_A, A, shape=[e0]) + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL32), pointer, dimension(:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_v_r32_1d(c_A, v_A, f_label, e0) + call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_v_r32_1d subroutine kokkos_allocate_v_r64_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding - implicit none - real(REAL64), pointer, dimension(:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r64_1d(c_A, v_A, c_loc(f_label), e0) - call c_f_pointer(c_A, A, shape=[e0]) + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL64), pointer, dimension(:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_v_r64_1d(c_A, v_A, f_label, e0) + call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_v_r64_1d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos allocate view 2D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_v_l_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_l_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_v_l_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_v_l_2d subroutine kokkos_allocate_v_i32_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT32), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i32_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_v_i32_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_v_i32_2d subroutine kokkos_allocate_v_i64_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer (INT64), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i64_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_v_i64_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_v_i64_2d subroutine kokkos_allocate_v_r32_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL32), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r32_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_v_r32_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_v_r32_2d subroutine kokkos_allocate_v_r64_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL64), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r64_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_v_r64_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_v_r64_2d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1085,260 +1099,275 @@ end subroutine kokkos_allocate_v_r64_2d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_v_l_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_l_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_v_l_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_v_l_3d subroutine kokkos_allocate_v_i32_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT32), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i32_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_v_i32_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_v_i32_3d subroutine kokkos_allocate_v_i64_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT64), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_i64_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_v_i64_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_v_i64_3d subroutine kokkos_allocate_v_r32_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL32), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r32_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_v_r32_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_v_r32_3d subroutine kokkos_allocate_v_r64_3d(A, v_A, n_A, e0, e1, e2) - use, intrinsic :: iso_c_binding - implicit none - real(REAL64), pointer, dimension(:,:,:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_v_r64_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) - call c_f_pointer(c_A, A, shape=[e0,e1,e2]) + use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL64), pointer, dimension(:,:,:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_v_r64_3d(c_A, v_A, f_label, e0, e1, e2) + call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_v_r64_3d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos allocate dualview 1D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_dv_l_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 + integer(c_size_t), intent(in) :: e0 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_l_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_dv_l_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_dv_l_1d subroutine kokkos_allocate_dv_i32_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer (INT32), pointer, dimension(:), intent(inout) :: A - type (c_ptr), intent(out) :: v_A + type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer (c_int), intent(in) :: e0 - type (c_ptr) :: c_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i32_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_dv_i32_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_dv_i32_1d subroutine kokkos_allocate_dv_i64_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT64), pointer, dimension(:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 + integer(c_size_t), intent(in) :: e0 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i64_1d(c_A, v_A, c_loc(f_label), e0) + call f_kokkos_allocate_dv_i64_1d(c_A, v_A, f_label, e0) call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_dv_i64_1d subroutine kokkos_allocate_dv_r32_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding - implicit none - real(REAL32), pointer, dimension(:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r32_1d(c_A, v_A, c_loc(f_label), e0) - call c_f_pointer(c_A, A, shape=[e0]) + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL32), pointer, dimension(:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_dv_r32_1d(c_A, v_A, f_label, e0) + call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_dv_r32_1d subroutine kokkos_allocate_dv_r64_1d(A, v_A, n_A, e0) use, intrinsic :: iso_c_binding - implicit none - real(REAL64), pointer, dimension(:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r64_1d(c_A, v_A, c_loc(f_label), e0) - call c_f_pointer(c_A, A, shape=[e0]) + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL64), pointer, dimension(:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_dv_r64_1d(c_A, v_A, f_label, e0) + call c_f_pointer(c_A, A, shape=[e0]) end subroutine kokkos_allocate_dv_r64_1d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos allocate dualview 2D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_dv_l_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_l_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_dv_l_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_dv_l_2d subroutine kokkos_allocate_dv_i32_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT32), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i32_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_dv_i32_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_dv_i32_2d subroutine kokkos_allocate_dv_i64_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer (INT64), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i64_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_dv_i64_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_dv_i64_2d subroutine kokkos_allocate_dv_r32_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL32), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r32_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_dv_r32_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_dv_r32_2d subroutine kokkos_allocate_dv_r64_2d(A, v_A, n_A, e0, e1) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL64), pointer, dimension(:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r64_2d(c_A, v_A, c_loc(f_label), e0, e1) + call f_kokkos_allocate_dv_r64_2d(c_A, v_A, f_label, e0, e1) call c_f_pointer(c_A, A, shape=[e0,e1]) end subroutine kokkos_allocate_dv_r64_2d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1346,92 +1375,97 @@ end subroutine kokkos_allocate_dv_r64_2d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_allocate_dv_l_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none logical(c_bool), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_l_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_dv_l_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_dv_l_3d subroutine kokkos_allocate_dv_i32_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT32), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i32_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_dv_i32_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_dv_i32_3d subroutine kokkos_allocate_dv_i64_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none integer(INT64), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_i64_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_dv_i64_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_dv_i64_3d subroutine kokkos_allocate_dv_r32_3d(A, v_A, n_A, e0, e1, e2) use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null implicit none real(REAL32), pointer, dimension(:,:,:), intent(inout) :: A type(c_ptr), intent(out) :: v_A character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 type(c_ptr) :: c_A character(len=:, kind=c_char), allocatable, target :: f_label call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r32_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) + call f_kokkos_allocate_dv_r32_3d(c_A, v_A, f_label, e0, e1, e2) call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_dv_r32_3d subroutine kokkos_allocate_dv_r64_3d(A, v_A, n_A, e0, e1, e2) - use, intrinsic :: iso_c_binding - implicit none - real(REAL64), pointer, dimension(:,:,:), intent(inout) :: A - type(c_ptr), intent(out) :: v_A - character(len=*), intent(in) :: n_A - integer(c_int), intent(in) :: e0 - integer(c_int), intent(in) :: e1 - integer(c_int), intent(in) :: e2 - type(c_ptr) :: c_A - - character(len=:, kind=c_char), allocatable, target :: f_label - - call char_add_null( n_A, f_label ) - call f_kokkos_allocate_dv_r64_3d(c_A, v_A, c_loc(f_label), e0, e1, e2) - call c_f_pointer(c_A, A, shape=[e0,e1,e2]) + use, intrinsic :: iso_c_binding + use flcl_util_strings_mod, only: char_add_null + implicit none + real(REAL64), pointer, dimension(:,:,:), intent(inout) :: A + type(c_ptr), intent(out) :: v_A + character(len=*), intent(in) :: n_A + integer(c_size_t), intent(in) :: e0 + integer(c_size_t), intent(in) :: e1 + integer(c_size_t), intent(in) :: e2 + type(c_ptr) :: c_A + + character(len=:, kind=c_char), allocatable, target :: f_label + + call char_add_null( n_A, f_label ) + call f_kokkos_allocate_dv_r64_3d(c_A, v_A, f_label, e0, e1, e2) + call c_f_pointer(c_A, A, shape=[e0,e1,e2]) end subroutine kokkos_allocate_dv_r64_3d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! kokkos deallocate view 1D implementations @@ -1917,6 +1951,50 @@ function to_nd_array_r64_1d(array) result(ndarray) ndarray%data = c_loc(array(1)) end if end function to_nd_array_r64_1d + + function to_nd_array_c32_1d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2)), 1_c_size_t) - & + transfer(c_loc(array(1)), 1_c_size_t)) / c_sizeof(array(1)) + else + ndarray%strides(1) = 1 + end if + + ndarray%rank = 1 + if (size(array, 1) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1)) + end if + end function to_nd_array_c32_1d + + function to_nd_array_c64_1d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2)), 1_c_size_t) - & + transfer(c_loc(array(1)), 1_c_size_t)) / c_sizeof(array(1)) + else + ndarray%strides(1) = 1 + end if + + ndarray%rank = 1 + if (size(array, 1) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1)) + end if + end function to_nd_array_c64_1d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! to_nd_array 2D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2079,6 +2157,70 @@ function to_nd_array_r64_2d(array) result(ndarray) ndarray%data = c_loc(array(1,1)) end if end function to_nd_array_r64_2d + + function to_nd_array_c32_2d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1)), 1_c_size_t)) / c_sizeof(array(1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1)), 1_c_size_t)) / c_sizeof(array(1,1)) + else + ndarray%strides(2) = size(array, 1) + end if + + ndarray%rank = 2 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1)) + end if + end function to_nd_array_c32_2d + + function to_nd_array_c64_2d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1)), 1_c_size_t)) / c_sizeof(array(1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1)), 1_c_size_t)) / c_sizeof(array(1,1)) + else + ndarray%strides(2) = size(array, 1) + end if + + ndarray%rank = 2 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1)) + end if + end function to_nd_array_c64_2d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! to_nd_array 3D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2291,47 +2433,131 @@ function to_nd_array_r64_3d(array) result(ndarray) ndarray%data = c_loc(array(1,1,1)) end if end function to_nd_array_r64_3d -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! to_nd_array 4D implementations -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - function to_nd_array_l_4d(array) result(ndarray) - logical(c_bool), target, intent(in) :: array(:,:,:,:) + + function to_nd_array_c32_3d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:,:) type(nd_array_t) :: ndarray ndarray%dims(1) = size(array, 1, c_size_t) ndarray%dims(2) = size(array, 2, c_size_t) ndarray%dims(3) = size(array, 3, c_size_t) - ndarray%dims(4) = size(array, 4, c_size_t) if (size(array, 1) .ge. 2) then ndarray%strides(1) = & - (transfer(c_loc(array(2,1,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + (transfer(c_loc(array(2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) else ndarray%strides(1) = 1 end if if (size(array, 2) .ge. 2) then ndarray%strides(2) = & - (transfer(c_loc(array(1,2,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + (transfer(c_loc(array(1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) else ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) end if if (size(array, 3) .ge. 2) then ndarray%strides(3) = & - (transfer(c_loc(array(1,1,2,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + (transfer(c_loc(array(1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) else ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) end if - if (size(array, 4) .ge. 2) then - ndarray%strides(4) = & - (transfer(c_loc(array(1,1,1,2)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + ndarray%rank = 3 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1)) + end if + end function to_nd_array_c32_3d + + function to_nd_array_c64_3d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + ndarray%rank = 3 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1)) + end if + end function to_nd_array_c64_3d +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!! to_nd_array 4D implementations +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + function to_nd_array_l_4d(array) result(ndarray) + logical(c_bool), target, intent(in) :: array(:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) else ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) end if @@ -2548,6 +2774,108 @@ function to_nd_array_r64_4d(array) result(ndarray) ndarray%data = c_loc(array(1,1,1,1)) end if end function to_nd_array_r64_4d + + function to_nd_array_c32_4d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + ndarray%rank = 4 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1)) + end if + end function to_nd_array_c32_4d + + function to_nd_array_c64_4d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + ndarray%rank = 4 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1)) + end if + end function to_nd_array_c64_4d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! to_nd_array 5D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2763,40 +3091,295 @@ function to_nd_array_r32_5d(array) result(ndarray) if (size(array, 3) .ge. 2) then ndarray%strides(3) = & - (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + ndarray%rank = 5 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1)) + end if + end function to_nd_array_r32_5d + + function to_nd_array_r64_5d(array) result(ndarray) + real(REAL64), target, intent(in) :: array(:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + ndarray%rank = 5 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1)) + end if + end function to_nd_array_r64_5d + + function to_nd_array_c32_5d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + ndarray%rank = 5 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1)) + end if + end function to_nd_array_c32_5d + + function to_nd_array_c64_5d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + ndarray%rank = 5 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1)) + end if + end function to_nd_array_c64_5d +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!! to_nd_array 6D implementations +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + function to_nd_array_l_6d(array) result(ndarray) + logical(c_bool), target, intent(in) :: array(:,:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + ndarray%dims(6) = size(array, 6, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) end if if (size(array, 4) .ge. 2) then ndarray%strides(4) = & - (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) end if if (size(array, 5) .ge. 2) then ndarray%strides(5) = & - (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) end if - ndarray%rank = 5 + if (size(array, 6) .ge. 2) then + ndarray%strides(6) = & + (transfer(c_loc(array(1,1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) + else + ndarray%strides(6) = size(array, 5, c_size_t) * ndarray%strides(5) + end if + + ndarray%rank = 6 if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & - & size(array, 5) .eq. 0) then + & size(array, 5) .eq. 0 .or. size(array, 6) .eq. 0) then ndarray%data = c_null_ptr else - ndarray%data = c_loc(array(1,1,1,1,1)) + ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_r32_5d + end function to_nd_array_l_6d - function to_nd_array_r64_5d(array) result(ndarray) - real(REAL64), target, intent(in) :: array(:,:,:,:,:) + function to_nd_array_i32_6d(array) result(ndarray) + integer(INT32), target, intent(in) :: array(:,:,:,:,:,:) type(nd_array_t) :: ndarray @@ -2805,61 +3388,68 @@ function to_nd_array_r64_5d(array) result(ndarray) ndarray%dims(3) = size(array, 3, c_size_t) ndarray%dims(4) = size(array, 4, c_size_t) ndarray%dims(5) = size(array, 5, c_size_t) + ndarray%dims(6) = size(array, 6, c_size_t) if (size(array, 1) .ge. 2) then ndarray%strides(1) = & - (transfer(c_loc(array(2,1,1,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(2,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(1) = 1 end if if (size(array, 2) .ge. 2) then ndarray%strides(2) = & - (transfer(c_loc(array(1,2,1,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) end if if (size(array, 3) .ge. 2) then ndarray%strides(3) = & - (transfer(c_loc(array(1,1,2,1,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) end if if (size(array, 4) .ge. 2) then ndarray%strides(4) = & - (transfer(c_loc(array(1,1,1,2,1)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) end if if (size(array, 5) .ge. 2) then ndarray%strides(5) = & - (transfer(c_loc(array(1,1,1,1,2)), 1_c_size_t) - & - transfer(c_loc(array(1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1)) + (transfer(c_loc(array(1,1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) else ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) end if - ndarray%rank = 5 + if (size(array, 6) .ge. 2) then + ndarray%strides(6) = & + (transfer(c_loc(array(1,1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1)) + else + ndarray%strides(6) = size(array, 5, c_size_t) * ndarray%strides(5) + end if + + ndarray%rank = 6 if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & - & size(array, 5) .eq. 0) then + & size(array, 5) .eq. 0 .or. size(array, 6) .eq. 0) then ndarray%data = c_null_ptr else - ndarray%data = c_loc(array(1,1,1,1,1)) + ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_r64_5d -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! to_nd_array 6D implementations -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - function to_nd_array_l_6d(array) result(ndarray) - logical(c_bool), target, intent(in) :: array(:,:,:,:,:,:) + end function to_nd_array_i32_6d + + function to_nd_array_i64_6d(array) result(ndarray) + integer(INT64), target, intent(in) :: array(:,:,:,:,:,:) type(nd_array_t) :: ndarray @@ -2926,10 +3516,10 @@ function to_nd_array_l_6d(array) result(ndarray) else ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_l_6d + end function to_nd_array_i64_6d - function to_nd_array_i32_6d(array) result(ndarray) - integer(INT32), target, intent(in) :: array(:,:,:,:,:,:) + function to_nd_array_r32_6d(array) result(ndarray) + real(REAL32), target, intent(in) :: array(:,:,:,:,:,:) type(nd_array_t) :: ndarray @@ -2996,10 +3586,10 @@ function to_nd_array_i32_6d(array) result(ndarray) else ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_i32_6d + end function to_nd_array_r32_6d - function to_nd_array_i64_6d(array) result(ndarray) - integer(INT64), target, intent(in) :: array(:,:,:,:,:,:) + function to_nd_array_r64_6d(array) result(ndarray) + real(REAL64), target, intent(in) :: array(:,:,:,:,:,:) type(nd_array_t) :: ndarray @@ -3066,11 +3656,11 @@ function to_nd_array_i64_6d(array) result(ndarray) else ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_i64_6d + end function to_nd_array_r64_6d - function to_nd_array_r32_6d(array) result(ndarray) - real(REAL32), target, intent(in) :: array(:,:,:,:,:,:) - + function to_nd_array_c32_6d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:,:,:,:,:) + type(nd_array_t) :: ndarray ndarray%dims(1) = size(array, 1, c_size_t) @@ -3136,11 +3726,11 @@ function to_nd_array_r32_6d(array) result(ndarray) else ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_r32_6d + end function to_nd_array_c32_6d - function to_nd_array_r64_6d(array) result(ndarray) - real(REAL64), target, intent(in) :: array(:,:,:,:,:,:) - + function to_nd_array_c64_6d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:,:,:,:,:) + type(nd_array_t) :: ndarray ndarray%dims(1) = size(array, 1, c_size_t) @@ -3206,7 +3796,7 @@ function to_nd_array_r64_6d(array) result(ndarray) else ndarray%data = c_loc(array(1,1,1,1,1,1)) end if - end function to_nd_array_r64_6d + end function to_nd_array_c64_6d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! to_nd_array 7D implementations !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -3604,6 +4194,164 @@ function to_nd_array_r64_7d(array) result(ndarray) ndarray%data = c_loc(array(1,1,1,1,1,1,1)) end if end function to_nd_array_r64_7d + + function to_nd_array_c32_7d(array) result(ndarray) + complex(c_float_complex), target, intent(in) :: array(:,:,:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + ndarray%dims(6) = size(array, 6, c_size_t) + ndarray%dims(7) = size(array, 7, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + if (size(array, 6) .ge. 2) then + ndarray%strides(6) = & + (transfer(c_loc(array(1,1,1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(6) = size(array, 5, c_size_t) * ndarray%strides(5) + end if + + if (size(array, 7) .ge. 2) then + ndarray%strides(7) = & + (transfer(c_loc(array(1,1,1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(7) = size(array, 6, c_size_t) * ndarray%strides(6) + end if + + ndarray%rank = 7 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0 .or. size(array, 6) .eq. 0 .or. size(array, 7) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1,1,1)) + end if + end function to_nd_array_c32_7d + + function to_nd_array_c64_7d(array) result(ndarray) + complex(c_double_complex), target, intent(in) :: array(:,:,:,:,:,:,:) + + type(nd_array_t) :: ndarray + + ndarray%dims(1) = size(array, 1, c_size_t) + ndarray%dims(2) = size(array, 2, c_size_t) + ndarray%dims(3) = size(array, 3, c_size_t) + ndarray%dims(4) = size(array, 4, c_size_t) + ndarray%dims(5) = size(array, 5, c_size_t) + ndarray%dims(6) = size(array, 6, c_size_t) + ndarray%dims(7) = size(array, 7, c_size_t) + + if (size(array, 1) .ge. 2) then + ndarray%strides(1) = & + (transfer(c_loc(array(2,1,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(1) = 1 + end if + + if (size(array, 2) .ge. 2) then + ndarray%strides(2) = & + (transfer(c_loc(array(1,2,1,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(2) = size(array, 1, c_size_t) * ndarray%strides(1) + end if + + if (size(array, 3) .ge. 2) then + ndarray%strides(3) = & + (transfer(c_loc(array(1,1,2,1,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(3) = size(array, 2, c_size_t) * ndarray%strides(2) + end if + + if (size(array, 4) .ge. 2) then + ndarray%strides(4) = & + (transfer(c_loc(array(1,1,1,2,1,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(4) = size(array, 3, c_size_t) * ndarray%strides(3) + end if + + if (size(array, 5) .ge. 2) then + ndarray%strides(5) = & + (transfer(c_loc(array(1,1,1,1,2,1,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(5) = size(array, 4, c_size_t) * ndarray%strides(4) + end if + + if (size(array, 6) .ge. 2) then + ndarray%strides(6) = & + (transfer(c_loc(array(1,1,1,1,1,2,1)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(6) = size(array, 5, c_size_t) * ndarray%strides(5) + end if + + if (size(array, 7) .ge. 2) then + ndarray%strides(7) = & + (transfer(c_loc(array(1,1,1,1,1,1,2)), 1_c_size_t) - & + transfer(c_loc(array(1,1,1,1,1,1,1)), 1_c_size_t)) / c_sizeof(array(1,1,1,1,1,1,1)) + else + ndarray%strides(7) = size(array, 6, c_size_t) * ndarray%strides(6) + end if + + ndarray%rank = 7 + if (size(array, 1) .eq. 0 .or. size(array, 2) .eq. 0 .or. & + & size(array, 3) .eq. 0 .or. size(array, 4) .eq. 0 .or. & + & size(array, 5) .eq. 0 .or. size(array, 6) .eq. 0 .or. size(array, 7) .eq. 0) then + ndarray%data = c_null_ptr + else + ndarray%data = c_loc(array(1,1,1,1,1,1,1)) + end if + end function to_nd_array_c64_7d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! fin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/src/flcl-util-f.f90 b/src/flcl-util-kokkos-f.f90 similarity index 87% rename from src/flcl-util-f.f90 rename to src/flcl-util-kokkos-f.f90 index 306de2a..e2b2856 100644 --- a/src/flcl-util-f.f90 +++ b/src/flcl-util-kokkos-f.f90 @@ -35,7 +35,7 @@ ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -module flcl_util_mod +module flcl_util_kokkos_mod use, intrinsic :: iso_c_binding use, intrinsic :: iso_fortran_env @@ -85,8 +85,8 @@ subroutine f_kokkos_print_configuration( prepend_name_in, file_name_in ) & & bind(c, name='c_kokkos_print_configuration') use, intrinsic :: iso_c_binding implicit none - type (c_ptr), intent(in) :: prepend_name_in - type (c_ptr), intent(in) :: file_name_in + character(kind=c_char), intent(in) :: prepend_name_in(*) + character(kind=c_char), intent(in) :: file_name_in(*) end subroutine f_kokkos_print_configuration end interface @@ -107,7 +107,8 @@ subroutine kokkos_initialize() use, intrinsic :: iso_c_binding implicit none integer :: arg_count, max_length = 0, str_length, n, cli_count - character(kind=c_char, len=:), allocatable, target :: strs(:) + character(kind=c_char, len=:), allocatable :: str + character(kind=c_char), allocatable, target :: strs_array(:,:) type(c_ptr), allocatable, target :: c_strs(:) arg_count = command_argument_count() @@ -117,18 +118,25 @@ subroutine kokkos_initialize() max_length = max(max_length, str_length) end do - allocate(character(max_length + 1) :: strs(0:arg_count)) + allocate(strs_array(1:max_length + 1, 0:arg_count)) allocate(c_strs(0:arg_count)) + allocate(character(max_length) :: str) do n = 0, arg_count - call get_command_argument(n, length=str_length) - call get_command_argument(n, value=strs(n), length=str_length) - strs(n)(str_length + 1:str_length + 1) = c_null_char - c_strs(n) = c_loc(strs(n)) + call get_command_argument(n, value=str, length=str_length) + strs_array(1:str_length, n) = transfer(str, ' ', size=str_length) + strs_array(str_length+1, n) = c_null_char + c_strs(n) = c_loc(strs_array(:,n)) end do cli_count = arg_count + 1 - call f_kokkos_initialize(cli_count, c_loc(c_strs(0))) + if( cli_count .le. 0 ) then + ! must call the without_args variant or get array-oob error + call f_kokkos_initialize_without_args() + else + call f_kokkos_initialize(cli_count, c_loc(c_strs(0))) + endif + end subroutine kokkos_initialize !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_initialize_without_args() @@ -149,7 +157,7 @@ end subroutine kokkos_finalize !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine kokkos_print_configuration( prepend_name_in, file_name_in ) use, intrinsic :: iso_c_binding - use flcl_mod, only: char_add_null + use flcl_util_strings_mod, only: char_add_null implicit none character(len=*), intent(in) :: prepend_name_in @@ -159,9 +167,8 @@ subroutine kokkos_print_configuration( prepend_name_in, file_name_in ) call char_add_null( prepend_name_in, prepend_name_out ) call char_add_null( file_name_in, file_name_out ) - - call f_kokkos_print_configuration( & - & c_loc(prepend_name_out), c_loc(file_name_out) ) + + call f_kokkos_print_configuration( prepend_name_out, file_name_out ) end subroutine kokkos_print_configuration !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -174,4 +181,4 @@ function kokkos_is_initialized() result(is_init) is_init = logical(c_is_init) end function kokkos_is_initialized !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -end module flcl_util_mod \ No newline at end of file +end module flcl_util_kokkos_mod \ No newline at end of file diff --git a/src/flcl-util-strings-f.f90 b/src/flcl-util-strings-f.f90 new file mode 100644 index 0000000..f32fb95 --- /dev/null +++ b/src/flcl-util-strings-f.f90 @@ -0,0 +1,63 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +module flcl_util_strings_mod + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + implicit none + private + + public :: char_add_null +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + contains +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine char_add_null( input_char, f_label ) + use, intrinsic :: iso_c_binding + implicit none + character(len=*), intent(in) :: input_char + character(len=:), allocatable, target, intent(inout):: f_label + + integer :: strlen + strlen = len(input_char) + allocate(character(len=strlen+1) :: f_label) + + f_label(1:strlen) = input_char(1:strlen) + f_label(strlen+1:strlen+1) = c_null_char + end subroutine + +end module flcl_util_strings_mod \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..39c678a --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,86 @@ +add_library(flcl-testlib-fortran + OBJECT + flcl-test-f.f90 +) +target_include_directories(flcl-testlib-fortran + PUBLIC + $ + INTERFACE + $ + $ +) +set_target_properties( + flcl-testlib-fortran + PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mod" +) +target_link_libraries(flcl-testlib-fortran + FLCL::flcl +) + +add_library(flcl-testlib-cxx + OBJECT + flcl-test-cxx.cpp +) +target_include_directories(flcl-testlib-cxx + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../src +) +target_link_libraries(flcl-testlib-cxx + FLCL::flcl +) + +add_library(flcl-testlib + #STATIC + $ + $ +) +target_include_directories(flcl-testlib + INTERFACE + $ + $ +) +target_link_libraries(flcl-testlib + FLCL::flcl +) + +#set_target_properties(flcl-testlib PROPERTIES INSTALL_RPATH ${RPATHS}) + + +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test) +set(CTEST_BINARY_DIRECTORY ${PROJECT_BINARY_DIR}/test) + +file(GLOB files "test_*.f90") + +# if cmake 3.17 is supported everywhere +# list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure") + +foreach(file ${files}) + string(REGEX REPLACE "(^.*/|\\.[^.]*$)" "" file_without_ext ${file}) + add_executable(${file_without_ext} ${file}) + if (CMAKE_Fortran_COMPILER_ID STREQUAL "XL") + target_link_options(${file_without_ext} PRIVATE LINKER:-lxlf90_r) + endif() + if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + set_target_properties(${file_without_ext} PROPERTIES LINKER_LANGUAGE Fortran) + endif() + set(RPATHS "$ENV{LD_LIBRARY_PATH}") + set_target_properties(${file_without_ext} PROPERTIES + BUILD_WITH_INSTALL_RPATH True + INSTALL_RPATH ${RPATHS}) + set_target_properties(${file_without_ext} PROPERTIES INSTALL_RPATH ${RPATHS} BUILD_WITH_INSTALL_RPATH True) + target_link_libraries(${file_without_ext} ${PROJECT_LIBS} FLCL::flcl flcl-testlib) + add_test(${file_without_ext} ${file_without_ext}) + # set_target_properties(${file_without_ext} PROPERTIES LINKER_LANGUAGE Fortran) + set_tests_properties(${file_without_ext} + PROPERTIES + PASS_REGULAR_EXPRESSION "PASSED") + set_tests_properties(${file_without_ext} + PROPERTIES + FAIL_REGULAR_EXPRESSION "FAILED") + set_tests_properties(${file_without_ext} + PROPERTIES + TIMEOUT 120) + +endforeach() diff --git a/test/flcl-test-cxx.cpp b/test/flcl-test-cxx.cpp new file mode 100644 index 0000000..2f0be28 --- /dev/null +++ b/test/flcl-test-cxx.cpp @@ -0,0 +1,2393 @@ +// Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +// +// This program was produced under U.S. Government contract 89233218CNA000001 for +// Los Alamos National Laboratory (LANL), which is operated by Triad National +// Security, LLC for the U.S. Department of Energy/National Nuclear Security +// Administration. All rights in the program are reserved by Triad National +// Security, LLC, and the U.S. Department of Energy/National Nuclear Security +// Administration. The Government is granted for itself and others acting on +// its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +// material to reproduce, prepare derivative works, distribute copies to the +// public, perform publicly and display publicly, and to permit others to do so. +// +// This program is open source under the BSD-3 License. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the copyright holder nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include + +extern "C" { + + size_t c_test_ndarray_l_1d( flcl_ndarray_t *nd_array_l_1d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_1d = view_from_ndarray(*nd_array_l_1d); + + for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { + if ( array_l_1d(ii) ) c_sum++; + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { + array_l_1d(ii) = logical_post; + } + + return c_sum; + } + + size_t c_test_ndarray_i32_1d( flcl_ndarray_t *nd_array_i32_1d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_1d = view_from_ndarray(*nd_array_i32_1d); + + for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { + c_sum = c_sum + array_i32_1d(ii); + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { + array_i32_1d(ii) = ii; + c_sum = c_sum + array_i32_1d(ii); + } + + return c_sum; + } + + size_t c_test_ndarray_i64_1d( flcl_ndarray_t *nd_array_i64_1d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_1d = view_from_ndarray(*nd_array_i64_1d); + + for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { + c_sum = c_sum + array_i64_1d(ii); + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED ndarray_i64_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { + array_i64_1d(ii) = ii; + c_sum = c_sum + array_i64_1d(ii); + } + + return c_sum; + } + + float c_test_ndarray_r32_1d( flcl_ndarray_t *nd_array_r32_1d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_1d = view_from_ndarray(*nd_array_r32_1d); + + for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { + c_sum = c_sum + array_r32_1d(ii); + } + + if ( std::abs(c_sum - *f_sum) > precision_single * c_sum) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { + array_r32_1d(ii) = ii; + c_sum = c_sum + array_r32_1d(ii); + } + + return c_sum; + } + + double c_test_ndarray_r64_1d( flcl_ndarray_t *nd_array_r64_1d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_1d = view_from_ndarray(*nd_array_r64_1d); + + for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { + c_sum = c_sum + array_r64_1d(ii); + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { + array_r64_1d(ii) = ii; + c_sum = c_sum + array_r64_1d(ii); + } + + return c_sum; + } + + float _Complex c_test_ndarray_c32_1d( flcl_ndarray_t *nd_array_c32_1d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_1d = view_from_ndarray*>(*nd_array_c32_1d); + for (size_t ii = 0; ii < array_c32_1d.extent(0); ii++) { + c_sum = c_sum + array_c32_1d(ii); + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_1d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_1d.extent(0); ii++) { + array_c32_1d(ii) = Kokkos::complex(1.0*(ii),-1.0*(ii)); + c_sum = c_sum + array_c32_1d(ii); + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + + } + + double _Complex c_test_ndarray_c64_1d( flcl_ndarray_t *nd_array_c64_1d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_1d = view_from_ndarray*>(*nd_array_c64_1d); + for (size_t ii = 0; ii < array_c64_1d.extent(0); ii++) { + c_sum = c_sum + array_c64_1d(ii); + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_1d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_1d.extent(0); ii++) { + array_c64_1d(ii) = Kokkos::complex(1.0*(ii),-1.0*(ii)); + c_sum = c_sum + array_c64_1d(ii); + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + + } + + size_t c_test_ndarray_l_2d( flcl_ndarray_t *nd_array_l_2d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_2d = view_from_ndarray(*nd_array_l_2d); + + for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { + if ( array_l_2d(ii,jj) ) c_sum++; + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_2d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { + array_l_2d(ii,jj) = logical_post; + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_2d( flcl_ndarray_t *nd_array_i32_2d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_2d = view_from_ndarray(*nd_array_i32_2d); + + for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { + c_sum = c_sum + array_i32_2d(ii,jj); + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_2d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { + array_i32_2d(ii,jj) = ii+jj; + c_sum = c_sum + array_i32_2d(ii,jj); + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_2d( flcl_ndarray_t *nd_array_i64_2d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_2d = view_from_ndarray(*nd_array_i64_2d); + + for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { + c_sum = c_sum + array_i64_2d(ii,jj); + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_2d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { + array_i64_2d(ii,jj) = ii+jj; + c_sum = c_sum + array_i64_2d(ii,jj); + } + } + + return c_sum; + } + + float c_test_ndarray_r32_2d( flcl_ndarray_t *nd_array_r32_2d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_2d = view_from_ndarray(*nd_array_r32_2d); + + for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { + c_sum = c_sum + array_r32_2d(ii,jj); + } + } + + if ( std::abs(c_sum - *f_sum) > precision_single * c_sum) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_2d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { + array_r32_2d(ii,jj) = ii+jj; + c_sum = c_sum + array_r32_2d(ii,jj); + } + } + + return c_sum; + } + + double c_test_ndarray_r64_2d( flcl_ndarray_t *nd_array_r64_2d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_2d = view_from_ndarray(*nd_array_r64_2d); + + for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { + c_sum = c_sum + array_r64_2d(ii,jj); + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_1d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { + array_r64_2d(ii,jj) = ii+jj; + c_sum = c_sum + array_r64_2d(ii,jj); + } + } + + return c_sum; + } + + float _Complex c_test_ndarray_c32_2d( flcl_ndarray_t *nd_array_c32_2d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_2d = view_from_ndarray**>(*nd_array_c32_2d); + for (size_t ii = 0; ii < array_c32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_2d.extent(1); jj++) { + c_sum = c_sum + array_c32_2d(ii,jj); + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_2d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_2d.extent(1); jj++) { + array_c32_2d(ii,jj) = Kokkos::complex(1.0*(ii+jj),-1.0*(ii+jj)); + c_sum = c_sum + array_c32_2d(ii,jj); + } + } + + // float _Complex c_sum_to_return; + // c_sum_to_return = c_sum.real() + c_sum.imag()*I; + // return c_sum_to_return; + + // float _Complex c_sum_to_return; + // Kokkos::View*, Kokkos::LayoutLeft, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> kvtr = + // Kokkos::View*, Kokkos::LayoutLeft, Kokkos::HostSpace, Kokkos::MemoryUnmanaged>(reinterpret_cast *>(&c_sum_to_return)); + // kvtr(0) = c_sum; + // return c_sum_to_return; + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_2d( flcl_ndarray_t *nd_array_c64_2d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_2d = view_from_ndarray**>(*nd_array_c64_2d); + for (size_t ii = 0; ii < array_c64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_2d.extent(1); jj++) { + c_sum = c_sum + array_c64_2d(ii,jj); + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_2d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_2d.extent(1); jj++) { + array_c64_2d(ii,jj) = Kokkos::complex(1.0*(ii+jj),-1.0*(ii+jj)); + c_sum = c_sum + array_c64_2d(ii,jj); + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + size_t c_test_ndarray_l_3d( flcl_ndarray_t *nd_array_l_3d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_3d = view_from_ndarray(*nd_array_l_3d); + + for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { + if ( array_l_3d(ii,jj,kk) ) c_sum++; + } + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_3d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { + array_l_3d(ii,jj,kk) = logical_post; + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_3d( flcl_ndarray_t *nd_array_i32_3d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_3d = view_from_ndarray(*nd_array_i32_3d); + + for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { + c_sum = c_sum + array_i32_3d(ii,jj,kk); + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_3d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { + array_i32_3d(ii,jj,kk) = ii+jj+kk; + c_sum = c_sum + array_i32_3d(ii,jj,kk); + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_3d( flcl_ndarray_t *nd_array_i64_3d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_3d = view_from_ndarray(*nd_array_i64_3d); + + for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { + c_sum = c_sum + array_i64_3d(ii,jj,kk); + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_3d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { + array_i64_3d(ii,jj,kk) = ii+jj+kk; + c_sum = c_sum + array_i64_3d(ii,jj,kk); + } + } + } + + return c_sum; + } + + float c_test_ndarray_r32_3d( flcl_ndarray_t *nd_array_r32_3d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_3d = view_from_ndarray(*nd_array_r32_3d); + + for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { + c_sum = c_sum + array_r32_3d(ii,jj,kk); + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_single * c_sum) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_3d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { + array_r32_3d(ii,jj,kk) = ii+jj+kk; + c_sum = c_sum + array_r32_3d(ii,jj,kk); + } + } + } + + return c_sum; + } + + double c_test_ndarray_r64_3d( flcl_ndarray_t *nd_array_r64_3d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_3d = view_from_ndarray(*nd_array_r64_3d); + + for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { + c_sum = c_sum + array_r64_3d(ii,jj,kk); + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_3d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { + array_r64_3d(ii,jj,kk) = ii+jj+kk; + c_sum = c_sum + array_r64_3d(ii,jj,kk); + } + } + } + + return c_sum; + + } + + float _Complex c_test_ndarray_c32_3d( flcl_ndarray_t *nd_array_c32_3d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_3d = view_from_ndarray***>(*nd_array_c32_3d); + for (size_t ii = 0; ii < array_c32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_3d.extent(2); kk++) { + c_sum = c_sum + array_c32_3d(ii,jj,kk); + } + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_3d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_3d.extent(2); kk++) { + array_c32_3d(ii,jj,kk) = Kokkos::complex(1.0*(ii+jj+kk),-1.0*(ii+jj+kk)); + c_sum = c_sum + array_c32_3d(ii,jj,kk); + } + } + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_3d( flcl_ndarray_t *nd_array_c64_3d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_3d = view_from_ndarray***>(*nd_array_c64_3d); + for (size_t ii = 0; ii < array_c64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_3d.extent(2); kk++) { + c_sum = c_sum + array_c64_3d(ii,jj,kk); + // std::cout << "c ii "<< ii << " jj " << " kk " << kk << " c_sum " << c_sum << std::endl; + } + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_3d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_3d.extent(2); kk++) { + array_c64_3d(ii,jj,kk) = Kokkos::complex(1.0*(ii+jj+kk),-1.0*(ii+jj+kk)); + // c_sum = c_sum + array_c64_3d(ii,jj,kk); + c_sum = c_sum + array_c64_3d(ii,jj,kk); + // std::cout << "c ii "<< ii << " jj " << " kk " << kk << " c_sum " << c_sum << std::endl; + } + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + size_t c_test_ndarray_l_4d( flcl_ndarray_t *nd_array_l_4d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_4d = view_from_ndarray(*nd_array_l_4d); + + for (size_t ii = 0; ii < array_l_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_4d.extent(3); ll++) { + if ( array_l_4d(ii,jj,kk,ll) ) c_sum++; + } + } + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_4d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_4d.extent(3); ll++) { + array_l_4d(ii,jj,kk,ll) = logical_post; + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_4d( flcl_ndarray_t *nd_array_i32_4d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_4d = view_from_ndarray(*nd_array_i32_4d); + + for (size_t ii = 0; ii < array_i32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_4d.extent(3); ll++) { + c_sum = c_sum + array_i32_4d(ii,jj,kk,ll); + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_4d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_4d.extent(3); ll++) { + array_i32_4d(ii,jj,kk,ll) = ii+jj+kk+ll; + c_sum = c_sum + array_i32_4d(ii,jj,kk,ll); + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_4d( flcl_ndarray_t *nd_array_i64_4d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_4d = view_from_ndarray(*nd_array_i64_4d); + + for (size_t ii = 0; ii < array_i64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_4d.extent(3); ll++) { + c_sum = c_sum + array_i64_4d(ii,jj,kk,ll); + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_4d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_4d.extent(3); ll++) { + array_i64_4d(ii,jj,kk,ll) = ii+jj+kk+ll; + c_sum = c_sum + array_i64_4d(ii,jj,kk,ll); + } + } + } + } + + return c_sum; + } + + float c_test_ndarray_r32_4d( flcl_ndarray_t *nd_array_r32_4d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_4d = view_from_ndarray(*nd_array_r32_4d); + + for (size_t ii = 0; ii < array_r32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_4d.extent(3); ll++) { + c_sum = c_sum + array_r32_4d(ii,jj,kk,ll); + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_single * c_sum) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_4d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_4d.extent(3); ll++) { + array_r32_4d(ii,jj,kk,ll) = ii+jj+kk+ll; + c_sum = c_sum + array_r32_4d(ii,jj,kk,ll); + } + } + } + } + + return c_sum; + } + + double c_test_ndarray_r64_4d( flcl_ndarray_t *nd_array_r64_4d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_4d = view_from_ndarray(*nd_array_r64_4d); + + for (size_t ii = 0; ii < array_r64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_4d.extent(3); ll++) { + c_sum = c_sum + array_r64_4d(ii,jj,kk,ll); + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_4d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_4d.extent(3); ll++) { + array_r64_4d(ii,jj,kk,ll) = ii+jj+kk+ll; + c_sum = c_sum + array_r64_4d(ii,jj,kk,ll); + } + } + } + } + + return c_sum; + + } + + float _Complex c_test_ndarray_c32_4d( flcl_ndarray_t *nd_array_c32_4d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_4d = view_from_ndarray****>(*nd_array_c32_4d); + for (size_t ii = 0; ii < array_c32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_4d.extent(3); ll++) { + c_sum = c_sum + array_c32_4d(ii,jj,kk,ll); + } + } + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_4d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_4d.extent(3); ll++) { + array_c32_4d(ii,jj,kk,ll) = Kokkos::complex(1.0*(ii+jj+kk+ll),-1.0*(ii+jj+kk+ll)); + c_sum = c_sum + array_c32_4d(ii,jj,kk,ll); + } + } + } + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_4d( flcl_ndarray_t *nd_array_c64_4d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_4d = view_from_ndarray****>(*nd_array_c64_4d); + for (size_t ii = 0; ii < array_c64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_4d.extent(3); ll++) { + c_sum = c_sum + array_c64_4d(ii,jj,kk,ll); + } + } + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_4d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_4d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_4d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_4d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_4d.extent(3); ll++) { + array_c64_4d(ii,jj,kk,ll) = Kokkos::complex(1.0*(ii+jj+kk+ll),-1.0*(ii+jj+kk+ll)); + c_sum = c_sum + array_c64_4d(ii,jj,kk,ll); + } + } + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + size_t c_test_ndarray_l_5d( flcl_ndarray_t *nd_array_l_5d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_5d = view_from_ndarray(*nd_array_l_5d); + + for (size_t ii = 0; ii < array_l_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_5d.extent(4); mm++) { + if ( array_l_5d(ii,jj,kk,ll,mm) ) c_sum++; + } + } + } + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_5d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_5d.extent(4); mm++) { + array_l_5d(ii,jj,kk,ll,mm) = logical_post; + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_5d( flcl_ndarray_t *nd_array_i32_5d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_5d = view_from_ndarray(*nd_array_i32_5d); + + for (size_t ii = 0; ii < array_i32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_5d.extent(4); mm++) { + c_sum = c_sum + array_i32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_5d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_5d.extent(4); mm++) { + array_i32_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm; + c_sum = c_sum + array_i32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_5d( flcl_ndarray_t *nd_array_i64_5d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_5d = view_from_ndarray(*nd_array_i64_5d); + + for (size_t ii = 0; ii < array_i64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_5d.extent(4); mm++) { + c_sum = c_sum + array_i64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_5d" << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_5d.extent(4); mm++) { + array_i64_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm; + c_sum = c_sum + array_i64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + return c_sum; + } + + float c_test_ndarray_r32_5d( flcl_ndarray_t *nd_array_r32_5d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_5d = view_from_ndarray(*nd_array_r32_5d); + + for (size_t ii = 0; ii < array_r32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_5d.extent(4); mm++) { + c_sum = c_sum + array_r32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > (precision_single * c_sum) ) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_5d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "std::abs(c_sum - *f_sum) = " << std::abs(c_sum - *f_sum) << std::endl; + std::cout << "(precision_single * c_sum) = " << (precision_single * c_sum) << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_5d.extent(4); mm++) { + array_r32_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm; + c_sum = c_sum + array_r32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + return c_sum; + } + + double c_test_ndarray_r64_5d( flcl_ndarray_t *nd_array_r64_5d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_5d = view_from_ndarray(*nd_array_r64_5d); + + for (size_t ii = 0; ii < array_r64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_5d.extent(4); mm++) { + c_sum = c_sum + array_r64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_5d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_5d.extent(4); mm++) { + array_r64_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm; + c_sum = c_sum + array_r64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + return c_sum; + + } + + float _Complex c_test_ndarray_c32_5d( flcl_ndarray_t *nd_array_c32_5d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_5d = view_from_ndarray*****>(*nd_array_c32_5d); + for (size_t ii = 0; ii < array_c32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_5d.extent(4); mm++) { + c_sum = c_sum + array_c32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_5d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_5d.extent(4); mm++) { + array_c32_5d(ii,jj,kk,ll,mm) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm),-1.0*(ii+jj+kk+ll+mm)); + c_sum = c_sum + array_c32_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_5d( flcl_ndarray_t *nd_array_c64_5d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_5d = view_from_ndarray*****>(*nd_array_c64_5d); + for (size_t ii = 0; ii < array_c64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_5d.extent(4); mm++) { + c_sum = c_sum + array_c64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_5d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_5d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_5d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_5d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_5d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_5d.extent(4); mm++) { + array_c64_5d(ii,jj,kk,ll,mm) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm),-1.0*(ii+jj+kk+ll+mm)); + c_sum = c_sum + array_c64_5d(ii,jj,kk,ll,mm); + } + } + } + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + size_t c_test_ndarray_l_6d( flcl_ndarray_t *nd_array_l_6d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_6d = view_from_ndarray(*nd_array_l_6d); + + for (size_t ii = 0; ii < array_l_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_l_6d.extent(5); nn++) { + if ( array_l_6d(ii,jj,kk,ll,mm,nn) ) c_sum++; + } + } + } + } + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_6d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_l_6d.extent(5); nn++) { + array_l_6d(ii,jj,kk,ll,mm,nn) = logical_post; + } + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_6d( flcl_ndarray_t *nd_array_i32_6d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_6d = view_from_ndarray(*nd_array_i32_6d); + + for (size_t ii = 0; ii < array_i32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i32_6d.extent(5); nn++) { + c_sum = c_sum + array_i32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_6d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i32_6d.extent(5); nn++) { + array_i32_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn; + c_sum = c_sum + array_i32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_6d( flcl_ndarray_t *nd_array_i64_6d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_6d = view_from_ndarray(*nd_array_i64_6d); + + for (size_t ii = 0; ii < array_i64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i64_6d.extent(5); nn++) { + c_sum = c_sum + array_i64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_6d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i64_6d.extent(5); nn++) { + array_i64_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn; + c_sum = c_sum + array_i64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + return c_sum; + } + + float c_test_ndarray_r32_6d( flcl_ndarray_t *nd_array_r32_6d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_6d = view_from_ndarray(*nd_array_r32_6d); + + for (size_t ii = 0; ii < array_r32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r32_6d.extent(5); nn++) { + c_sum = c_sum + array_r32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > (precision_single * c_sum) ) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_6d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "std::abs(c_sum - *f_sum) = " << std::abs(c_sum - *f_sum) << std::endl; + std::cout << "(precision_single * c_sum) = " << (precision_single * c_sum) << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r32_6d.extent(5); nn++) { + array_r32_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn; + c_sum = c_sum + array_r32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + return c_sum; + } + + double c_test_ndarray_r64_6d( flcl_ndarray_t *nd_array_r64_6d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_6d = view_from_ndarray(*nd_array_r64_6d); + + for (size_t ii = 0; ii < array_r64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r64_6d.extent(5); nn++) { + c_sum = c_sum + array_r64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_6d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r64_6d.extent(5); nn++) { + array_r64_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn; + c_sum = c_sum + array_r64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + return c_sum; + + } + + float _Complex c_test_ndarray_c32_6d( flcl_ndarray_t *nd_array_c32_6d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_6d = view_from_ndarray******>(*nd_array_c32_6d); + for (size_t ii = 0; ii < array_c32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c32_6d.extent(5); nn++) { + c_sum = c_sum + array_c32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_5d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c32_6d.extent(5); nn++) { + array_c32_6d(ii,jj,kk,ll,mm,nn) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm+nn),-1.0*(ii+jj+kk+ll+mm+nn)); + c_sum = c_sum + array_c32_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_6d( flcl_ndarray_t *nd_array_c64_6d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_6d = view_from_ndarray******>(*nd_array_c64_6d); + for (size_t ii = 0; ii < array_c64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c64_6d.extent(5); nn++) { + c_sum = c_sum + array_c64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_6d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_6d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_6d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_6d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_6d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_6d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c64_6d.extent(5); nn++) { + array_c64_6d(ii,jj,kk,ll,mm,nn) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm+nn),-1.0*(ii+jj+kk+ll+mm+nn)); + c_sum = c_sum + array_c64_6d(ii,jj,kk,ll,mm,nn); + } + } + } + } + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + size_t c_test_ndarray_l_7d( flcl_ndarray_t *nd_array_l_7d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_l_7d = view_from_ndarray(*nd_array_l_7d); + + for (size_t ii = 0; ii < array_l_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_l_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_l_7d.extent(6); oo++) { + if ( array_l_7d(ii,jj,kk,ll,mm,nn,oo) ) c_sum++; + } + } + } + } + } + } + } + + if (c_sum != *f_sum) { + std::cout << "FAILED C ndarray_l_7d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + for (size_t ii = 0; ii < array_l_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_l_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_l_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_l_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_l_7d.extent(6); oo++) { + array_l_7d(ii,jj,kk,ll,mm,nn,oo) = logical_post; + } + } + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i32_7d( flcl_ndarray_t *nd_array_i32_7d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i32_7d = view_from_ndarray(*nd_array_i32_7d); + + for (size_t ii = 0; ii < array_i32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_i32_7d.extent(6); oo++) { + c_sum = c_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i32_7d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_i32_7d.extent(6); oo++) { + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo; + c_sum = c_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + return c_sum; + } + + size_t c_test_ndarray_i64_7d( flcl_ndarray_t *nd_array_i64_7d, size_t *f_sum ) { + using flcl::view_from_ndarray; + + size_t c_sum = 0; + auto array_i64_7d = view_from_ndarray(*nd_array_i64_7d); + + for (size_t ii = 0; ii < array_i64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_i64_7d.extent(6); oo++) { + c_sum = c_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( c_sum != *f_sum ) { + std::cout << "FAILED C ndarray_i64_7d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_i64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_i64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_i64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_i64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_i64_7d.extent(6); oo++) { + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo; + c_sum = c_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + return c_sum; + } + + float c_test_ndarray_r32_7d( flcl_ndarray_t *nd_array_r32_7d, float *f_sum ) { + using flcl::view_from_ndarray; + + float c_sum = 0; + auto array_r32_7d = view_from_ndarray(*nd_array_r32_7d); + + for (size_t ii = 0; ii < array_r32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_r32_7d.extent(6); oo++) { + c_sum = c_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_single * c_sum) { + std::cout << std::setprecision(8) << std::fixed; + std::cout << "FAILED C ndarray_r32_7d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_r32_7d.extent(6); oo++) { + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo; + c_sum = c_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + return c_sum; + } + + double c_test_ndarray_r64_7d( flcl_ndarray_t *nd_array_r64_7d, double *f_sum ) { + using flcl::view_from_ndarray; + + double c_sum = 0; + auto array_r64_7d = view_from_ndarray(*nd_array_r64_7d); + + for (size_t ii = 0; ii < array_r64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_r64_7d.extent(6); oo++) { + c_sum = c_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( std::abs(c_sum - *f_sum) > precision_double * c_sum) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_r64_7d" << std::endl; + std::cout << "c_sum = " << c_sum << std::endl; + std::cout << "f_sum = " << *f_sum << std::endl; + std::cout << "c_sum - *f_sum = " << c_sum - *f_sum << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = 0; + for (size_t ii = 0; ii < array_r64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_r64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_r64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_r64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_r64_7d.extent(6); oo++) { + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo; + c_sum = c_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + return c_sum; + + } + + float _Complex c_test_ndarray_c32_7d( flcl_ndarray_t *nd_array_c32_7d, float _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c32_7d = view_from_ndarray*******>(*nd_array_c32_7d); + for (size_t ii = 0; ii < array_c32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_c32_7d.extent(6); oo++) { + c_sum = c_sum + array_c32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( (std::abs(c_sum.real() - crealf(*f_sum)) > precision_single * c_sum.real()) || (std::abs(c_sum.imag() - cimagf(*f_sum)) < precision_single * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c32_7d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "crealf(*f_sum) = " << crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimagf(*f_sum) = " << cimagf(*f_sum) << std::endl; + std::cout << "c_sum.real() - crealf(*f_sum) = " << c_sum.real() - crealf(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimagf(*f_sum) = " << c_sum.imag() - cimagf(*f_sum) << std::endl; + std::cout << "(c_sum.real() - crealf(*f_sum)) / c_sum.real() = " << (c_sum.real() - crealf(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimagf(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c32_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c32_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c32_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c32_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c32_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c32_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_c32_7d.extent(6); oo++) { + array_c32_7d(ii,jj,kk,ll,mm,nn,oo) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm+nn+oo),-1.0*(ii+jj+kk+ll+mm+nn+oo)); + c_sum = c_sum + array_c32_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + float _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + double _Complex c_test_ndarray_c64_7d( flcl_ndarray_t *nd_array_c64_7d, double _Complex *f_sum ) { + using flcl::view_from_ndarray; + + Kokkos::complex c_sum(0.0,0.0); + + auto array_c64_7d = view_from_ndarray*******>(*nd_array_c64_7d); + for (size_t ii = 0; ii < array_c64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_c64_7d.extent(6); oo++) { + c_sum = c_sum + array_c64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + if ( (std::abs(c_sum.real() - creal(*f_sum)) > precision_double * c_sum.real()) || (std::abs(c_sum.imag() - cimag(*f_sum)) < precision_double * c_sum.imag()) ) { + std::cout << std::setprecision(15) << std::fixed; + std::cout << "FAILED C ndarray_c64_7d" << std::endl; + std::cout << "c_sum.real() = " << c_sum.real() << std::endl; + std::cout << "creal(*f_sum) = " << creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() = " << c_sum.imag() << std::endl; + std::cout << "cimag(*f_sum) = " << cimag(*f_sum) << std::endl; + std::cout << "c_sum.real() - creal(*f_sum) = " << c_sum.real() - creal(*f_sum) << std::endl; + std::cout << "c_sum.imag() - cimag(*f_sum) = " << c_sum.imag() - cimag(*f_sum) << std::endl; + std::cout << "(c_sum.real() - creal(*f_sum)) / c_sum.real() = " << (c_sum.real() - creal(*f_sum)) / c_sum.real() << std::endl; + std::cout << "(c_sum.imag() - cimag(*f_sum)) / c_sum.imag() = " << (c_sum.imag() - cimag(*f_sum)) / c_sum.imag() << std::endl; + exit(EXIT_FAILURE); + } + + c_sum = Kokkos::complex(0.0,0.0); + for (size_t ii = 0; ii < array_c64_7d.extent(0); ii++) { + for (size_t jj = 0; jj < array_c64_7d.extent(1); jj++) { + for (size_t kk = 0; kk < array_c64_7d.extent(2); kk++) { + for (size_t ll = 0; ll < array_c64_7d.extent(3); ll++) { + for (size_t mm = 0; mm < array_c64_7d.extent(4); mm++) { + for (size_t nn = 0; nn < array_c64_7d.extent(5); nn++) { + for (size_t oo = 0; oo < array_c64_7d.extent(6); oo++) { + array_c64_7d(ii,jj,kk,ll,mm,nn,oo) = Kokkos::complex(1.0*(ii+jj+kk+ll+mm+nn+oo),-1.0*(ii+jj+kk+ll+mm+nn+oo)); + c_sum = c_sum + array_c64_7d(ii,jj,kk,ll,mm,nn,oo); + } + } + } + } + } + } + } + + double _Complex c_sum_to_return; + *reinterpret_cast*>(&c_sum_to_return) = c_sum; + return c_sum_to_return; + } + + flcl_test_error_t c_test_kokkos_allocate_view_l_1d( flcl::view_l_1d_t **v_array_l_1d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_l_1d = **v_array_l_1d; + for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { + if ( array_l_1d(ii) ) (*c_sum)++; + } + if (*c_sum != *f_sum) { + std::cout << "FAILED C kokkos_allocate_view_l_1d" << std::endl; + return FLCL_TEST_FAIL; + } + for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { + array_l_1d(ii) = logical_post; + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i32_1d( flcl::view_i32_1d_t **v_array_i32_1d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i32_1d = **v_array_i32_1d; + for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { + *c_sum += array_i32_1d(ii); + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED C kokkos_allocate_view_i32_1d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { + array_i32_1d(ii) = ii; + *c_sum += array_i32_1d(ii); + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i64_1d( flcl::view_i64_1d_t **v_array_i64_1d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i64_1d = **v_array_i64_1d; + for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { + *c_sum += array_i64_1d(ii); + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED ndarray_i64_1d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { + array_i64_1d(ii) = ii; + *c_sum += array_i64_1d(ii); + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r32_1d( flcl::view_r32_1d_t **v_array_r32_1d, float *f_sum, float *c_sum ) { + *c_sum = 0; + auto array_r32_1d = **v_array_r32_1d; + for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { + *c_sum += array_r32_1d(ii); + } + if ( std::fabs(*c_sum - *f_sum) > (precision_single * *c_sum) ) { + std::cout << "FAILED C ndarray_r32_1d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { + array_r32_1d(ii) = ii; + *c_sum += array_r32_1d(ii); + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r64_1d( flcl::view_r64_1d_t **v_array_r64_1d, double *f_sum, double *c_sum ) { + *c_sum = 0; + auto array_r64_1d = **v_array_r64_1d; + for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { + *c_sum += array_r64_1d(ii); + } + if ( std::fabs(*c_sum - *f_sum) > (precision_double * *c_sum) ) { + std::cout << "FAILED C ndarray_r64_1d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { + array_r64_1d(ii) = ii; + *c_sum += array_r64_1d(ii); + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_l_2d( flcl::view_l_2d_t **v_array_l_2d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_l_2d = **v_array_l_2d; + for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { + if ( array_l_2d(ii,jj) ) (*c_sum)++; + } + } + if (*c_sum != *f_sum) { + std::cout << "FAILED C kokkos_allocate_view_l_2d" << std::endl; + return FLCL_TEST_FAIL; + } + for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { + array_l_2d(ii,jj) = logical_post; + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i32_2d( flcl::view_i32_2d_t **v_array_i32_2d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i32_2d = **v_array_i32_2d; + for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { + *c_sum += array_i32_2d(ii,jj); + } + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED C kokkos_allocate_view_i32_2d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { + array_i32_2d(ii,jj) = ii+jj; + *c_sum += array_i32_2d(ii,jj); + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i64_2d( flcl::view_i64_2d_t **v_array_i64_2d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i64_2d = **v_array_i64_2d; + for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { + *c_sum += array_i64_2d(ii,jj); + } + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED C kokkos_allocate_view_i64_2d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { + array_i64_2d(ii,jj) = ii+jj; + *c_sum += array_i64_2d(ii,jj); + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r32_2d( flcl::view_r32_2d_t **v_array_r32_2d, float *f_sum, float *c_sum ) { + *c_sum = 0; + auto array_r32_2d = **v_array_r32_2d; + for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { + *c_sum += array_r32_2d(ii,jj); + } + } + if ( std::fabs(*c_sum - *f_sum) > (precision_single * *c_sum) ) { + std::cout << "FAILED C kokkos_allocate_view_r32_2d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { + array_r32_2d(ii,jj) = ii+jj; + *c_sum += array_r32_2d(ii,jj); + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r64_2d( flcl::view_r64_2d_t **v_array_r64_2d, double *f_sum, double *c_sum ) { + *c_sum = 0; + auto array_r64_2d = **v_array_r64_2d; + for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { + *c_sum += array_r64_2d(ii,jj); + } + } + if ( std::fabs(*c_sum - *f_sum) > (precision_double * *c_sum) ) { + std::cout << "FAILED C kokkos_allocate_view_r64_2d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { + array_r64_2d(ii,jj) = ii+jj; + *c_sum += array_r64_2d(ii,jj); + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_l_3d( flcl::view_l_3d_t **v_array_l_3d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_l_3d = **v_array_l_3d; + for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { + if ( array_l_3d(ii,jj,kk) ) (*c_sum)++; + } + } + } + if (*c_sum != *f_sum) { + std::cout << "FAILED C kokkos_allocate_view_l_3d" << std::endl; + return FLCL_TEST_FAIL; + } + for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { + array_l_3d(ii,jj,kk) = logical_post; + } + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i32_3d( flcl::view_i32_3d_t **v_array_i32_3d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i32_3d = **v_array_i32_3d; + for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { + *c_sum += array_i32_3d(ii,jj,kk); + } + } + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED C kokkos_allocate_view_i32_3d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { + array_i32_3d(ii,jj,kk) = ii+jj+kk; + *c_sum += array_i32_3d(ii,jj,kk); + } + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_i64_3d( flcl::view_i64_3d_t **v_array_i64_3d, size_t *f_sum, size_t *c_sum ) { + *c_sum = 0; + auto array_i64_3d = **v_array_i64_3d; + for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { + *c_sum += array_i64_3d(ii,jj,kk); + } + } + } + if ( *c_sum != *f_sum ) { + std::cout << "FAILED C kokkos_allocate_view_i64_3d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { + array_i64_3d(ii,jj,kk) = ii+jj+kk; + *c_sum += array_i64_3d(ii,jj,kk); + } + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r32_3d( flcl::view_r32_3d_t **v_array_r32_3d, float *f_sum, float *c_sum ) { + *c_sum = 0; + auto array_r32_3d = **v_array_r32_3d; + for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { + *c_sum += array_r32_3d(ii,jj,kk); + } + } + } + if ( std::fabs(*c_sum - *f_sum) > (precision_single * *c_sum) ) { + std::cout << "FAILED C kokkos_allocate_view_r32_3d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { + array_r32_3d(ii,jj,kk) = ii+jj+kk; + *c_sum += array_r32_3d(ii,jj,kk); + } + } + } + return FLCL_TEST_PASS; + } + + flcl_test_error_t c_test_kokkos_allocate_view_r64_3d( flcl::view_r64_3d_t **v_array_r64_3d, double *f_sum, double *c_sum ) { + *c_sum = 0; + auto array_r64_3d = **v_array_r64_3d; + for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { + *c_sum += array_r64_3d(ii,jj,kk); + } + } + } + if ( std::fabs(*c_sum - *f_sum) > (precision_double * *c_sum) ) { + std::cout << "FAILED C kokkos_allocate_view_r64_3d" << std::endl; + return FLCL_TEST_FAIL; + } + *c_sum = 0; + for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { + for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { + for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { + array_r64_3d(ii,jj,kk) = ii+jj+kk; + *c_sum += array_r64_3d(ii,jj,kk); + } + } + } + return FLCL_TEST_PASS; + + } + +} diff --git a/test/test-flcl-cxx.h b/test/flcl-test-cxx.h similarity index 77% rename from test/test-flcl-cxx.h rename to test/flcl-test-cxx.h index 1380be1..26b0f6f 100644 --- a/test/test-flcl-cxx.h +++ b/test/flcl-test-cxx.h @@ -45,13 +45,38 @@ extern "C" { #endif -size_t e0_length = 10; -size_t e1_length = 9; -size_t e2_length = 8; -size_t e3_length = 7; -size_t e4_length = 6; -size_t e5_length = 5; -size_t e6_length = 4; +typedef enum _flcl_test_error_t { + FLCL_TEST_PASS = 0, + FLCL_TEST_FAIL = 1, + +} flcl_test_error_t; + + +size_t e0_length = 8; +size_t e1_length = 7; +size_t e2_length = 6; +size_t e3_length = 5; +size_t e4_length = 4; +size_t e5_length = 3; +size_t e6_length = 2; + +float weak_precision_single = 1.0e-6; +double weak_precision_double = 1.0e-13; +float strong_precision_single = 1.0e-7; +double strong_precision_double = 1.0e-14; + +#ifdef __INTEL_COMPILER +#ifdef NDEBUG +float precision_single = weak_precision_single; +double precision_double = weak_precision_double; +#else +float precision_single = strong_precision_single; +double precision_double = strong_precision_double; +#endif +#else +float precision_single = strong_precision_single; +double precision_double = strong_precision_double; +#endif #ifdef __cplusplus bool logical_pre = true; diff --git a/test/flcl-test-f.f90 b/test/flcl-test-f.f90 new file mode 100644 index 0000000..cb75068 --- /dev/null +++ b/test/flcl-test-f.f90 @@ -0,0 +1,3778 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +module flcl_test_f_mod + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + + implicit none + + integer(c_size_t), parameter :: e0_length = 8 + integer(c_size_t), parameter :: e1_length = 7 + integer(c_size_t), parameter :: e2_length = 6 + integer(c_size_t), parameter :: e3_length = 5 + integer(c_size_t), parameter :: e4_length = 4 + integer(c_size_t), parameter :: e5_length = 3 + integer(c_size_t), parameter :: e6_length = 2 + logical(c_bool), parameter :: logical_pre = .true. + logical(c_bool), parameter :: logical_post = .false. + + enum, bind(c) + enumerator :: flcl_test_pass = 0 + enumerator :: flcl_test_fail = 1 + end enum + + real(c_float) :: precision_single = 1.0e-7 + real(c_double) :: precision_double = 1.0e-14 + + public + + interface + integer(c_size_t) & + & function f_test_ndarray_l_1d( nd_array_l_1d, f_sum ) & + & bind(c, name='c_test_ndarray_l_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_1d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_1d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_1d( nd_array_i32_1d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_1d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_1d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_1d( nd_array_i64_1d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_1d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_1d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_1d( nd_array_r32_1d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_1d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_1d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_1d( nd_array_r64_1d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_1d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_1d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_1d( nd_array_c32_1d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_1d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_1d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_1d( nd_array_c64_1d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_1d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_1d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_2d( nd_array_l_2d, f_sum ) & + & bind(c, name='c_test_ndarray_l_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_2d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_2d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_2d( nd_array_i32_2d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_2d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_2d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_2d( nd_array_i64_2d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_2d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_2d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_2d( nd_array_r32_2d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_2d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_2d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_2d( nd_array_r64_2d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_2d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_2d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_2d( nd_array_c32_2d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_2d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_2d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_2d( nd_array_c64_2d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_2d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_2d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_3d( nd_array_l_3d, f_sum ) & + & bind(c, name='c_test_ndarray_l_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_3d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_3d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_3d( nd_array_i32_3d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_3d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_3d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_3d( nd_array_i64_3d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_3d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_3d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_3d( nd_array_r32_3d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_3d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_3d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_3d( nd_array_r64_3d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_3d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_3d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_3d( nd_array_c32_3d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_3d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_3d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_3d( nd_array_c64_3d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_3d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_3d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_4d( nd_array_l_4d, f_sum ) & + & bind(c, name='c_test_ndarray_l_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_4d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_4d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_4d( nd_array_i32_4d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_4d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_4d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_4d( nd_array_i64_4d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_4d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_4d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_4d( nd_array_r32_4d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_4d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_4d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_4d( nd_array_r64_4d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_4d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_4d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_4d( nd_array_c32_4d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_4d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_4d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_4d( nd_array_c64_4d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_4d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_4d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_4d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_5d( nd_array_l_5d, f_sum ) & + & bind(c, name='c_test_ndarray_l_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_5d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_5d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_5d( nd_array_i32_5d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_5d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_5d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_5d( nd_array_i64_5d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_5d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_5d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_5d( nd_array_r32_5d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_5d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_5d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_5d( nd_array_r64_5d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_5d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_5d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_5d( nd_array_c32_5d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_5d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_5d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_5d( nd_array_c64_5d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_5d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_5d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_5d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_6d( nd_array_l_6d, f_sum ) & + & bind(c, name='c_test_ndarray_l_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_6d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_6d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_6d( nd_array_i32_6d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_6d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_6d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_6d( nd_array_i64_6d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_6d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_6d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_6d( nd_array_r32_6d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_6d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_6d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_6d( nd_array_r64_6d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_6d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_6d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_6d( nd_array_c32_6d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_6d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_6d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_6d( nd_array_c64_6d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_6d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_6d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_6d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_l_7d( nd_array_l_7d, f_sum ) & + & bind(c, name='c_test_ndarray_l_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_l_7d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_l_7d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i32_7d( nd_array_i32_7d, f_sum ) & + & bind(c, name='c_test_ndarray_i32_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i32_7d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i32_7d + end interface + + interface + integer(c_size_t) & + & function f_test_ndarray_i64_7d( nd_array_i64_7d, f_sum ) & + & bind(c, name='c_test_ndarray_i64_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_i64_7d + integer(c_size_t), intent(inout) :: f_sum + end function f_test_ndarray_i64_7d + end interface + + interface + real(c_float) & + & function f_test_ndarray_r32_7d( nd_array_r32_7d, f_sum ) & + & bind(c, name='c_test_ndarray_r32_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r32_7d + real(c_float), intent(inout) :: f_sum + end function f_test_ndarray_r32_7d + end interface + + interface + real(c_double) & + & function f_test_ndarray_r64_7d( nd_array_r64_7d, f_sum ) & + & bind(c, name='c_test_ndarray_r64_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_r64_7d + real(c_double), intent(inout) :: f_sum + end function f_test_ndarray_r64_7d + end interface + + interface + complex(c_float_complex) & + & function f_test_ndarray_c32_7d( nd_array_c32_7d, f_sum ) & + & bind(c, name='c_test_ndarray_c32_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c32_7d + complex(c_float_complex), intent(inout) :: f_sum + end function f_test_ndarray_c32_7d + end interface + + interface + complex(c_double_complex) & + & function f_test_ndarray_c64_7d( nd_array_c64_7d, f_sum ) & + & bind(c, name='c_test_ndarray_c64_7d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(nd_array_t), intent(in) :: nd_array_c64_7d + complex(c_double_complex), intent(inout) :: f_sum + end function f_test_ndarray_c64_7d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_l_1d( v_array_l_1d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_l_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_l_1d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_l_1d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i32_1d( v_array_i32_1d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i32_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i32_1d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i32_1d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i64_1d( v_array_i64_1d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i64_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i64_1d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i64_1d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r32_1d( v_array_r32_1d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r32_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r32_1d + real(c_float), intent(inout) :: f_sum + real(c_float), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r32_1d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r64_1d( v_array_r64_1d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r64_1d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r64_1d + real(c_double), intent(inout) :: f_sum + real(c_double), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r64_1d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_l_2d( v_array_l_2d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_l_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_l_2d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_l_2d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i32_2d( v_array_i32_2d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i32_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i32_2d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i32_2d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i64_2d( v_array_i64_2d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i64_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i64_2d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i64_2d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r32_2d( v_array_r32_2d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r32_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r32_2d + real(c_float), intent(inout) :: f_sum + real(c_float), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r32_2d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r64_2d( v_array_r64_2d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r64_2d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r64_2d + real(c_double), intent(inout) :: f_sum + real(c_double), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r64_2d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_l_3d( v_array_l_3d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_l_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_l_3d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_l_3d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i32_3d( v_array_i32_3d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i32_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i32_3d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i32_3d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_i64_3d( v_array_i64_3d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_i64_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_i64_3d + integer(c_size_t), intent(inout) :: f_sum + integer(c_size_t), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_i64_3d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r32_3d( v_array_r32_3d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r32_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r32_3d + real(c_float), intent(inout) :: f_sum + real(c_float), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r32_3d + end interface + + interface + integer & + & function f_test_kokkos_allocate_view_r64_3d( v_array_r64_3d, f_sum, c_sum ) & + & bind(c, name='c_test_kokkos_allocate_view_r64_3d') + use, intrinsic :: iso_c_binding + use :: flcl_mod + type(c_ptr), intent(in) :: v_array_r64_3d + real(c_double), intent(inout) :: f_sum + real(c_double), intent(inout) :: c_sum + end function f_test_kokkos_allocate_view_r64_3d + end interface + + contains + + integer(c_size_t) & + & function test_ndarray_l_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:), allocatable :: array_l_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = e0_length + + allocate( array_l_1d(e0_length) ) + do ii = 1, e0_length + array_l_1d(ii) = logical_pre + if (array_l_1d(ii) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + c_sum = f_test_ndarray_l_1d( to_nd_array(array_l_1d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + if (array_l_1d(ii) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_1d + + integer(c_size_t) & + & function test_ndarray_i32_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:), allocatable :: array_i32_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = e0_length + + allocate( array_i32_1d(e0_length) ) + do ii = 1, e0_length + array_i32_1d(ii) = ii + f_sum = f_sum + array_i32_1d(ii) + end do + c_sum = f_test_ndarray_i32_1d( to_nd_array(array_i32_1d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_i32_1d(ii) + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_1d + + integer(c_size_t) & + & function test_ndarray_i64_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:), allocatable :: array_i64_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = e0_length + + allocate( array_i64_1d(e0_length) ) + do ii = 1, e0_length + array_i64_1d(ii) = ii + f_sum = f_sum + array_i64_1d(ii) + end do + c_sum = f_test_ndarray_i64_1d( to_nd_array(array_i64_1d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_i64_1d(ii) + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_1d + + integer(c_size_t) & + & function test_ndarray_r32_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:), allocatable :: array_r32_1d + integer :: ii + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = e0_length + + allocate( array_r32_1d(e0_length) ) + do ii = 1, e0_length + array_r32_1d(ii) = ii + f_sum = f_sum + array_r32_1d(ii) + end do + c_sum = f_test_ndarray_r32_1d( to_nd_array(array_r32_1d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_r32_1d(ii) + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum) ) then + write(*,*)'PASSED ndarray_r32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r32_1d + + integer(c_size_t) & + & function test_ndarray_r64_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:), allocatable :: array_r64_1d + integer :: ii + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = e0_length + + allocate( array_r64_1d(e0_length) ) + do ii = 1, e0_length + array_r64_1d(ii) = ii + f_sum = f_sum + array_r64_1d(ii) + end do + c_sum = f_test_ndarray_r64_1d( to_nd_array(array_r64_1d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_r64_1d(ii) + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_1d + + integer(c_size_t) & + & function test_ndarray_c32_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:), allocatable :: array_c32_1d + integer :: ii + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_1d(e0_length) ) + do ii = 1, e0_length + array_c32_1d(ii) = cmplx(ii,-ii) + f_sum = f_sum + array_c32_1d(ii) + end do + c_sum = f_test_ndarray_c32_1d( to_nd_array(array_c32_1d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + f_sum = f_sum + array_c32_1d(ii) + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_1d + + integer(c_size_t) & + & function test_ndarray_c64_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:), allocatable :: array_c64_1d + integer :: ii + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_1d(e0_length) ) + do ii = 1, e0_length + array_c64_1d(ii) = cmplx(ii,-ii) + f_sum = f_sum + array_c64_1d(ii) + end do + c_sum = f_test_ndarray_c64_1d( to_nd_array(array_c64_1d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + f_sum = f_sum + array_c64_1d(ii) + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_1d + + integer(c_size_t) & + & function test_ndarray_l_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:), allocatable :: array_l_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj =1, e1_length + array_l_2d(ii,jj) = logical_pre + if (array_l_2d(ii,jj) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + c_sum = f_test_ndarray_l_2d( to_nd_array(array_l_2d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + if (array_l_2d(ii,jj) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_2d + + integer(c_size_t) & + & function test_ndarray_i32_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:), allocatable :: array_i32_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_i32_2d(ii,jj) = ii+jj + f_sum = f_sum + array_i32_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_i32_2d( to_nd_array(array_i32_2d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_i32_2d(ii,jj) + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_2d + + integer(c_size_t) & + & function test_ndarray_i64_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:), allocatable :: array_i64_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_i64_2d(ii,jj) = ii+jj + f_sum = f_sum + array_i64_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_i64_2d( to_nd_array(array_i64_2d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_i64_2d(ii,jj) + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_2d + + integer(c_size_t) & + & function test_ndarray_r32_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:), allocatable :: array_r32_2d + integer :: ii, jj + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_r32_2d(ii,jj) = ii+jj + f_sum = f_sum + array_r32_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_r32_2d( to_nd_array(array_r32_2d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_r32_2d(ii,jj) + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r32_2d + + integer(c_size_t) & + & function test_ndarray_r64_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:), allocatable :: array_r64_2d + integer :: ii, jj + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_r64_2d(ii,jj) = ii+jj + f_sum = f_sum + array_r64_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_r64_2d( to_nd_array(array_r64_2d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_r64_2d(ii,jj) + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_2d + + integer(c_size_t) & + & function test_ndarray_c32_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:), allocatable :: array_c32_2d + integer :: ii,jj + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_c32_2d(ii,jj) = cmplx(ii+jj,-(ii+jj)) + f_sum = f_sum + array_c32_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_c32_2d( to_nd_array(array_c32_2d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_c32_2d(ii,jj) + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_2d + + integer(c_size_t) & + & function test_ndarray_c64_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:), allocatable :: array_c64_2d + integer :: ii,jj + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_2d(e0_length, e1_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + array_c64_2d(ii,jj) = cmplx(ii+jj,-(ii+jj)) + f_sum = f_sum + array_c64_2d(ii,jj) + end do + end do + c_sum = f_test_ndarray_c64_2d( to_nd_array(array_c64_2d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_c64_2d(ii,jj) + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_2d + + integer(c_size_t) & + & function test_ndarray_l_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:,:), allocatable :: array_l_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_l_3d(ii,jj,kk) = logical_pre + if (array_l_3d(ii,jj,kk) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + c_sum = f_test_ndarray_l_3d( to_nd_array(array_l_3d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + if (array_l_3d(ii,jj,kk) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_3d + + integer(c_size_t) & + & function test_ndarray_i32_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:,:), allocatable :: array_i32_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_i32_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_i32_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_i32_3d( to_nd_array(array_i32_3d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_i32_3d(ii,jj,kk) + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_3d + + integer(c_size_t) & + & function test_ndarray_i64_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:,:), allocatable :: array_i64_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_i64_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_i64_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_i64_3d( to_nd_array(array_i64_3d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_i64_3d(ii,jj,kk) + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_3d + + integer(c_size_t) & + & function test_ndarray_r32_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:,:), allocatable :: array_r32_3d + integer :: ii, jj, kk + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_r32_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_r32_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_r32_3d( to_nd_array(array_r32_3d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_r32_3d(ii,jj,kk) + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r32_3d + + integer(c_size_t) & + & function test_ndarray_r64_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:,:), allocatable :: array_r64_3d + integer :: ii, jj, kk + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_r64_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_r64_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_r64_3d( to_nd_array(array_r64_3d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_r64_3d(ii,jj,kk) + end do + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_3d + + integer(c_size_t) & + & function test_ndarray_c32_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:,:), allocatable :: array_c32_3d + integer :: ii,jj,kk + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_c32_3d(ii,jj,kk) = cmplx(ii+jj+kk,-(ii+jj+kk)) + f_sum = f_sum + array_c32_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_c32_3d( to_nd_array(array_c32_3d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_c32_3d(ii,jj,kk) + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_3d + + integer(c_size_t) & + & function test_ndarray_c64_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:,:), allocatable :: array_c64_3d + integer :: ii,jj,kk + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_3d(e0_length, e1_length, e2_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_c64_3d(ii,jj,kk) = cmplx(ii+jj+kk,-(ii+jj+kk)) + f_sum = f_sum + array_c64_3d(ii,jj,kk) + end do + end do + end do + c_sum = f_test_ndarray_c64_3d( to_nd_array(array_c64_3d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_c64_3d(ii,jj,kk) + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_3d + + integer(c_size_t) & + & function test_ndarray_l_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:,:,:), allocatable :: array_l_4d + integer :: ii, jj, kk, ll + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_l_4d(ii,jj,kk,ll) = logical_pre + if (array_l_4d(ii,jj,kk,ll) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + c_sum = f_test_ndarray_l_4d( to_nd_array(array_l_4d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + if (array_l_4d(ii,jj,kk,ll) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_4d + + integer(c_size_t) & + & function test_ndarray_i32_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:,:,:), allocatable :: array_i32_4d + integer :: ii, jj, kk, ll + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_i32_4d(ii,jj,kk,ll) = ii+jj+kk+ll + f_sum = f_sum + array_i32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_i32_4d( to_nd_array(array_i32_4d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_i32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_4d + + integer(c_size_t) & + & function test_ndarray_i64_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:,:,:), allocatable :: array_i64_4d + integer :: ii, jj, kk, ll + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_i64_4d(ii,jj,kk,ll) = ii+jj+kk+ll + f_sum = f_sum + array_i64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_i64_4d( to_nd_array(array_i64_4d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_i64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_4d + + integer(c_size_t) & + & function test_ndarray_r32_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:,:,:), allocatable :: array_r32_4d + integer :: ii, jj, kk, ll + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_r32_4d(ii,jj,kk,ll) = ii+jj+kk+ll + f_sum = f_sum + array_r32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_r32_4d( to_nd_array(array_r32_4d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_r32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r32_4d + + integer(c_size_t) & + & function test_ndarray_r64_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:,:,:), allocatable :: array_r64_4d + integer :: ii, jj, kk, ll + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_r64_4d(ii,jj,kk,ll) = ii+jj+kk+ll + f_sum = f_sum + array_r64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_r64_4d( to_nd_array(array_r64_4d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_r64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_4d + + integer(c_size_t) & + & function test_ndarray_c32_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:,:,:), allocatable :: array_c32_4d + integer :: ii,jj,kk,ll + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_c32_4d(ii,jj,kk,ll) = cmplx(ii+jj+kk+ll,-(ii+jj+kk+ll)) + f_sum = f_sum + array_c32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_c32_4d( to_nd_array(array_c32_4d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_c32_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_4d + + integer(c_size_t) & + & function test_ndarray_c64_4d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:,:,:), allocatable :: array_c64_4d + integer :: ii,jj,kk,ll + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_4d(e0_length, e1_length, e2_length, e3_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + array_c64_4d(ii,jj,kk,ll) = cmplx(ii+jj+kk+ll,-(ii+jj+kk+ll)) + f_sum = f_sum + array_c64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + c_sum = f_test_ndarray_c64_4d( to_nd_array(array_c64_4d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + f_sum = f_sum + array_c64_4d(ii,jj,kk,ll) + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_4d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_4d + + integer(c_size_t) & + & function test_ndarray_l_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:,:,:,:), allocatable :: array_l_5d + integer :: ii, jj, kk, ll, mm + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_l_5d(ii,jj,kk,ll,mm) = logical_pre + if (array_l_5d(ii,jj,kk,ll,mm) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_l_5d( to_nd_array(array_l_5d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + if (array_l_5d(ii,jj,kk,ll,mm) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_5d + + integer(c_size_t) & + & function test_ndarray_i32_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:,:,:,:), allocatable :: array_i32_5d + integer :: ii, jj, kk, ll, mm + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_i32_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm + f_sum = f_sum + array_i32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i32_5d( to_nd_array(array_i32_5d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_i32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_5d + + integer(c_size_t) & + & function test_ndarray_i64_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:,:,:,:), allocatable :: array_i64_5d + integer :: ii, jj, kk, ll, mm + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_i64_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm + f_sum = f_sum + array_i64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i64_5d( to_nd_array(array_i64_5d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_i64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_5d + + integer(c_size_t) & + & function test_ndarray_r32_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:,:,:,:), allocatable :: array_r32_5d + integer :: ii, jj, kk, ll, mm + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_r32_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm + f_sum = f_sum + array_r32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r32_5d( to_nd_array(array_r32_5d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_r32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + write(*,*)'abs(f_sum - c_sum ) < (precision_single * c_sum) = ',(abs(f_sum - c_sum ) < (precision_single * c_sum)) + ierr = flcl_test_fail + end if + end function test_ndarray_r32_5d + + integer(c_size_t) & + & function test_ndarray_r64_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:,:,:,:), allocatable :: array_r64_5d + integer :: ii, jj, kk, ll, mm + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_r64_5d(ii,jj,kk,ll,mm) = ii+jj+kk+ll+mm + f_sum = f_sum + array_r64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r64_5d( to_nd_array(array_r64_5d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_r64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_5d + + integer(c_size_t) & + & function test_ndarray_c32_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:,:,:,:), allocatable :: array_c32_5d + integer :: ii,jj,kk,ll,mm + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_c32_5d(ii,jj,kk,ll,mm) = cmplx(ii+jj+kk+ll+mm,-(ii+jj+kk+ll+mm)) + f_sum = f_sum + array_c32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c32_5d( to_nd_array(array_c32_5d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_c32_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_5d + + integer(c_size_t) & + & function test_ndarray_c64_5d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:,:,:,:), allocatable :: array_c64_5d + integer :: ii,jj,kk,ll,mm + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + array_c64_5d(ii,jj,kk,ll,mm) = cmplx(ii+jj+kk+ll+mm,-(ii+jj+kk+ll+mm)) + f_sum = f_sum + array_c64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c64_5d( to_nd_array(array_c64_5d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + f_sum = f_sum + array_c64_5d(ii,jj,kk,ll,mm) + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_5d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_5d + + integer(c_size_t) & + & function test_ndarray_l_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:,:,:,:,:), allocatable :: array_l_6d + integer :: ii, jj, kk, ll, mm, nn + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_l_6d(ii,jj,kk,ll,mm,nn) = logical_pre + if (array_l_6d(ii,jj,kk,ll,mm,nn) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_l_6d( to_nd_array(array_l_6d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + if (array_l_6d(ii,jj,kk,ll,mm,nn) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_6d + + integer(c_size_t) & + & function test_ndarray_i32_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:,:,:,:,:), allocatable :: array_i32_6d + integer :: ii, jj, kk, ll, mm, nn + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_i32_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn + f_sum = f_sum + array_i32_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i32_6d( to_nd_array(array_i32_6d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_i32_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_6d + + integer(c_size_t) & + & function test_ndarray_i64_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:,:,:,:,:), allocatable :: array_i64_6d + integer :: ii, jj, kk, ll, mm, nn + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_i64_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn + f_sum = f_sum + array_i64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i64_6d( to_nd_array(array_i64_6d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_i64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_6d + + integer(c_size_t) & + & function test_ndarray_r32_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:,:,:,:,:), allocatable :: array_r32_6d + integer :: ii, jj, kk, ll, mm, nn + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_r32_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn + f_sum = f_sum + array_r32_6d(ii,jj,kk,ll,mm,nn) + ! write(*,*)'f_sum1 ',f_sum + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r32_6d( to_nd_array(array_r32_6d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_r32_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + write(*,*)'abs(f_sum - c_sum ) < (precision_single * c_sum) = ',(abs(f_sum - c_sum ) < (precision_single * c_sum)) + ierr = flcl_test_fail + end if + end function test_ndarray_r32_6d + + integer(c_size_t) & + & function test_ndarray_r64_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:,:,:,:,:), allocatable :: array_r64_6d + integer :: ii, jj, kk, ll, mm, nn + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_r64_6d(ii,jj,kk,ll,mm,nn) = ii+jj+kk+ll+mm+nn + f_sum = f_sum + array_r64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r64_6d( to_nd_array(array_r64_6d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_r64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_6d + + integer(c_size_t) & + & function test_ndarray_c32_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:,:,:,:,:), allocatable :: array_c32_6d + integer :: ii,jj,kk,ll,mm,nn + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_c32_6d(ii,jj,kk,ll,mm,nn) = cmplx(ii+jj+kk+ll+mm+nn,-(ii+jj+kk+ll+mm+nn)) + f_sum = f_sum + array_c32_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c32_6d( to_nd_array(array_c32_6d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_c32_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_6d + + integer(c_size_t) & + & function test_ndarray_c64_6d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:,:,:,:,:), allocatable :: array_c64_6d + integer :: ii,jj,kk,ll,mm,nn + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + array_c64_6d(ii,jj,kk,ll,mm,nn) = cmplx(ii+jj+kk+ll+mm+nn,-(ii+jj+kk+ll+mm+nn)) + f_sum = f_sum + array_c64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c64_6d( to_nd_array(array_c64_6d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + f_sum = f_sum + array_c64_6d(ii,jj,kk,ll,mm,nn) + end do + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_6d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_6d + + integer(c_size_t) & + & function test_ndarray_l_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), dimension(:,:,:,:,:,:,:), allocatable :: array_l_7d + integer :: ii, jj, kk, ll, mm, nn, oo + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_l_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_l_7d(ii,jj,kk,ll,mm,nn,oo) = logical_pre + if (array_l_7d(ii,jj,kk,ll,mm,nn,oo) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_l_7d( to_nd_array(array_l_7d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + if (array_l_7d(ii,jj,kk,ll,mm,nn,oo) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + end do + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED ndarray_l_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarry_l_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_l_7d + + integer(c_size_t) & + & function test_ndarray_i32_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), dimension(:,:,:,:,:,:,:), allocatable :: array_i32_7d + integer :: ii, jj, kk, ll, mm, nn, oo + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i32_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo + f_sum = f_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i32_7d( to_nd_array(array_i32_7d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i32_7d + + integer(c_size_t) & + & function test_ndarray_i64_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), dimension(:,:,:,:,:,:,:), allocatable :: array_i64_7d + integer :: ii, jj, kk, ll, mm, nn,oo + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + allocate( array_i64_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo + f_sum = f_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_i64_7d( to_nd_array(array_i64_7d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED ndarray_i64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_i64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_i64_7d + + integer(c_size_t) & + & function test_ndarray_r32_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), dimension(:,:,:,:,:,:,:), allocatable :: array_r32_7d + integer :: ii, jj, kk, ll, mm, nn, oo + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + allocate( array_r32_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo + f_sum = f_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r32_7d( to_nd_array(array_r32_7d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum)) then + write(*,*)'PASSED ndarray_r32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r32_7d + + integer(c_size_t) & + & function test_ndarray_r64_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), dimension(:,:,:,:,:,:,:), allocatable :: array_r64_7d + integer :: ii, jj, kk, ll, mm, nn, oo + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + allocate( array_r64_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) = ii+jj+kk+ll+mm+nn+oo + f_sum = f_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_r64_7d( to_nd_array(array_r64_7d), f_sum ) + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if ( abs(f_sum - c_sum ) < precision_double * c_sum ) then + write(*,*)'PASSED ndarray_r64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_r64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_r64_7d + + integer(c_size_t) & + & function test_ndarray_c32_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_float_complex), dimension(:,:,:,:,:,:,:), allocatable :: array_c32_7d + integer :: ii,jj,kk,ll,mm,nn,oo + complex(c_float_complex) :: f_sum = (0,0) + complex(c_float_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c32_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_c32_7d(ii,jj,kk,ll,mm,nn,oo) = cmplx(ii+jj+kk+ll+mm+nn+oo,-(ii+jj+kk+ll+mm+nn+oo)) + f_sum = f_sum + array_c32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c32_7d( to_nd_array(array_c32_7d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_c32_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_single * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_single * imag(f_sum)) then + write(*,*)'PASSED ndarray_c32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c32_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c32_7d + + integer(c_size_t) & + & function test_ndarray_c64_7d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + complex(c_double_complex), dimension(:,:,:,:,:,:,:), allocatable :: array_c64_7d + integer :: ii,jj,kk,ll,mm,nn,oo + complex(c_double_complex) :: f_sum = (0,0) + complex(c_double_complex) :: c_sum = (e0_length, e0_length) + + allocate( array_c64_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + array_c64_7d(ii,jj,kk,ll,mm,nn,oo) = cmplx(ii+jj+kk+ll+mm+nn+oo,-(ii+jj+kk+ll+mm+nn+oo)) + f_sum = f_sum + array_c64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + c_sum = f_test_ndarray_c64_7d( to_nd_array(array_c64_7d), f_sum ) + f_sum = (0,0) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + do ll = 1, e3_length + do mm = 1, e4_length + do nn = 1, e5_length + do oo = 1, e6_length + f_sum = f_sum + array_c64_7d(ii,jj,kk,ll,mm,nn,oo) + end do + end do + end do + end do + end do + end do + end do + if (real(f_sum)-real(c_sum) > precision_double * real(f_sum) .or. & + & imag(f_sum) - imag(c_sum) > precision_double * imag(f_sum)) then + write(*,*)'PASSED ndarray_c64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F ndarray_c64_7d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end function test_ndarray_c64_7d + + integer & + & function test_kokkos_allocate_view_l_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), pointer, dimension(:) :: array_l_1d + type(c_ptr) :: v_array_l_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_l_1d, v_array_l_1d, 'array_l_1d', e0_length ) + do ii = 1, e0_length + array_l_1d(ii) = logical_pre + if (array_l_1d(ii) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + ierr = f_test_kokkos_allocate_view_l_1d( v_array_l_1d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + if (array_l_1d(ii) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + + if (f_sum == c_sum) then + write(*,*)'PASSED kokkos_allocate_view_l_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_l_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_l_1d + + integer & + & function test_kokkos_allocate_view_i32_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), pointer, dimension(:) :: array_i32_1d + type(c_ptr) :: v_array_i32_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i32_1d, v_array_i32_1d, 'array_i32_1d', e0_length ) + do ii = 1, e0_length + array_i32_1d(ii) = ii + f_sum = f_sum + array_i32_1d(ii) + end do + ierr = f_test_kokkos_allocate_view_i32_1d( v_array_i32_1d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_i32_1d(ii) + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i32_1d + + integer & + & function test_kokkos_allocate_view_i64_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), pointer, dimension(:) :: array_i64_1d + type(c_ptr) :: v_array_i64_1d + integer :: ii + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i64_1d, v_array_i64_1d, 'array_i64_1d', e0_length ) + do ii = 1, e0_length + array_i64_1d(ii) = ii + f_sum = f_sum + array_i64_1d(ii) + end do + ierr = f_test_kokkos_allocate_view_i64_1d( v_array_i64_1d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_i64_1d(ii) + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i64_1d + + integer & + & function test_kokkos_allocate_view_r32_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), pointer, dimension(:) :: array_r32_1d + type(c_ptr) :: v_array_r32_1d + integer :: ii + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + call kokkos_allocate_view( array_r32_1d, v_array_r32_1d, 'array_r32_1d', e0_length ) + do ii = 1, e0_length + array_r32_1d(ii) = ii + f_sum = f_sum + array_r32_1d(ii) + end do + ierr = f_test_kokkos_allocate_view_r32_1d( v_array_r32_1d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_r32_1d(ii) + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r32_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r32_1d + + integer & + & function test_kokkos_allocate_view_r64_1d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), pointer, dimension(:) :: array_r64_1d + type(c_ptr) :: v_array_r64_1d + integer :: ii + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + call kokkos_allocate_view( array_r64_1d, v_array_r64_1d, 'array_r64_1d', e0_length ) + do ii = 1, e0_length + array_r64_1d(ii) = ii + f_sum = f_sum + array_r64_1d(ii) + end do + ierr = f_test_kokkos_allocate_view_r64_1d( v_array_r64_1d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + f_sum = f_sum + array_r64_1d(ii) + end do + if ( abs(f_sum - c_sum ) < (precision_double * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r64_1d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r64_1d + + integer & + & function test_kokkos_allocate_view_l_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), pointer, dimension(:,:) :: array_l_2d + type(c_ptr) :: v_array_l_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_l_2d, v_array_l_2d, 'array_l_2d', e0_length, e1_length ) + do ii = 1, e0_length + do jj = 1, e1_length + array_l_2d(ii,jj) = logical_pre + if (array_l_2d(ii,jj) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + ierr = f_test_kokkos_allocate_view_l_2d( v_array_l_2d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + if (array_l_2d(ii,jj) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED kokkos_allocate_view_l_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_l_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_l_2d + + integer & + & function test_kokkos_allocate_view_i32_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), pointer, dimension(:,:) :: array_i32_2d + type(c_ptr) :: v_array_i32_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i32_2d, v_array_i32_2d, 'array_i32_2d', e0_length, e1_length ) + do ii = 1, e0_length + do jj = 1, e1_length + array_i32_2d(ii,jj) = ii+jj + f_sum = f_sum + array_i32_2d(ii,jj) + end do + end do + ierr = f_test_kokkos_allocate_view_i32_2d( v_array_i32_2d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_i32_2d(ii,jj) + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i32_2d + + integer & + & function test_kokkos_allocate_view_i64_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), pointer, dimension(:,:) :: array_i64_2d + type(c_ptr) :: v_array_i64_2d + integer :: ii, jj + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i64_2d, v_array_i64_2d, 'array_i64_2d', e0_length, e1_length ) + do ii = 1, e0_length + do jj = 1, e1_length + array_i64_2d(ii,jj) = ii+jj + f_sum = f_sum + array_i64_2d(ii,jj) + end do + end do + ierr = f_test_kokkos_allocate_view_i64_2d( v_array_i64_2d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_i64_2d(ii,jj) + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i64_2d + + integer & + & function test_kokkos_allocate_view_r32_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), pointer, dimension(:,:) :: array_r32_2d + type(c_ptr) :: v_array_r32_2d + integer :: ii, jj + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + call kokkos_allocate_view( array_r32_2d, v_array_r32_2d, 'array_r32_2d', e0_length, e1_length ) + do ii = 1, e0_length + do jj = 1, e1_length + array_r32_2d(ii,jj) = ii+jj + f_sum = f_sum + array_r32_2d(ii,jj) + end do + end do + ierr = f_test_kokkos_allocate_view_r32_2d( v_array_r32_2d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_r32_2d(ii,jj) + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r32_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r32_2d + + integer & + & function test_kokkos_allocate_view_r64_2d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), pointer, dimension(:,:) :: array_r64_2d + type(c_ptr) :: v_array_r64_2d + integer :: ii, jj + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + call kokkos_allocate_view( array_r64_2d, v_array_r64_2d, 'array_r64_2d', e0_length, e1_length ) + do ii = 1, e0_length + do jj = 1, e1_length + array_r64_2d(ii,jj) = ii+jj + f_sum = f_sum + array_r64_2d(ii,jj) + end do + end do + ierr = f_test_kokkos_allocate_view_r64_2d( v_array_r64_2d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + f_sum = f_sum + array_r64_2d(ii,jj) + end do + end do + if ( abs(f_sum - c_sum ) < (precision_double * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r64_2d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r64_2d + + integer & + & function test_kokkos_allocate_view_l_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + logical(c_bool), pointer, dimension(:,:,:) :: array_l_3d + type(c_ptr) :: v_array_l_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_l_3d, v_array_l_3d, 'array_l_3d', e0_length, e1_length, e2_length ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_l_3d(ii,jj,kk) = logical_pre + if (array_l_3d(ii,jj,kk) .eqv. logical_pre) then + f_sum = f_sum + 1 + end if + end do + end do + end do + ierr = f_test_kokkos_allocate_view_l_3d( v_array_l_3d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + if (array_l_3d(ii,jj,kk) .eqv. logical_post) then + f_sum = f_sum + 1 + end if + end do + end do + end do + if (f_sum == c_sum) then + write(*,*)'PASSED kokkos_allocate_view_l_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_l_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_l_3d + + integer & + & function test_kokkos_allocate_view_i32_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int32_t), pointer, dimension(:,:,:) :: array_i32_3d + type(c_ptr) :: v_array_i32_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i32_3d, v_array_i32_3d, 'array_i32_3d', e0_length, e1_length, e2_length ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_i32_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_i32_3d(ii,jj,kk) + end do + end do + end do + ierr = f_test_kokkos_allocate_view_i32_3d( v_array_i32_3d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_i32_3d(ii,jj,kk) + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i32_3d + + integer & + & function test_kokkos_allocate_view_i64_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + integer(c_int64_t), pointer, dimension(:,:,:) :: array_i64_3d + type(c_ptr) :: v_array_i64_3d + integer :: ii, jj, kk + integer(c_size_t) :: f_sum = 0 + integer(c_size_t) :: c_sum = 0 + + call kokkos_allocate_view( array_i64_3d, v_array_i64_3d, 'array_i64_3d', e0_length, e1_length, e2_length ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_i64_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_i64_3d(ii,jj,kk) + end do + end do + end do + ierr = f_test_kokkos_allocate_view_i64_3d( v_array_i64_3d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_i64_3d(ii,jj,kk) + end do + end do + end do + if ( f_sum .eq. c_sum ) then + write(*,*)'PASSED kokkos_allocate_view_i64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_i64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_i64_3d + + integer & + & function test_kokkos_allocate_view_r32_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_float), pointer, dimension(:,:,:) :: array_r32_3d + type(c_ptr) :: v_array_r32_3d + integer :: ii, jj, kk + real(c_float) :: f_sum = 0 + real(c_float) :: c_sum = 0 + + call kokkos_allocate_view( array_r32_3d, v_array_r32_3d, 'array_r32_3d', e0_length, e1_length, e2_length ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_r32_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_r32_3d(ii,jj,kk) + end do + end do + end do + ierr = f_test_kokkos_allocate_view_r32_3d( v_array_r32_3d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_r32_3d(ii,jj,kk) + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_single * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r32_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r32_3d + + integer & + & function test_kokkos_allocate_view_r64_3d() & + & result(ierr) + use, intrinsic :: iso_c_binding + use :: flcl_mod + implicit none + + real(c_double), pointer, dimension(:,:,:) :: array_r64_3d + type(c_ptr) :: v_array_r64_3d + integer :: ii, jj, kk + real(c_double) :: f_sum = 0 + real(c_double) :: c_sum = 0 + + call kokkos_allocate_view( array_r64_3d, v_array_r64_3d, 'array_r64_3d', e0_length, e1_length, e2_length ) + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + array_r64_3d(ii,jj,kk) = ii+jj+kk + f_sum = f_sum + array_r64_3d(ii,jj,kk) + end do + end do + end do + ierr = f_test_kokkos_allocate_view_r64_3d( v_array_r64_3d, f_sum, c_sum ) + if (ierr == flcl_test_pass) then + f_sum = 0 + do ii = 1, e0_length + do jj = 1, e1_length + do kk = 1, e2_length + f_sum = f_sum + array_r64_3d(ii,jj,kk) + end do + end do + end do + if ( abs(f_sum - c_sum ) < (precision_double * c_sum) ) then + write(*,*)'PASSED kokkos_allocate_view_r64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_pass + else + write(*,*)'FAILED F kokkos_allocate_view_r64_3d' + write(*,*)'f_sum = ',f_sum + write(*,*)'c_sum = ',c_sum + ierr = flcl_test_fail + end if + end if + end function test_kokkos_allocate_view_r64_3d + +end module flcl_test_f_mod diff --git a/test/test-flcl-main.f90 b/test/old-test-flcl-main.f90 similarity index 77% rename from test/test-flcl-main.f90 rename to test/old-test-flcl-main.f90 index 2cf58f1..bdee328 100644 --- a/test/test-flcl-main.f90 +++ b/test/old-test-flcl-main.f90 @@ -41,7 +41,7 @@ program test_flcl_main use :: flcl_mod use :: flcl_util_mod - use :: test_flcl_f_mod + use :: flcl_tests_f_mod implicit none @@ -69,6 +69,12 @@ program test_flcl_main ierr = test_ndarray_r64_1d() write(*,*)'ierr ',ierr + ierr = test_ndarray_c32_1d() + write(*,*)'ierr ',ierr + + ierr = test_ndarray_c64_1d() + write(*,*)'ierr ',ierr + ! test ndarray 2d specializations ierr = test_ndarray_l_2d() write(*,*)'ierr ',ierr @@ -84,6 +90,12 @@ program test_flcl_main ierr = test_ndarray_r64_2d() write(*,*)'ierr ',ierr + + ierr = test_ndarray_c32_2d() + write(*,*)'ierr ',ierr + + ierr = test_ndarray_c64_2d() + write(*,*)'ierr ',ierr ! test ndarray 3d specializations ierr = test_ndarray_l_3d() @@ -165,6 +177,54 @@ program test_flcl_main ierr = test_ndarray_r64_7d() write(*,*)'ierr ',ierr + ! test kokkos_allocate_view 1d specializations + ierr = test_kokkos_allocate_view_l_1d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i32_1d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i64_1d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r32_1d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r64_1d() + write(*,*)'ierr ',ierr + + ! test kokkos_allocate_view 2d specializations + ierr = test_kokkos_allocate_view_l_2d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i32_2d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i64_2d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r32_2d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r64_2d() + write(*,*)'ierr ',ierr + + ! test kokkos_allocate_view 3d specializations + ierr = test_kokkos_allocate_view_l_3d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i32_3d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_i64_3d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r32_3d() + write(*,*)'ierr ',ierr + + ierr = test_kokkos_allocate_view_r64_3d() + write(*,*)'ierr ',ierr + call kokkos_finalize() end if diff --git a/test/test-flcl-cxx.cpp b/test/test-flcl-cxx.cpp deleted file mode 100644 index f551a54..0000000 --- a/test/test-flcl-cxx.cpp +++ /dev/null @@ -1,1155 +0,0 @@ -// Copyright (c) 2019. Triad National Security, LLC. All rights reserved. -// -// This program was produced under U.S. Government contract 89233218CNA000001 for -// Los Alamos National Laboratory (LANL), which is operated by Triad National -// Security, LLC for the U.S. Department of Energy/National Nuclear Security -// Administration. All rights in the program are reserved by Triad National -// Security, LLC, and the U.S. Department of Energy/National Nuclear Security -// Administration. The Government is granted for itself and others acting on -// its behalf a nonexclusive, paid-up, irrevocable worldwide license in this -// material to reproduce, prepare derivative works, distribute copies to the -// public, perform publicly and display publicly, and to permit others to do so. -// -// This program is open source under the BSD-3 License. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. Neither the name of the copyright holder nor the -// names of its contributors may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include - -extern "C" { - - size_t c_test_ndarray_l_1d( flcl_ndarray_t *nd_array_l_1d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_1d = view_from_ndarray(*nd_array_l_1d); - for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { - if ( array_l_1d(ii) ) c_sum++; - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_1d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_1d.extent(0); ii++) { - array_l_1d(ii) = logical_post; - } - return c_sum; - } - - size_t c_test_ndarray_i32_1d( flcl_ndarray_t *nd_array_i32_1d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_1d = view_from_ndarray(*nd_array_i32_1d); - for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { - c_sum += array_i32_1d(ii); - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_1d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_1d.extent(0); ii++) { - array_i32_1d(ii) = ii; - c_sum += array_i32_1d(ii); - } - return c_sum; - } - - size_t c_test_ndarray_i64_1d( flcl_ndarray_t *nd_array_i64_1d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_1d = view_from_ndarray(*nd_array_i64_1d); - for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { - c_sum += array_i64_1d(ii); - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_1d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_1d.extent(0); ii++) { - array_i64_1d(ii) = ii; - c_sum += array_i64_1d(ii); - } - return c_sum; - } - - float c_test_ndarray_r32_1d( flcl_ndarray_t *nd_array_r32_1d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_1d = view_from_ndarray(*nd_array_r32_1d); - for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { - c_sum += array_r32_1d(ii); - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_1d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_1d.extent(0); ii++) { - array_r32_1d(ii) = ii; - c_sum += array_r32_1d(ii); - } - return c_sum; - } - - double c_test_ndarray_r64_1d( flcl_ndarray_t *nd_array_r64_1d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_1d = view_from_ndarray(*nd_array_r64_1d); - for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { - c_sum += array_r64_1d(ii); - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_1d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_1d.extent(0); ii++) { - array_r64_1d(ii) = ii; - c_sum += array_r64_1d(ii); - } - return c_sum; - } - - size_t c_test_ndarray_l_2d( flcl_ndarray_t *nd_array_l_2d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_2d = view_from_ndarray(*nd_array_l_2d); - for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { - if ( array_l_2d(ii,jj) ) c_sum++; - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_2d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_2d.extent(1); jj++) { - array_l_2d(ii,jj) = logical_post; - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_2d( flcl_ndarray_t *nd_array_i32_2d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_2d = view_from_ndarray(*nd_array_i32_2d); - for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { - c_sum += array_i32_2d(ii,jj); - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_2d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_2d.extent(1); jj++) { - array_i32_2d(ii,jj) = ii*jj; - c_sum += array_i32_2d(ii,jj); - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_2d( flcl_ndarray_t *nd_array_i64_2d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_2d = view_from_ndarray(*nd_array_i64_2d); - for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { - c_sum += array_i64_2d(ii,jj); - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_2d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_2d.extent(1); jj++) { - array_i64_2d(ii,jj) = ii*jj; - c_sum += array_i64_2d(ii,jj); - } - } - return c_sum; - } - - float c_test_ndarray_r32_2d( flcl_ndarray_t *nd_array_r32_2d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_2d = view_from_ndarray(*nd_array_r32_2d); - for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { - c_sum += array_r32_2d(ii,jj); - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_2d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_2d.extent(1); jj++) { - array_r32_2d(ii,jj) = ii*jj; - c_sum += array_r32_2d(ii,jj); - } - } - return c_sum; - } - - double c_test_ndarray_r64_2d( flcl_ndarray_t *nd_array_r64_2d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_2d = view_from_ndarray(*nd_array_r64_2d); - for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { - c_sum += array_r64_2d(ii,jj); - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_2d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_2d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_2d.extent(1); jj++) { - array_r64_2d(ii,jj) = ii*jj; - c_sum += array_r64_2d(ii,jj); - } - } - return c_sum; - } - - size_t c_test_ndarray_l_3d( flcl_ndarray_t *nd_array_l_3d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_3d = view_from_ndarray(*nd_array_l_3d); - for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { - if ( array_l_3d(ii,jj,kk) ) c_sum++; - } - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_3d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_3d.extent(2); kk++) { - array_l_3d(ii,jj,kk) = logical_post; - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_3d( flcl_ndarray_t *nd_array_i32_3d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_3d = view_from_ndarray(*nd_array_i32_3d); - for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { - c_sum += array_i32_3d(ii,jj,kk); - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_3d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_3d.extent(2); kk++) { - array_i32_3d(ii,jj,kk) = ii*jj*kk; - c_sum += array_i32_3d(ii,jj,kk); - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_3d( flcl_ndarray_t *nd_array_i64_3d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_3d = view_from_ndarray(*nd_array_i64_3d); - for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { - c_sum += array_i64_3d(ii,jj,kk); - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_3d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_3d.extent(2); kk++) { - array_i64_3d(ii,jj,kk) = ii*jj*kk; - c_sum += array_i64_3d(ii,jj,kk); - } - } - } - return c_sum; - } - - float c_test_ndarray_r32_3d( flcl_ndarray_t *nd_array_r32_3d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_3d = view_from_ndarray(*nd_array_r32_3d); - for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { - c_sum += array_r32_3d(ii,jj,kk); - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_3d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_3d.extent(2); kk++) { - array_r32_3d(ii,jj,kk) = ii*jj*kk; - c_sum += array_r32_3d(ii,jj,kk); - } - } - } - return c_sum; - } - - double c_test_ndarray_r64_3d( flcl_ndarray_t *nd_array_r64_3d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_3d = view_from_ndarray(*nd_array_r64_3d); - for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { - c_sum += array_r64_3d(ii,jj,kk); - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_3d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_3d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_3d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_3d.extent(2); kk++) { - array_r64_3d(ii,jj,kk) = ii*jj*kk; - c_sum += array_r64_3d(ii,jj,kk); - } - } - } - return c_sum; - - } - - size_t c_test_ndarray_l_4d( flcl_ndarray_t *nd_array_l_4d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_4d = view_from_ndarray(*nd_array_l_4d); - for (size_t ii = 0; ii < array_l_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_4d.extent(3); ll++) { - if ( array_l_4d(ii,jj,kk,ll) ) c_sum++; - } - } - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_4d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_4d.extent(3); ll++) { - array_l_4d(ii,jj,kk,ll) = logical_post; - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_4d( flcl_ndarray_t *nd_array_i32_4d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_4d = view_from_ndarray(*nd_array_i32_4d); - for (size_t ii = 0; ii < array_i32_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_4d.extent(3); ll++) { - c_sum += array_i32_4d(ii,jj,kk,ll); - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_4d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_4d.extent(3); ll++) { - array_i32_4d(ii,jj,kk,ll) = ii*jj*kk*ll; - c_sum += array_i32_4d(ii,jj,kk,ll); - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_4d( flcl_ndarray_t *nd_array_i64_4d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_4d = view_from_ndarray(*nd_array_i64_4d); - for (size_t ii = 0; ii < array_i64_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_4d.extent(3); ll++) { - c_sum += array_i64_4d(ii,jj,kk,ll); - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_4d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_4d.extent(3); ll++) { - array_i64_4d(ii,jj,kk,ll) = ii*jj*kk*ll; - c_sum += array_i64_4d(ii,jj,kk,ll); - } - } - } - } - return c_sum; - } - - float c_test_ndarray_r32_4d( flcl_ndarray_t *nd_array_r32_4d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_4d = view_from_ndarray(*nd_array_r32_4d); - for (size_t ii = 0; ii < array_r32_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_4d.extent(3); ll++) { - c_sum += array_r32_4d(ii,jj,kk,ll); - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_4d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_4d.extent(3); ll++) { - array_r32_4d(ii,jj,kk,ll) = ii*jj*kk*ll; - c_sum += array_r32_4d(ii,jj,kk,ll); - } - } - } - } - return c_sum; - } - - double c_test_ndarray_r64_4d( flcl_ndarray_t *nd_array_r64_4d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_4d = view_from_ndarray(*nd_array_r64_4d); - for (size_t ii = 0; ii < array_r64_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_4d.extent(3); ll++) { - c_sum += array_r64_4d(ii,jj,kk,ll); - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_4d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_4d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_4d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_4d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_4d.extent(3); ll++) { - array_r64_4d(ii,jj,kk,ll) = ii*jj*kk*ll; - c_sum += array_r64_4d(ii,jj,kk,ll); - } - } - } - } - return c_sum; - - } - - size_t c_test_ndarray_l_5d( flcl_ndarray_t *nd_array_l_5d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_5d = view_from_ndarray(*nd_array_l_5d); - for (size_t ii = 0; ii < array_l_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_5d.extent(4); mm++) { - if ( array_l_5d(ii,jj,kk,ll,mm) ) c_sum++; - } - } - } - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_5d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_5d.extent(4); mm++) { - array_l_5d(ii,jj,kk,ll,mm) = logical_post; - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_5d( flcl_ndarray_t *nd_array_i32_5d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_5d = view_from_ndarray(*nd_array_i32_5d); - for (size_t ii = 0; ii < array_i32_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_5d.extent(4); mm++) { - c_sum += array_i32_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_5d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_5d.extent(4); mm++) { - array_i32_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm; - c_sum += array_i32_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_5d( flcl_ndarray_t *nd_array_i64_5d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_5d = view_from_ndarray(*nd_array_i64_5d); - for (size_t ii = 0; ii < array_i64_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_5d.extent(4); mm++) { - c_sum += array_i64_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_5d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_5d.extent(4); mm++) { - array_i64_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm; - c_sum += array_i64_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - return c_sum; - } - - float c_test_ndarray_r32_5d( flcl_ndarray_t *nd_array_r32_5d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_5d = view_from_ndarray(*nd_array_r32_5d); - for (size_t ii = 0; ii < array_r32_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_5d.extent(4); mm++) { - c_sum += array_r32_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_5d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_5d.extent(4); mm++) { - array_r32_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm; - c_sum += array_r32_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - return c_sum; - } - - double c_test_ndarray_r64_5d( flcl_ndarray_t *nd_array_r64_5d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_5d = view_from_ndarray(*nd_array_r64_5d); - for (size_t ii = 0; ii < array_r64_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_5d.extent(4); mm++) { - c_sum += array_r64_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_5d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_5d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_5d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_5d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_5d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_5d.extent(4); mm++) { - array_r64_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm; - c_sum += array_r64_5d(ii,jj,kk,ll,mm); - } - } - } - } - } - return c_sum; - - } - - size_t c_test_ndarray_l_6d( flcl_ndarray_t *nd_array_l_6d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_6d = view_from_ndarray(*nd_array_l_6d); - for (size_t ii = 0; ii < array_l_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_l_6d.extent(5); nn++) { - if ( array_l_6d(ii,jj,kk,ll,mm,nn) ) c_sum++; - } - } - } - } - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_6d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_l_6d.extent(5); nn++) { - array_l_6d(ii,jj,kk,ll,mm,nn) = logical_post; - } - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_6d( flcl_ndarray_t *nd_array_i32_6d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_6d = view_from_ndarray(*nd_array_i32_6d); - for (size_t ii = 0; ii < array_i32_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i32_6d.extent(5); nn++) { - c_sum += array_i32_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_6d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i32_6d.extent(5); nn++) { - array_i32_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn; - c_sum += array_i32_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_6d( flcl_ndarray_t *nd_array_i64_6d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_6d = view_from_ndarray(*nd_array_i64_6d); - for (size_t ii = 0; ii < array_i64_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i64_6d.extent(5); nn++) { - c_sum += array_i64_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_6d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i64_6d.extent(5); nn++) { - array_i64_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn; - c_sum += array_i64_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - return c_sum; - } - - float c_test_ndarray_r32_6d( flcl_ndarray_t *nd_array_r32_6d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_6d = view_from_ndarray(*nd_array_r32_6d); - for (size_t ii = 0; ii < array_r32_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r32_6d.extent(5); nn++) { - c_sum += array_r32_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_6d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r32_6d.extent(5); nn++) { - array_r32_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn; - c_sum += array_r32_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - return c_sum; - } - - double c_test_ndarray_r64_6d( flcl_ndarray_t *nd_array_r64_6d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_6d = view_from_ndarray(*nd_array_r64_6d); - for (size_t ii = 0; ii < array_r64_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r64_6d.extent(5); nn++) { - c_sum += array_r64_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_6d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_6d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_6d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_6d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_6d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_6d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r64_6d.extent(5); nn++) { - array_r64_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn; - c_sum += array_r64_6d(ii,jj,kk,ll,mm,nn); - } - } - } - } - } - } - return c_sum; - - } - - size_t c_test_ndarray_l_7d( flcl_ndarray_t *nd_array_l_7d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_l_7d = view_from_ndarray(*nd_array_l_7d); - for (size_t ii = 0; ii < array_l_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_l_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_l_7d.extent(6); oo++) { - if ( array_l_7d(ii,jj,kk,ll,mm,nn,oo) ) c_sum++; - } - } - } - } - } - } - } - if (c_sum != *f_sum) { - std::cout << "FAILED ndarray_l_7d" << std::endl; - exit(EXIT_FAILURE); - } - for (size_t ii = 0; ii < array_l_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_l_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_l_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_l_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_l_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_l_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_l_7d.extent(6); oo++) { - array_l_7d(ii,jj,kk,ll,mm,nn,oo) = logical_post; - } - } - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i32_7d( flcl_ndarray_t *nd_array_i32_7d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i32_7d = view_from_ndarray(*nd_array_i32_7d); - for (size_t ii = 0; ii < array_i32_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i32_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_i32_7d.extent(6); oo++) { - c_sum += array_i32_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i32_7d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i32_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i32_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i32_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i32_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i32_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i32_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_i32_7d.extent(6); oo++) { - array_i32_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo; - c_sum += array_i32_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - return c_sum; - } - - size_t c_test_ndarray_i64_7d( flcl_ndarray_t *nd_array_i64_7d, size_t *f_sum ) { - using flcl::view_from_ndarray; - - size_t c_sum = 0; - auto array_i64_7d = view_from_ndarray(*nd_array_i64_7d); - for (size_t ii = 0; ii < array_i64_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i64_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_i64_7d.extent(6); oo++) { - c_sum += array_i64_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - if ( c_sum != *f_sum ) { - std::cout << "FAILED ndarray_i64_7d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_i64_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_i64_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_i64_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_i64_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_i64_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_i64_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_i64_7d.extent(6); oo++) { - array_i64_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo; - c_sum += array_i64_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - return c_sum; - } - - float c_test_ndarray_r32_7d( flcl_ndarray_t *nd_array_r32_7d, float *f_sum ) { - using flcl::view_from_ndarray; - - float c_sum = 0; - auto array_r32_7d = view_from_ndarray(*nd_array_r32_7d); - for (size_t ii = 0; ii < array_r32_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r32_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_r32_7d.extent(6); oo++) { - c_sum += array_r32_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-7 ) { - std::cout << "FAILED ndarray_r32_7d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r32_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r32_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r32_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r32_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r32_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r32_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_r32_7d.extent(6); oo++) { - array_r32_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo; - c_sum += array_r32_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - return c_sum; - } - - double c_test_ndarray_r64_7d( flcl_ndarray_t *nd_array_r64_7d, double *f_sum ) { - using flcl::view_from_ndarray; - - double c_sum = 0; - auto array_r64_7d = view_from_ndarray(*nd_array_r64_7d); - for (size_t ii = 0; ii < array_r64_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r64_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_r64_7d.extent(6); oo++) { - c_sum += array_r64_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - if ( std::fabs(c_sum - *f_sum) > 1.0e-14 ) { - std::cout << "FAILED ndarray_r64_7d" << std::endl; - exit(EXIT_FAILURE); - } - c_sum = 0; - for (size_t ii = 0; ii < array_r64_7d.extent(0); ii++) { - for (size_t jj = 0; jj < array_r64_7d.extent(1); jj++) { - for (size_t kk = 0; kk < array_r64_7d.extent(2); kk++) { - for (size_t ll = 0; ll < array_r64_7d.extent(3); ll++) { - for (size_t mm = 0; mm < array_r64_7d.extent(4); mm++) { - for (size_t nn = 0; nn < array_r64_7d.extent(5); nn++) { - for (size_t oo = 0; oo < array_r64_7d.extent(6); oo++) { - array_r64_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo; - c_sum += array_r64_7d(ii,jj,kk,ll,mm,nn,oo); - } - } - } - } - } - } - } - return c_sum; - - } -} diff --git a/test/test-flcl-f.f90 b/test/test-flcl-f.f90 deleted file mode 100644 index 8213504..0000000 --- a/test/test-flcl-f.f90 +++ /dev/null @@ -1,1983 +0,0 @@ -! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. -! -! This program was produced under U.S. Government contract 89233218CNA000001 for -! Los Alamos National Laboratory (LANL), which is operated by Triad National -! Security, LLC for the U.S. Department of Energy/National Nuclear Security -! Administration. All rights in the program are reserved by Triad National -! Security, LLC, and the U.S. Department of Energy/National Nuclear Security -! Administration. The Government is granted for itself and others acting on -! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this -! material to reproduce, prepare derivative works, distribute copies to the -! public, perform publicly and display publicly, and to permit others to do so. -! -! This program is open source under the BSD-3 License. -! -! Redistribution and use in source and binary forms, with or without modification, -! are permitted provided that the following conditions are met: -! -! 1. Redistributions of source code must retain the above copyright -! notice, this list of conditions and the following disclaimer. -! 2. Redistributions in binary form must reproduce the above copyright -! notice, this list of conditions and the following disclaimer in the -! documentation and/or other materials provided with the distribution. -! 3. Neither the name of the copyright holder nor the -! names of its contributors may be used to endorse or promote products -! derived from this software without specific prior written permission. -! -! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -module test_flcl_f_mod - use, intrinsic :: iso_c_binding - use, intrinsic :: iso_fortran_env - - use :: flcl_mod - - implicit none - - integer(c_size_t), parameter :: e0_length = 10 - integer(c_size_t), parameter :: e1_length = 9 - integer(c_size_t), parameter :: e2_length = 8 - integer(c_size_t), parameter :: e3_length = 7 - integer(c_size_t), parameter :: e4_length = 6 - integer(c_size_t), parameter :: e5_length = 5 - integer(c_size_t), parameter :: e6_length = 4 - logical(c_bool), parameter :: logical_pre = .true. - logical(c_bool), parameter :: logical_post = .false. - - enum, bind(c) - enumerator :: flcl_test_fail = 0 - enumerator :: flcl_test_pass = 1 - end enum - - public - - interface - integer(c_size_t) & - & function f_test_ndarray_l_1d( nd_array_l_1d, f_sum ) & - & bind(c, name='c_test_ndarray_l_1d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_1d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_1d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_1d( nd_array_i32_1d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_1d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_1d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_1d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_1d( nd_array_i64_1d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_1d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_1d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_1d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_1d( nd_array_r32_1d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_1d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_1d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_1d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_1d( nd_array_r64_1d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_1d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_1d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_1d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_2d( nd_array_l_2d, f_sum ) & - & bind(c, name='c_test_ndarray_l_2d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_2d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_2d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_2d( nd_array_i32_2d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_2d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_2d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_2d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_2d( nd_array_i64_2d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_2d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_2d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_2d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_2d( nd_array_r32_2d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_2d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_2d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_2d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_2d( nd_array_r64_2d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_2d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_2d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_2d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_3d( nd_array_l_3d, f_sum ) & - & bind(c, name='c_test_ndarray_l_3d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_3d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_3d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_3d( nd_array_i32_3d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_3d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_3d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_3d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_3d( nd_array_i64_3d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_3d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_3d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_3d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_3d( nd_array_r32_3d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_3d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_3d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_3d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_3d( nd_array_r64_3d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_3d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_3d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_3d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_4d( nd_array_l_4d, f_sum ) & - & bind(c, name='c_test_ndarray_l_4d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_4d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_4d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_4d( nd_array_i32_4d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_4d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_4d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_4d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_4d( nd_array_i64_4d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_4d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_4d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_4d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_4d( nd_array_r32_4d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_4d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_4d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_4d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_4d( nd_array_r64_4d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_4d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_4d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_4d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_5d( nd_array_l_5d, f_sum ) & - & bind(c, name='c_test_ndarray_l_5d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_5d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_5d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_5d( nd_array_i32_5d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_5d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_5d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_5d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_5d( nd_array_i64_5d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_5d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_5d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_5d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_5d( nd_array_r32_5d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_5d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_5d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_5d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_5d( nd_array_r64_5d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_5d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_5d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_5d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_6d( nd_array_l_6d, f_sum ) & - & bind(c, name='c_test_ndarray_l_6d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_6d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_6d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_6d( nd_array_i32_6d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_6d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_6d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_6d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_6d( nd_array_i64_6d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_6d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_6d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_6d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_6d( nd_array_r32_6d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_6d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_6d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_6d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_6d( nd_array_r64_6d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_6d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_6d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_6d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_l_7d( nd_array_l_7d, f_sum ) & - & bind(c, name='c_test_ndarray_l_7d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_l_7d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_l_7d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i32_7d( nd_array_i32_7d, f_sum ) & - & bind(c, name='c_test_ndarray_i32_7d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i32_7d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i32_7d - end interface - - interface - integer(c_size_t) & - & function f_test_ndarray_i64_7d( nd_array_i64_7d, f_sum ) & - & bind(c, name='c_test_ndarray_i64_7d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_i64_7d - integer(c_size_t), intent(inout) :: f_sum - end function f_test_ndarray_i64_7d - end interface - - interface - real(c_float) & - & function f_test_ndarray_r32_7d( nd_array_r32_7d, f_sum ) & - & bind(c, name='c_test_ndarray_r32_7d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r32_7d - real(c_float), intent(inout) :: f_sum - end function f_test_ndarray_r32_7d - end interface - - interface - real(c_double) & - & function f_test_ndarray_r64_7d( nd_array_r64_7d, f_sum ) & - & bind(c, name='c_test_ndarray_r64_7d') - use, intrinsic :: iso_c_binding - use :: flcl_mod - type(nd_array_t), intent(in) :: nd_array_r64_7d - real(c_double), intent(inout) :: f_sum - end function f_test_ndarray_r64_7d - end interface - - contains - - integer(c_size_t) & - & function test_ndarray_l_1d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:), allocatable :: array_l_1d - integer :: ii - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = e0_length - - allocate( array_l_1d(e0_length) ) - do ii = 1, e0_length - array_l_1d(ii) = logical_pre - if (array_l_1d(ii) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - c_sum = f_test_ndarray_l_1d( to_nd_array(array_l_1d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - if (array_l_1d(ii) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_1d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_1d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_1d - - integer(c_size_t) & - & function test_ndarray_i32_1d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:), allocatable :: array_i32_1d - integer :: ii - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = e0_length - - allocate( array_i32_1d(e0_length) ) - do ii = 1, e0_length - array_i32_1d(ii) = ii - f_sum = f_sum + array_i32_1d(ii) - end do - c_sum = f_test_ndarray_i32_1d( to_nd_array(array_i32_1d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - f_sum = f_sum + array_i32_1d(ii) - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_1d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_1d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_1d - - integer(c_size_t) & - & function test_ndarray_i64_1d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:), allocatable :: array_i64_1d - integer :: ii - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = e0_length - - allocate( array_i64_1d(e0_length) ) - do ii = 1, e0_length - array_i64_1d(ii) = ii - f_sum = f_sum + array_i64_1d(ii) - end do - c_sum = f_test_ndarray_i64_1d( to_nd_array(array_i64_1d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - f_sum = f_sum + array_i64_1d(ii) - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_1d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_1d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_1d - - integer(c_size_t) & - & function test_ndarray_r32_1d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:), allocatable :: array_r32_1d - integer :: ii - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = e0_length - - allocate( array_r32_1d(e0_length) ) - do ii = 1, e0_length - array_r32_1d(ii) = ii - f_sum = f_sum + array_r32_1d(ii) - end do - c_sum = f_test_ndarray_r32_1d( to_nd_array(array_r32_1d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - f_sum = f_sum + array_r32_1d(ii) - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_1d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_1d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_1d - - integer(c_size_t) & - & function test_ndarray_r64_1d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:), allocatable :: array_r64_1d - integer :: ii - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = e0_length - - allocate( array_r64_1d(e0_length) ) - do ii = 1, e0_length - array_r64_1d(ii) = ii - f_sum = f_sum + array_r64_1d(ii) - end do - c_sum = f_test_ndarray_r64_1d( to_nd_array(array_r64_1d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - f_sum = f_sum + array_r64_1d(ii) - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_1d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_1d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_1d - - integer(c_size_t) & - & function test_ndarray_l_2d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:), allocatable :: array_l_2d - integer :: ii, jj - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_2d(e0_length, e1_length) ) - do ii = 1, e0_length - do jj =1, e1_length - array_l_2d(ii,jj) = logical_pre - if (array_l_2d(ii,jj) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - c_sum = f_test_ndarray_l_2d( to_nd_array(array_l_2d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - if (array_l_2d(ii,jj) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_2d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_2d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_2d - - integer(c_size_t) & - & function test_ndarray_i32_2d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:), allocatable :: array_i32_2d - integer :: ii, jj - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_2d(e0_length, e1_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - array_i32_2d(ii,jj) = ii*jj - f_sum = f_sum + array_i32_2d(ii,jj) - end do - end do - c_sum = f_test_ndarray_i32_2d( to_nd_array(array_i32_2d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - f_sum = f_sum + array_i32_2d(ii,jj) - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_2d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_2d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_2d - - integer(c_size_t) & - & function test_ndarray_i64_2d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:), allocatable :: array_i64_2d - integer :: ii, jj - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_2d(e0_length, e1_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - array_i64_2d(ii,jj) = ii*jj - f_sum = f_sum + array_i64_2d(ii,jj) - end do - end do - c_sum = f_test_ndarray_i64_2d( to_nd_array(array_i64_2d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - f_sum = f_sum + array_i64_2d(ii,jj) - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_2d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_2d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_2d - - integer(c_size_t) & - & function test_ndarray_r32_2d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:), allocatable :: array_r32_2d - integer :: ii, jj - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_2d(e0_length, e1_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - array_r32_2d(ii,jj) = ii*jj - f_sum = f_sum + array_r32_2d(ii,jj) - end do - end do - c_sum = f_test_ndarray_r32_2d( to_nd_array(array_r32_2d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - f_sum = f_sum + array_r32_2d(ii,jj) - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_2d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_2d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_2d - - integer(c_size_t) & - & function test_ndarray_r64_2d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:), allocatable :: array_r64_2d - integer :: ii, jj - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_2d(e0_length, e1_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - array_r64_2d(ii,jj) = ii*jj - f_sum = f_sum + array_r64_2d(ii,jj) - end do - end do - c_sum = f_test_ndarray_r64_2d( to_nd_array(array_r64_2d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - f_sum = f_sum + array_r64_2d(ii,jj) - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_2d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_2d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_2d - - integer(c_size_t) & - & function test_ndarray_l_3d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:,:), allocatable :: array_l_3d - integer :: ii, jj, kk - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_3d(e0_length, e1_length, e2_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - array_l_3d(ii,jj,kk) = logical_pre - if (array_l_3d(ii,jj,kk) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - end do - c_sum = f_test_ndarray_l_3d( to_nd_array(array_l_3d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - if (array_l_3d(ii,jj,kk) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_3d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_3d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_3d - - integer(c_size_t) & - & function test_ndarray_i32_3d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:,:), allocatable :: array_i32_3d - integer :: ii, jj, kk - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_3d(e0_length, e1_length, e2_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - array_i32_3d(ii,jj,kk) = ii*jj*kk - f_sum = f_sum + array_i32_3d(ii,jj,kk) - end do - end do - end do - c_sum = f_test_ndarray_i32_3d( to_nd_array(array_i32_3d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - f_sum = f_sum + array_i32_3d(ii,jj,kk) - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_3d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_3d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_3d - - integer(c_size_t) & - & function test_ndarray_i64_3d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:,:), allocatable :: array_i64_3d - integer :: ii, jj, kk - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_3d(e0_length, e1_length, e2_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - array_i64_3d(ii,jj,kk) = ii*jj*kk - f_sum = f_sum + array_i64_3d(ii,jj,kk) - end do - end do - end do - c_sum = f_test_ndarray_i64_3d( to_nd_array(array_i64_3d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - f_sum = f_sum + array_i64_3d(ii,jj,kk) - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_3d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_3d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_3d - - integer(c_size_t) & - & function test_ndarray_r32_3d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:,:), allocatable :: array_r32_3d - integer :: ii, jj, kk - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_3d(e0_length, e1_length, e2_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - array_r32_3d(ii,jj,kk) = ii*jj*kk - f_sum = f_sum + array_r32_3d(ii,jj,kk) - end do - end do - end do - c_sum = f_test_ndarray_r32_3d( to_nd_array(array_r32_3d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - f_sum = f_sum + array_r32_3d(ii,jj,kk) - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_3d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_3d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_3d - - integer(c_size_t) & - & function test_ndarray_r64_3d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:,:), allocatable :: array_r64_3d - integer :: ii, jj, kk - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_3d(e0_length, e1_length, e2_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - array_r64_3d(ii,jj,kk) = ii*jj*kk - f_sum = f_sum + array_r64_3d(ii,jj,kk) - end do - end do - end do - c_sum = f_test_ndarray_r64_3d( to_nd_array(array_r64_3d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - f_sum = f_sum + array_r64_3d(ii,jj,kk) - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_3d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_3d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_3d - - integer(c_size_t) & - & function test_ndarray_l_4d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:,:,:), allocatable :: array_l_4d - integer :: ii, jj, kk, ll - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_4d(e0_length, e1_length, e2_length, e3_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - array_l_4d(ii,jj,kk,ll) = logical_pre - if (array_l_4d(ii,jj,kk,ll) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - c_sum = f_test_ndarray_l_4d( to_nd_array(array_l_4d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - if (array_l_4d(ii,jj,kk,ll) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_4d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_4d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_4d - - integer(c_size_t) & - & function test_ndarray_i32_4d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:,:,:), allocatable :: array_i32_4d - integer :: ii, jj, kk, ll - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_4d(e0_length, e1_length, e2_length, e3_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - array_i32_4d(ii,jj,kk,ll) = ii*jj*kk*ll - f_sum = f_sum + array_i32_4d(ii,jj,kk,ll) - end do - end do - end do - end do - c_sum = f_test_ndarray_i32_4d( to_nd_array(array_i32_4d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - f_sum = f_sum + array_i32_4d(ii,jj,kk,ll) - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_4d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_4d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_4d - - integer(c_size_t) & - & function test_ndarray_i64_4d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:,:,:), allocatable :: array_i64_4d - integer :: ii, jj, kk, ll - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_4d(e0_length, e1_length, e2_length, e3_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - array_i64_4d(ii,jj,kk,ll) = ii*jj*kk*ll - f_sum = f_sum + array_i64_4d(ii,jj,kk,ll) - end do - end do - end do - end do - c_sum = f_test_ndarray_i64_4d( to_nd_array(array_i64_4d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - f_sum = f_sum + array_i64_4d(ii,jj,kk,ll) - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_4d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_4d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_4d - - integer(c_size_t) & - & function test_ndarray_r32_4d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:,:,:), allocatable :: array_r32_4d - integer :: ii, jj, kk, ll - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_4d(e0_length, e1_length, e2_length, e3_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - array_r32_4d(ii,jj,kk,ll) = ii*jj*kk*ll - f_sum = f_sum + array_r32_4d(ii,jj,kk,ll) - end do - end do - end do - end do - c_sum = f_test_ndarray_r32_4d( to_nd_array(array_r32_4d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - f_sum = f_sum + array_r32_4d(ii,jj,kk,ll) - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_4d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_4d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_4d - - integer(c_size_t) & - & function test_ndarray_r64_4d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:,:,:), allocatable :: array_r64_4d - integer :: ii, jj, kk, ll - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_4d(e0_length, e1_length, e2_length, e3_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - array_r64_4d(ii,jj,kk,ll) = ii*jj*kk*ll - f_sum = f_sum + array_r64_4d(ii,jj,kk,ll) - end do - end do - end do - end do - c_sum = f_test_ndarray_r64_4d( to_nd_array(array_r64_4d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - f_sum = f_sum + array_r64_4d(ii,jj,kk,ll) - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_4d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_4d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_4d - - integer(c_size_t) & - & function test_ndarray_l_5d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:,:,:,:), allocatable :: array_l_5d - integer :: ii, jj, kk, ll, mm - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - array_l_5d(ii,jj,kk,ll,mm) = logical_pre - if (array_l_5d(ii,jj,kk,ll,mm) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_l_5d( to_nd_array(array_l_5d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - if (array_l_5d(ii,jj,kk,ll,mm) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_5d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_5d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_5d - - integer(c_size_t) & - & function test_ndarray_i32_5d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:,:,:,:), allocatable :: array_i32_5d - integer :: ii, jj, kk, ll, mm - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - array_i32_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm - f_sum = f_sum + array_i32_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i32_5d( to_nd_array(array_i32_5d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - f_sum = f_sum + array_i32_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_5d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_5d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_5d - - integer(c_size_t) & - & function test_ndarray_i64_5d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:,:,:,:), allocatable :: array_i64_5d - integer :: ii, jj, kk, ll, mm - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - array_i64_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm - f_sum = f_sum + array_i64_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i64_5d( to_nd_array(array_i64_5d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - f_sum = f_sum + array_i64_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_5d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_5d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_5d - - integer(c_size_t) & - & function test_ndarray_r32_5d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:,:,:,:), allocatable :: array_r32_5d - integer :: ii, jj, kk, ll, mm - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - array_r32_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm - f_sum = f_sum + array_r32_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r32_5d( to_nd_array(array_r32_5d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - f_sum = f_sum + array_r32_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_5d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_5d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_5d - - integer(c_size_t) & - & function test_ndarray_r64_5d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:,:,:,:), allocatable :: array_r64_5d - integer :: ii, jj, kk, ll, mm - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_5d(e0_length, e1_length, e2_length, e3_length, e4_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - array_r64_5d(ii,jj,kk,ll,mm) = ii*jj*kk*ll*mm - f_sum = f_sum + array_r64_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r64_5d( to_nd_array(array_r64_5d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - f_sum = f_sum + array_r64_5d(ii,jj,kk,ll,mm) - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_5d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_5d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_5d - - integer(c_size_t) & - & function test_ndarray_l_6d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:,:,:,:,:), allocatable :: array_l_6d - integer :: ii, jj, kk, ll, mm, nn - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - array_l_6d(ii,jj,kk,ll,mm,nn) = logical_pre - if (array_l_6d(ii,jj,kk,ll,mm,nn) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_l_6d( to_nd_array(array_l_6d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - if (array_l_6d(ii,jj,kk,ll,mm,nn) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_6d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_6d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_6d - - integer(c_size_t) & - & function test_ndarray_i32_6d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:,:,:,:,:), allocatable :: array_i32_6d - integer :: ii, jj, kk, ll, mm, nn - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - array_i32_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn - f_sum = f_sum + array_i32_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i32_6d( to_nd_array(array_i32_6d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - f_sum = f_sum + array_i32_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_6d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_6d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_6d - - integer(c_size_t) & - & function test_ndarray_i64_6d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:,:,:,:,:), allocatable :: array_i64_6d - integer :: ii, jj, kk, ll, mm, nn - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - array_i64_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn - f_sum = f_sum + array_i64_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i64_6d( to_nd_array(array_i64_6d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - f_sum = f_sum + array_i64_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_6d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_6d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_6d - - integer(c_size_t) & - & function test_ndarray_r32_6d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:,:,:,:,:), allocatable :: array_r32_6d - integer :: ii, jj, kk, ll, mm, nn - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - array_r32_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn - f_sum = f_sum + array_r32_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r32_6d( to_nd_array(array_r32_6d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - f_sum = f_sum + array_r32_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_6d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_6d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_6d - - integer(c_size_t) & - & function test_ndarray_r64_6d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:,:,:,:,:), allocatable :: array_r64_6d - integer :: ii, jj, kk, ll, mm, nn - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_6d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - array_r64_6d(ii,jj,kk,ll,mm,nn) = ii*jj*kk*ll*mm*nn - f_sum = f_sum + array_r64_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r64_6d( to_nd_array(array_r64_6d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - f_sum = f_sum + array_r64_6d(ii,jj,kk,ll,mm,nn) - end do - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_6d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_6d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_6d - - integer(c_size_t) & - & function test_ndarray_l_7d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - logical(c_bool), dimension(:,:,:,:,:,:,:), allocatable :: array_l_7d - integer :: ii, jj, kk, ll, mm, nn, oo - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_l_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - array_l_7d(ii,jj,kk,ll,mm,nn,oo) = logical_pre - if (array_l_7d(ii,jj,kk,ll,mm,nn,oo) .eqv. logical_pre) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_l_7d( to_nd_array(array_l_7d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - if (array_l_7d(ii,jj,kk,ll,mm,nn,oo) .eqv. logical_post) then - f_sum = f_sum + 1 - end if - end do - end do - end do - end do - end do - end do - end do - if (f_sum == c_sum) then - write(*,*)'PASSED ndarray_l_7d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarry_l_7d' - ierr = flcl_test_fail - end if - end function test_ndarray_l_7d - - integer(c_size_t) & - & function test_ndarray_i32_7d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int32_t), dimension(:,:,:,:,:,:,:), allocatable :: array_i32_7d - integer :: ii, jj, kk, ll, mm, nn, oo - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i32_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - array_i32_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo - f_sum = f_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i32_7d( to_nd_array(array_i32_7d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - f_sum = f_sum + array_i32_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i32_7d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i32_7d' - ierr = flcl_test_fail - end if - end function test_ndarray_i32_7d - - integer(c_size_t) & - & function test_ndarray_i64_7d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - integer(c_int64_t), dimension(:,:,:,:,:,:,:), allocatable :: array_i64_7d - integer :: ii, jj, kk, ll, mm, nn,oo - integer(c_size_t) :: f_sum = 0 - integer(c_size_t) :: c_sum = 0 - - allocate( array_i64_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - array_i64_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo - f_sum = f_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_i64_7d( to_nd_array(array_i64_7d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - f_sum = f_sum + array_i64_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - if ( f_sum .eq. c_sum ) then - write(*,*)'PASSED ndarray_i64_7d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_i64_7d' - ierr = flcl_test_fail - end if - end function test_ndarray_i64_7d - - integer(c_size_t) & - & function test_ndarray_r32_7d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_float), dimension(:,:,:,:,:,:,:), allocatable :: array_r32_7d - integer :: ii, jj, kk, ll, mm, nn, oo - real(c_float) :: f_sum = 0 - real(c_float) :: c_sum = 0 - - allocate( array_r32_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - array_r32_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo - f_sum = f_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r32_7d( to_nd_array(array_r32_7d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - f_sum = f_sum + array_r32_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-7 ) then - write(*,*)'PASSED ndarray_r32_7d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r32_7d' - ierr = flcl_test_fail - end if - end function test_ndarray_r32_7d - - integer(c_size_t) & - & function test_ndarray_r64_7d() & - & result(ierr) - use, intrinsic :: iso_c_binding - use :: flcl_mod - implicit none - - real(c_double), dimension(:,:,:,:,:,:,:), allocatable :: array_r64_7d - integer :: ii, jj, kk, ll, mm, nn, oo - real(c_double) :: f_sum = 0 - real(c_double) :: c_sum = 0 - - allocate( array_r64_7d(e0_length, e1_length, e2_length, e3_length, e4_length, e5_length, e6_length) ) - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - array_r64_7d(ii,jj,kk,ll,mm,nn,oo) = ii*jj*kk*ll*mm*nn*oo - f_sum = f_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - c_sum = f_test_ndarray_r64_7d( to_nd_array(array_r64_7d), f_sum ) - f_sum = 0 - do ii = 1, e0_length - do jj = 1, e1_length - do kk = 1, e2_length - do ll = 1, e3_length - do mm = 1, e4_length - do nn = 1, e5_length - do oo = 1, e6_length - f_sum = f_sum + array_r64_7d(ii,jj,kk,ll,mm,nn,oo) - end do - end do - end do - end do - end do - end do - end do - if ( abs(f_sum - c_sum ) < 1.0e-14 ) then - write(*,*)'PASSED ndarray_r64_7d' - ierr = flcl_test_pass - else - write(*,*)'FAILED ndarray_r64_7d' - ierr = flcl_test_fail - end if - end function test_ndarray_r64_7d - -end module test_flcl_f_mod diff --git a/test/test_kokkos_allocate_view_i32_1d.f90 b/test/test_kokkos_allocate_view_i32_1d.f90 new file mode 100644 index 0000000..0a16bec --- /dev/null +++ b/test/test_kokkos_allocate_view_i32_1d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i32_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i32_1d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i32_1d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_i32_2d.f90 b/test/test_kokkos_allocate_view_i32_2d.f90 new file mode 100644 index 0000000..d9c45ea --- /dev/null +++ b/test/test_kokkos_allocate_view_i32_2d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i32_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i32_2d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i32_2d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_i32_3d.f90 b/test/test_kokkos_allocate_view_i32_3d.f90 new file mode 100644 index 0000000..85f85b1 --- /dev/null +++ b/test/test_kokkos_allocate_view_i32_3d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i32_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i32_3d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i32_3d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_i64_1d.f90 b/test/test_kokkos_allocate_view_i64_1d.f90 new file mode 100644 index 0000000..8191cb2 --- /dev/null +++ b/test/test_kokkos_allocate_view_i64_1d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i64_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i64_1d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i64_1d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_i64_2d.f90 b/test/test_kokkos_allocate_view_i64_2d.f90 new file mode 100644 index 0000000..2e4bd11 --- /dev/null +++ b/test/test_kokkos_allocate_view_i64_2d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i64_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i64_2d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i64_2d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_i64_3d.f90 b/test/test_kokkos_allocate_view_i64_3d.f90 new file mode 100644 index 0000000..ab0666c --- /dev/null +++ b/test/test_kokkos_allocate_view_i64_3d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_i64_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_i64_3d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_i64_3d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_l_1d.f90 b/test/test_kokkos_allocate_view_l_1d.f90 new file mode 100644 index 0000000..9bd6256 --- /dev/null +++ b/test/test_kokkos_allocate_view_l_1d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_l_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_l_1d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_l_1d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_l_2d.f90 b/test/test_kokkos_allocate_view_l_2d.f90 new file mode 100644 index 0000000..ed78629 --- /dev/null +++ b/test/test_kokkos_allocate_view_l_2d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_l_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_l_2d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_l_2d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_l_3d.f90 b/test/test_kokkos_allocate_view_l_3d.f90 new file mode 100644 index 0000000..381ea64 --- /dev/null +++ b/test/test_kokkos_allocate_view_l_3d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_l_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_l_3d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_l_3d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r32_1d.f90 b/test/test_kokkos_allocate_view_r32_1d.f90 new file mode 100644 index 0000000..78f5932 --- /dev/null +++ b/test/test_kokkos_allocate_view_r32_1d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r32_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r32_1d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r32_1d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r32_2d.f90 b/test/test_kokkos_allocate_view_r32_2d.f90 new file mode 100644 index 0000000..2d52c71 --- /dev/null +++ b/test/test_kokkos_allocate_view_r32_2d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r32_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r32_2d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r32_2d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r32_3d.f90 b/test/test_kokkos_allocate_view_r32_3d.f90 new file mode 100644 index 0000000..eaae22c --- /dev/null +++ b/test/test_kokkos_allocate_view_r32_3d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r32_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r32_3d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r32_3d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r64_1d.f90 b/test/test_kokkos_allocate_view_r64_1d.f90 new file mode 100644 index 0000000..9ac9da6 --- /dev/null +++ b/test/test_kokkos_allocate_view_r64_1d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r64_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r64_1d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r64_1d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r64_2d.f90 b/test/test_kokkos_allocate_view_r64_2d.f90 new file mode 100644 index 0000000..9d68583 --- /dev/null +++ b/test/test_kokkos_allocate_view_r64_2d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r64_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r64_2d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r64_2d_main \ No newline at end of file diff --git a/test/test_kokkos_allocate_view_r64_3d.f90 b/test/test_kokkos_allocate_view_r64_3d.f90 new file mode 100644 index 0000000..07f6022 --- /dev/null +++ b/test/test_kokkos_allocate_view_r64_3d.f90 @@ -0,0 +1,67 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_kokkos_allocate_view_r64_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + write(*,*)'before kokkos_init' + call kokkos_initialize_without_args() + write(*,*)'after kokkos_init' + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_kokkos_allocate_view_r64_3d() + write(*,*)'ierr ',ierr + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_kokkos_allocate_view_r64_3d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_1d.f90 b/test/test_ndarray_c32_1d.f90 new file mode 100644 index 0000000..dd01f98 --- /dev/null +++ b/test/test_ndarray_c32_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_1d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_2d.f90 b/test/test_ndarray_c32_2d.f90 new file mode 100644 index 0000000..e92732c --- /dev/null +++ b/test/test_ndarray_c32_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_2d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_3d.f90 b/test/test_ndarray_c32_3d.f90 new file mode 100644 index 0000000..2e2e971 --- /dev/null +++ b/test/test_ndarray_c32_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_3d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_4d.f90 b/test/test_ndarray_c32_4d.f90 new file mode 100644 index 0000000..4c83e32 --- /dev/null +++ b/test/test_ndarray_c32_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_4d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_5d.f90 b/test/test_ndarray_c32_5d.f90 new file mode 100644 index 0000000..091bbf2 --- /dev/null +++ b/test/test_ndarray_c32_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_5d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_6d.f90 b/test/test_ndarray_c32_6d.f90 new file mode 100644 index 0000000..7aead55 --- /dev/null +++ b/test/test_ndarray_c32_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_6d_main \ No newline at end of file diff --git a/test/test_ndarray_c32_7d.f90 b/test/test_ndarray_c32_7d.f90 new file mode 100644 index 0000000..2d13530 --- /dev/null +++ b/test/test_ndarray_c32_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c32_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c32_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c32_7d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_1d.f90 b/test/test_ndarray_c64_1d.f90 new file mode 100644 index 0000000..1b21ac8 --- /dev/null +++ b/test/test_ndarray_c64_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_1d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_2d.f90 b/test/test_ndarray_c64_2d.f90 new file mode 100644 index 0000000..8e3d8c4 --- /dev/null +++ b/test/test_ndarray_c64_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_2d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_3d.f90 b/test/test_ndarray_c64_3d.f90 new file mode 100644 index 0000000..45bacd4 --- /dev/null +++ b/test/test_ndarray_c64_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_3d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_4d.f90 b/test/test_ndarray_c64_4d.f90 new file mode 100644 index 0000000..044af05 --- /dev/null +++ b/test/test_ndarray_c64_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_4d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_5d.f90 b/test/test_ndarray_c64_5d.f90 new file mode 100644 index 0000000..2381a3f --- /dev/null +++ b/test/test_ndarray_c64_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_5d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_6d.f90 b/test/test_ndarray_c64_6d.f90 new file mode 100644 index 0000000..e2c6eb9 --- /dev/null +++ b/test/test_ndarray_c64_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_6d_main \ No newline at end of file diff --git a/test/test_ndarray_c64_7d.f90 b/test/test_ndarray_c64_7d.f90 new file mode 100644 index 0000000..b3146ac --- /dev/null +++ b/test/test_ndarray_c64_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_c64_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_c64_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_c64_7d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_1d.f90 b/test/test_ndarray_i32_1d.f90 new file mode 100644 index 0000000..9d75dc4 --- /dev/null +++ b/test/test_ndarray_i32_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_1d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_2d.f90 b/test/test_ndarray_i32_2d.f90 new file mode 100644 index 0000000..732d1ec --- /dev/null +++ b/test/test_ndarray_i32_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_2d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_3d.f90 b/test/test_ndarray_i32_3d.f90 new file mode 100644 index 0000000..a18ea0d --- /dev/null +++ b/test/test_ndarray_i32_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_3d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_4d.f90 b/test/test_ndarray_i32_4d.f90 new file mode 100644 index 0000000..ea8f781 --- /dev/null +++ b/test/test_ndarray_i32_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_4d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_5d.f90 b/test/test_ndarray_i32_5d.f90 new file mode 100644 index 0000000..dc9b8ba --- /dev/null +++ b/test/test_ndarray_i32_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_5d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_6d.f90 b/test/test_ndarray_i32_6d.f90 new file mode 100644 index 0000000..ac090d1 --- /dev/null +++ b/test/test_ndarray_i32_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_6d_main \ No newline at end of file diff --git a/test/test_ndarray_i32_7d.f90 b/test/test_ndarray_i32_7d.f90 new file mode 100644 index 0000000..4810d0e --- /dev/null +++ b/test/test_ndarray_i32_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i32_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i32_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i32_7d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_1d.f90 b/test/test_ndarray_i64_1d.f90 new file mode 100644 index 0000000..e1a10f6 --- /dev/null +++ b/test/test_ndarray_i64_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_1d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_2d.f90 b/test/test_ndarray_i64_2d.f90 new file mode 100644 index 0000000..2e83cd3 --- /dev/null +++ b/test/test_ndarray_i64_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_2d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_3d.f90 b/test/test_ndarray_i64_3d.f90 new file mode 100644 index 0000000..fc897f1 --- /dev/null +++ b/test/test_ndarray_i64_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_3d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_4d.f90 b/test/test_ndarray_i64_4d.f90 new file mode 100644 index 0000000..41a73ee --- /dev/null +++ b/test/test_ndarray_i64_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_4d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_5d.f90 b/test/test_ndarray_i64_5d.f90 new file mode 100644 index 0000000..bc38219 --- /dev/null +++ b/test/test_ndarray_i64_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_5d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_6d.f90 b/test/test_ndarray_i64_6d.f90 new file mode 100644 index 0000000..e9c2501 --- /dev/null +++ b/test/test_ndarray_i64_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_6d_main \ No newline at end of file diff --git a/test/test_ndarray_i64_7d.f90 b/test/test_ndarray_i64_7d.f90 new file mode 100644 index 0000000..8669e0b --- /dev/null +++ b/test/test_ndarray_i64_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_i64_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_i64_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_i64_7d_main \ No newline at end of file diff --git a/test/test_ndarray_l_1d.f90 b/test/test_ndarray_l_1d.f90 new file mode 100644 index 0000000..8ae0ff6 --- /dev/null +++ b/test/test_ndarray_l_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_1d_main \ No newline at end of file diff --git a/test/test_ndarray_l_2d.f90 b/test/test_ndarray_l_2d.f90 new file mode 100644 index 0000000..059d02e --- /dev/null +++ b/test/test_ndarray_l_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_2d_main \ No newline at end of file diff --git a/test/test_ndarray_l_3d.f90 b/test/test_ndarray_l_3d.f90 new file mode 100644 index 0000000..f63cde8 --- /dev/null +++ b/test/test_ndarray_l_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_3d_main \ No newline at end of file diff --git a/test/test_ndarray_l_4d.f90 b/test/test_ndarray_l_4d.f90 new file mode 100644 index 0000000..a73cd44 --- /dev/null +++ b/test/test_ndarray_l_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_4d_main \ No newline at end of file diff --git a/test/test_ndarray_l_5d.f90 b/test/test_ndarray_l_5d.f90 new file mode 100644 index 0000000..461d174 --- /dev/null +++ b/test/test_ndarray_l_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_5d_main \ No newline at end of file diff --git a/test/test_ndarray_l_6d.f90 b/test/test_ndarray_l_6d.f90 new file mode 100644 index 0000000..e8652d3 --- /dev/null +++ b/test/test_ndarray_l_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_6d_main \ No newline at end of file diff --git a/test/test_ndarray_l_7d.f90 b/test/test_ndarray_l_7d.f90 new file mode 100644 index 0000000..ccf4232 --- /dev/null +++ b/test/test_ndarray_l_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_l_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_l_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_l_7d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_1d.f90 b/test/test_ndarray_r32_1d.f90 new file mode 100644 index 0000000..148881c --- /dev/null +++ b/test/test_ndarray_r32_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_1d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_2d.f90 b/test/test_ndarray_r32_2d.f90 new file mode 100644 index 0000000..8959679 --- /dev/null +++ b/test/test_ndarray_r32_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_2d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_3d.f90 b/test/test_ndarray_r32_3d.f90 new file mode 100644 index 0000000..49ac989 --- /dev/null +++ b/test/test_ndarray_r32_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_3d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_4d.f90 b/test/test_ndarray_r32_4d.f90 new file mode 100644 index 0000000..62210b2 --- /dev/null +++ b/test/test_ndarray_r32_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_4d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_5d.f90 b/test/test_ndarray_r32_5d.f90 new file mode 100644 index 0000000..aa77e33 --- /dev/null +++ b/test/test_ndarray_r32_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_5d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_6d.f90 b/test/test_ndarray_r32_6d.f90 new file mode 100644 index 0000000..f3407dc --- /dev/null +++ b/test/test_ndarray_r32_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_6d_main \ No newline at end of file diff --git a/test/test_ndarray_r32_7d.f90 b/test/test_ndarray_r32_7d.f90 new file mode 100644 index 0000000..a2ae144 --- /dev/null +++ b/test/test_ndarray_r32_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r32_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r32_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r32_7d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_1d.f90 b/test/test_ndarray_r64_1d.f90 new file mode 100644 index 0000000..8ffe1d7 --- /dev/null +++ b/test/test_ndarray_r64_1d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_1d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_1d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_1d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_2d.f90 b/test/test_ndarray_r64_2d.f90 new file mode 100644 index 0000000..afe25a9 --- /dev/null +++ b/test/test_ndarray_r64_2d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_2d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_2d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_2d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_3d.f90 b/test/test_ndarray_r64_3d.f90 new file mode 100644 index 0000000..b506008 --- /dev/null +++ b/test/test_ndarray_r64_3d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_3d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_3d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_3d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_4d.f90 b/test/test_ndarray_r64_4d.f90 new file mode 100644 index 0000000..c093379 --- /dev/null +++ b/test/test_ndarray_r64_4d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_4d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_4d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_4d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_5d.f90 b/test/test_ndarray_r64_5d.f90 new file mode 100644 index 0000000..615af82 --- /dev/null +++ b/test/test_ndarray_r64_5d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_5d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_5d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_5d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_6d.f90 b/test/test_ndarray_r64_6d.f90 new file mode 100644 index 0000000..44345d8 --- /dev/null +++ b/test/test_ndarray_r64_6d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_6d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_6d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_6d_main \ No newline at end of file diff --git a/test/test_ndarray_r64_7d.f90 b/test/test_ndarray_r64_7d.f90 new file mode 100644 index 0000000..e6154bf --- /dev/null +++ b/test/test_ndarray_r64_7d.f90 @@ -0,0 +1,64 @@ +! Copyright (c) 2019. Triad National Security, LLC. All rights reserved. +! +! This program was produced under U.S. Government contract 89233218CNA000001 for +! Los Alamos National Laboratory (LANL), which is operated by Triad National +! Security, LLC for the U.S. Department of Energy/National Nuclear Security +! Administration. All rights in the program are reserved by Triad National +! Security, LLC, and the U.S. Department of Energy/National Nuclear Security +! Administration. The Government is granted for itself and others acting on +! its behalf a nonexclusive, paid-up, irrevocable worldwide license in this +! material to reproduce, prepare derivative works, distribute copies to the +! public, perform publicly and display publicly, and to permit others to do so. +! +! This program is open source under the BSD-3 License. +! +! Redistribution and use in source and binary forms, with or without modification, +! are permitted provided that the following conditions are met: +! +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. Neither the name of the copyright holder nor the +! names of its contributors may be used to endorse or promote products +! derived from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +! ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +program test_ndarray_r64_7d_main + use, intrinsic :: iso_c_binding + use, intrinsic :: iso_fortran_env + + use :: flcl_mod + use :: flcl_util_kokkos_mod + use :: flcl_test_f_mod + + implicit none + + integer(c_size_t) :: ierr = 0 + + call kokkos_initialize_without_args() + + if ( kokkos_is_initialized() ) then + + ! call kokkos_print_configuration('flcl-test-', 'kokkos.out') + + ierr = test_ndarray_r64_7d() + + call kokkos_finalize() + + call exit(ierr) + + end if + + end program test_ndarray_r64_7d_main \ No newline at end of file