Comments (7)
Thanks for the report and the links. I'll try to find some time to take a look and update the code.
from compute.
Well. After digging deeper, I found that the implementation there is not the best solution. The "official" one http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MTGP/index.html should be used instead.
from compute.
Interesting. We should be able to integrate their algorithm (though perhaps as another engine, mtgp_engine
).
from compute.
I'm also very interested in this. On my machine (12 CPU cores + GTX 680) 10MB of uniform_real_distribution with mersenne_twister_engine takes about 1.6 seconds to generate, which is better than for @etam, but still very slow. I'm wondering if the fact that the mersenne_twister_engine code creates a second temporary vector and does two transforms instead of composing the scaling kernel could have something to do with it. Is it even possible to compose kernels with boost::compute?
Also, I was wondering what were the developers' thoughts on adding more engines. Doing a search on GPU random number generations I stumbled on a few including https://github.com/clMathLibraries/clRNG and http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-uniform.html. The MWC64X one is of particular interest for me as I don't need an extremely long period but performance is much more important. Licenses are BSD.
from compute.
I'd recommend improving current Philox implementation. Right now in Boost.Compute it's designed badly and has poor performance, It can be improved to achieve 200 - 350 GB/s (50 - 90 GSamples/s) on modern top GPUs (depending on GPU and it's architecture). It's really simple RNG. You can also implement XORWOW, which should achieve similar or higher performance.
from compute.
There's a Philox implementation? I only see a ThreeFry and a linear congruential along with the MT engine. Also the ThreeFry is not in the API overview and doesn't compile when used in conjunction with uniform_real_distribution since its generate() method doesn't take an scaling kernel.
from compute.
Oh, sorry, my mistake, indeed it's ThreeFry. Nonetheless, it's fast. I think that adding Philox to Boost.Compute is the best option to have fast random number generator, and should not be so hard. Unfortunately, recently I don't have enough free time to do it.
from compute.
Related Issues (20)
- Build program failure when use default_random_engine. HOT 1
- Can we use iterator in valarray?
- how about android devices HOT 2
- how to fill array of custom user structures ?
- how to reduce "array of custom user structures" with custom function ?
- vectorized lower_bound HOT 2
- Adding nullptr to std::string HOT 1
- Cannot run example on README.md: what(): Out of Host Memory HOT 1
- How can I return a custom struct from a BOOST_COMPUTE_FUNCTION
- BOOST_COMPUTE_CLOSURE triggers run-time compiling every time the closure value changes
- Unwanted function call for std::map::operator[] HOT 1
- g++ appears to resolve OpenCL/cl.h header but clang does not.
- How to convert a cv::UMat to cv::Mat?
- Minimum Boost Version
- Cmake error on android
- transform_reduce on M1 Pro
- Please do not set CMAKE_MODULE_PATH.
- Why does the transform(...) method work only on vectors with values of type <float> ?
- Get rid of `BOOST_COMPUTE_ADAPT_STRUCT` integrating boost::pfr HOT 1
- Modular Boost C++ Libraries Request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compute.