Skip to content
Snippets Groups Projects
Commit 36db2314 authored by Slattery, Stuart's avatar Slattery, Stuart
Browse files

adding additional test memory space

parent 1e0e8051
No related branches found
No related tags found
1 merge request!7Kokkos Portability Layer
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
......@@ -50,7 +50,7 @@ inline void parallel_for( const ExecutionPolicy& exec_policy,
// each thread loops over the inner arrays.
std::size_t array_size = begin.a();
auto functor_wrapper =
KOKKOS_LAMBDA( std::size_t s )
KOKKOS_LAMBDA( const std::size_t s )
{
std::size_t i_begin = (s == s_begin) ? begin.i() : 0;
std::size_t i_end = ((s == s_end - 1) && (end.i() != 0))
......@@ -99,7 +99,7 @@ inline void parallel_for( const ExecutionPolicy& exec_policy,
// Create a wrapper for the functor. Each struct is given a thread and
// each thread loops over the inner arrays.
auto functor_wrapper =
KOKKOS_LAMBDA( std::size_t i )
KOKKOS_LAMBDA( const std::size_t i )
{
Index idx( array_size, s, i );
functor( idx );
......@@ -140,7 +140,7 @@ inline void parallel_for( const ExecutionPolicy& exec_policy,
// Create a wrapper for the functor.
auto functor_wrapper =
KOKKOS_LAMBDA( std::size_t s, std::size_t i )
KOKKOS_LAMBDA( const std::size_t s, const std::size_t i )
{
Index idx( array_size, s, i );
if ( idx >= begin && idx < end ) functor( idx );
......
#ifndef CABANA_TEST_CUDAUVM_CATEGORY_HPP
#define CABANA_TEST_CUDAUVM_CATEGORY_HPP
#define TEST_EXECSPACE Kokkos::CudaUVMSpace
#include <Kokkos_Cuda.hpp>
#define TEST_EXECSPACE Kokkos::Cuda
#define TEST_MEMSPACE Kokkos::CudaUVMSpace
#endif // end CABANA_TEST_CUDAUVM_CATEGORY_HPP
#ifndef CABANA_TEST_OPENMP_CATEGORY_HPP
#define CABANA_TEST_OPENMP_CATEGORY_HPP
#include <Kokkos_OpenMP.hpp>
#define TEST_EXECSPACE Kokkos::OpenMP
#define TEST_MEMSPACE Kokkos::OpenMP::memory_space
#endif // end CABANA_TEST_OPENMP_CATEGORY_HPP
#ifndef CABANA_TEST_SERIAL_CATEGORY_HPP
#define CABANA_TEST_SERIAL_CATEGORY_HPP
#include <Kokkos_Serial.hpp>
#define TEST_EXECSPACE Kokkos::Serial
#define TEST_MEMSPACE Kokkos::Serial::memory_space
#endif // end CABANA_TEST_SERIAL_CATEGORY_HPP
......@@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE( aosoa_serial_api_test )
>;
// Declare the AoSoA type.
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_EXECSPACE>;
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_MEMSPACE>;
// Make sure that it is actually an AoSoA.
BOOST_CHECK( Cabana::is_aosoa<AoSoA_t>::value );
......@@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE( aosoa_raw_data_test )
>;
// Declare the AoSoA type.
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_EXECSPACE>;
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_MEMSPACE>;
// Create an AoSoA using the default constructor.
std::size_t num_data = 350;
......
......@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE( slice_serial_api_test )
>;
// Declare the AoSoA type.
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_EXECSPACE>;
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_MEMSPACE>;
// Make sure that it is actually an AoSoA.
BOOST_CHECK( Cabana::is_aosoa<AoSoA_t>::value );
......
......@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE( parallel_for_test )
>;
// Declare the AoSoA type.
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_EXECSPACE>;
using AoSoA_t = Cabana::AoSoA<DataTypes,inner_array_size,TEST_MEMSPACE>;
// Create an AoSoA.
std::size_t num_data = 155;
......
......@@ -3,9 +3,14 @@
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <Kokkos_Core.hpp>
bool init_function() { return true; }
int main( int argc, char* argv[] )
{
return ::boost::unit_test::unit_test_main( &init_function, argc, argv );
Kokkos::initialize( argc, argv );
auto return_val = ::boost::unit_test::unit_test_main( &init_function, argc, argv );
Kokkos::finalize();
return return_val;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment