I'm trying to speed up my C++ Monte Carlo simulation but I am a bit puzzled. My outer-loop is over the number of paths and my idea was to vectorize it (adding #pragma simd
?). However, I've read the following:
- The moral of this question was to initialize the random number generator outside the loop.
- Many documents only praise how vectorization can improve significantly when paths are vectorized.
How can these two facts coexist in a low memory environment? (ie. without generating and storing all the random numbers before the loop)