// @HEADER // ***************************************************************************** // Sacado Package // // Copyright 2006 NTESS and the Sacado contributors. // SPDX-License-Identifier: LGPL-2.1-or-later // ***************************************************************************** // @HEADER #include "Teuchos_UnitTestHarness.hpp" #include "Teuchos_UnitTestRepository.hpp" #include "Teuchos_GlobalMPISession.hpp" // Re-test cuda with hierarchical cuda parallelism turned on (experimental) #define SACADO_VIEW_CUDA_HIERARCHICAL_DFAD 1 #define SACADO_KOKKOS_USE_MEMORY_POOL 1 #include "Fad_KokkosAtomicTests.hpp" typedef Kokkos::LayoutContiguous LeftContiguous32; typedef Kokkos::LayoutContiguous RightContiguous32; #undef VIEW_FAD_TESTS_FD #define VIEW_FAD_TESTS_FD( F, D ) \ VIEW_FAD_TESTS_FLD( F, LeftContiguous32, D ) \ VIEW_FAD_TESTS_FLD( F, RightContiguous32, D ) // Instantiate tests for Cuda device #if defined(KOKKOS_ENABLE_CUDA_UVM) && SACADO_ENABLE_NEW_DESIGN using Kokkos::Cuda; VIEW_FAD_TESTS_FD( DFadType , Cuda ) #endif int main( int argc, char* argv[] ) { Teuchos::GlobalMPISession mpiSession(&argc, &argv); // Initialize Cuda Kokkos::InitializationSettings init_args; init_args.set_device_id(0); Kokkos::initialize( init_args ); Kokkos::print_configuration(std::cout); #if defined(SACADO_KOKKOS_USE_MEMORY_POOL) Sacado::createGlobalMemoryPool( Kokkos::Cuda(), 2*32*global_fad_size*global_num_rows*global_num_cols*sizeof(double), global_fad_size*sizeof(double), 4*global_fad_size*sizeof(double), 128*global_fad_size*sizeof(double)); #endif int res = Teuchos::UnitTestRepository::runUnitTestsFromMain(argc, argv); #if defined(SACADO_KOKKOS_USE_MEMORY_POOL) Sacado::destroyGlobalMemoryPool(Kokkos::Cuda()); #endif // Finalize Cuda Kokkos::finalize(); return res; }