32 #ifndef VSMC_SMP_BACKEND_CILK_HPP
33 #define VSMC_SMP_BACKEND_CILK_HPP
36 #include <cilk/cilk.h>
37 #include <cilk/cilk_api.h>
38 #include <cilk/reducer_opadd.h>
55 template <
typename IntType>
56 void copy (size_type N,
const IntType *copy_from)
60 cilk_for (size_type to = 0; to != N; ++to)
61 this->copy_particle(copy_from[to], to);
67 template <
typename T,
typename Derived>
68 class InitializeCILK :
public InitializeBase<T, Derived>
75 const size_type N =
static_cast<size_type
>(particle.
size());
78 cilk::reducer_opadd<std::size_t> accept;
79 cilk_for (size_type i = 0; i != N; ++i)
83 return accept.get_value();
93 template <
typename T,
typename Derived>
101 const size_type N =
static_cast<size_type
>(particle.
size());
103 cilk::reducer_opadd<std::size_t> accept;
104 cilk_for (size_type i = 0; i != N; ++i)
108 return accept.get_value();
118 template <
typename T,
typename Derived>
127 const size_type N =
static_cast<size_type
>(particle.
size());
129 cilk_for (size_type i = 0; i != N; ++i) {
143 template <
typename T,
typename Derived>
152 const size_type N =
static_cast<size_type
>(particle.
size());
154 cilk_for (size_type i = 0; i != N; ++i) {
170 #endif // VSMC_SMP_BACKEND_CILK_HPP
Particle::value_type subtype using Intel Cilk Plus.
Particle class representing the whole particle set.
void initialize_param(Particle< T > &particle, void *param)
traits::SizeTypeTrait< BaseState >::type size_type
#define VSMC_RUNTIME_ASSERT_SMP_BACKEND_BASE_COPY_SIZE_MISMATCH(name)
void pre_processor(Particle< T > &particle)
std::size_t operator()(std::size_t iter, Particle< T > &particle)
Monitor evalution base dispatch class.
void post_processor(std::size_t iter, const Particle< T > &particle)
void copy(size_type N, const IntType *copy_from)
double path_grid(std::size_t iter, const Particle< T > &particle)
void post_processor(std::size_t iter, Particle< T > &particle)
std::size_t move_state(std::size_t iter, SingleParticle< T > sp)
std::size_t operator()(Particle< T > &particle, void *param)
void pre_processor(std::size_t iter, Particle< T > &particle)
void monitor_state(std::size_t iter, std::size_t dim, ConstSingleParticle< T > csp, double *res)
void post_processor(std::size_t iter, const Particle< T > &particle)
std::size_t initialize_state(SingleParticle< T > sp)
void pre_processor(std::size_t iter, const Particle< T > &particle)
Path::eval_type subtype using Intel Cilk Plus.
Move base dispatch class.
traits::SizeTypeTrait< T >::type size_type
internal::SizeTypeDispatch< T, value >::type type
Sampler::move_type subtype using Intel Cilk Plus.
double path_state(std::size_t iter, ConstSingleParticle< T > csp)
void post_processor(Particle< T > &particle)
Path evalution base dispatch class.
size_type size() const
Number of particles.
A thin wrapper over a complete Particle.
Monitor::eval_type subtype using Intel Cilk Plus.
double operator()(std::size_t iter, const Particle< T > &particle, double *res)
void pre_processor(std::size_t iter, const Particle< T > &particle)
void operator()(std::size_t iter, std::size_t dim, const Particle< T > &particle, double *res)
#define VSMC_DEFINE_SMP_FORWARD(Name)
A const variant to SingleParticle.
#define VSMC_DEFINE_SMP_IMPL_COPY(Impl, Name)