mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-02 22:14:56 -04:00
Squashed 'boost/' content from commit b4feb19f2
git-subtree-dir: boost git-subtree-split: b4feb19f287ee92d87a9624b5d36b7cf46aeadeb
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Copyright 2010-2014 Mario Mulansky
|
||||
# Copyright 2010-2012 Karsten Ahnert
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or
|
||||
# copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# make sure BOOST_ROOT is pointing to your boost directory
|
||||
# otherwise, set it here:
|
||||
# BOOST_ROOT = /path/to/boost
|
||||
|
||||
# path to the cuda installation
|
||||
CUDA_ROOT = /usr/local/cuda
|
||||
# target architecture
|
||||
ARCH = sm_13
|
||||
|
||||
NVCC = $(CUDA_ROOT)/bin/nvcc
|
||||
|
||||
INCLUDES += -I../../include/ -I$(BOOST_ROOT)
|
||||
|
||||
NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH)
|
||||
|
||||
%.o : %.cu
|
||||
$(NVCC) $(NVCCFLAGS) -c $< -o $@
|
||||
|
||||
% : %.o
|
||||
$(NVCC) $(NVCCFLAGS) -o $@ $<
|
||||
|
||||
|
||||
all : check_thrust
|
||||
|
||||
|
||||
clean :
|
||||
-rm *~ *.o check_thrust
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Boost check_thrust.cu test file
|
||||
|
||||
Copyright 2010-2013 Mario Mulansky
|
||||
Copyright 2010-2011 Karsten Ahnert
|
||||
|
||||
This file tests the use of the euler stepper
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
//#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/numeric/odeint/stepper/euler.hpp>
|
||||
#include <boost/numeric/odeint/external/thrust/thrust.hpp>
|
||||
|
||||
#include <thrust/device_vector.h>
|
||||
#include <thrust/fill.h>
|
||||
|
||||
using namespace boost::numeric::odeint;
|
||||
|
||||
typedef float base_type;
|
||||
// typedef thrust::device_vector< base_type > state_type;
|
||||
typedef thrust::host_vector< base_type > state_type;
|
||||
|
||||
void constant_system( const state_type &x , state_type &dxdt , base_type t )
|
||||
{
|
||||
thrust::fill( dxdt.begin() , dxdt.end() , static_cast<base_type>(1.0) );
|
||||
}
|
||||
|
||||
const base_type eps = 1.0e-7;
|
||||
|
||||
|
||||
template< class Stepper , class System >
|
||||
void check_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x )
|
||||
{
|
||||
typedef Stepper stepper_type;
|
||||
typedef typename stepper_type::state_type container_type;
|
||||
typedef typename stepper_type::order_type order_type;
|
||||
typedef typename stepper_type::time_type time_type;
|
||||
|
||||
stepper.do_step( system , x , 0.0 , 0.1 );
|
||||
base_type xval = *boost::begin( x );
|
||||
if( fabs( xval - 0.1 ) < eps )
|
||||
std::clog << "TEST PASSED" << std::endl;
|
||||
else
|
||||
std::clog << "TEST FAILED" << std::endl;
|
||||
}
|
||||
|
||||
void test_euler_with_thrust( void )
|
||||
{
|
||||
state_type x(1);
|
||||
thrust::fill( x.begin() , x.end() , static_cast<base_type>(0.0) );
|
||||
euler< state_type , base_type , state_type , base_type > euler;
|
||||
check_stepper_concept( euler , constant_system , x );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
test_suite *test = BOOST_TEST_SUITE("check stepper with thrust");
|
||||
|
||||
test->add( BOOST_TEST_CASE( &test_euler_with_thrust ) );
|
||||
|
||||
return test;
|
||||
}*/
|
||||
|
||||
int main() {
|
||||
test_euler_with_thrust();
|
||||
}
|
||||
Reference in New Issue
Block a user