Loading...
Searching...
No Matches
Parallel.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_PARALLEL_HPP
12#define CUBBYFLOW_PARALLEL_HPP
13
14#include <iterator>
15
16namespace CubbyFlow
17{
20{
21 Serial,
23};
24
40template <typename RandomIterator, typename T>
41void ParallelFill(const RandomIterator& begin, const RandomIterator& end,
42 const T& value,
44
60template <typename IndexType, typename Function>
62 const Function& function,
64
82template <typename IndexType, typename Function>
84 const Function& function,
86
105template <typename IndexType, typename Function>
108 const Function& function,
110
130template <typename IndexType, typename Function>
133 const Function& function,
135
156template <typename IndexType, typename Function>
160 const Function& function,
162
184template <typename IndexType, typename Function>
188 const Function& function,
190
208template <typename IndexType, typename Value, typename Function,
209 typename Reduce>
211 const Value& identity, const Function& function,
212 const Reduce& reduce,
214
226#ifdef __CUDACC__
227template <typename RandomIterator>
228#else
229template <std::random_access_iterator RandomIterator>
230#endif
233
249#ifdef __CUDACC__
250template <typename RandomIterator, typename CompareFunction>
251#else
252template <std::random_access_iterator RandomIterator, typename CompareFunction>
253#endif
257
260
263} // namespace CubbyFlow
264
266
267#endif
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:22
void ParallelSort(RandomIterator begin, RandomIterator end, ExecutionPolicy policy)
Sorts a container in parallel.
Definition Parallel-Impl.hpp:527
void ParallelFill(const RandomIterator &begin, const RandomIterator &end, const T &value, ExecutionPolicy policy)
Fills from begin to end with value in parallel.
Definition Parallel-Impl.hpp:182
void SetMaxNumberOfThreads(unsigned int numThreads)
Sets maximum number of threads to use.
void ParallelFor(IndexType beginIndex, IndexType endIndex, const Function &function, ExecutionPolicy policy)
Makes a for-loop from beginIndex to endIndex in parallel.
Definition Parallel-Impl.hpp:203
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:719
unsigned int GetMaxNumberOfThreads()
Returns maximum number of threads to use.
void ParallelRangeFor(IndexType beginIndex, IndexType endIndex, const Function &function, ExecutionPolicy policy)
Makes a range-loop from beginIndex to endIndex in parallel.
Definition Parallel-Impl.hpp:298
Value ParallelReduce(IndexType beginIndex, IndexType endIndex, const Value &identity, const Function &function, const Reduce &reduce, ExecutionPolicy policy)
Performs reduce operation in parallel.
Definition Parallel-Impl.hpp:431
ExecutionPolicy
Execution policy tag.
Definition Parallel.hpp:20