DCC-Lab / PyTissueOptics

A very simple, fairly slow but very easy to understand and very easy to use Monte Carlo code for Tissue optics simulations.
MIT License
27 stars 5 forks source link

CLObject bug: identical seeds don't give same random values #115

Open dccote opened 3 months ago

dccote commented 3 months ago

Describe the bug The test kernel in random.c does not work when CLObject is used, but does work in testGeneralOpenCL.py when the basic PyOpenCL structures are used. There may be an error in CLObject.

To Reproduce From the root directory, the test test_call_random_value_with_same_seeds_buffer_should_give_same_results for fillRandomFloatBuffer will fail: python3 -m unittest pytissueoptics/rayscattering/tests/opencl/src/testCLProgram.py

but will succeed when using basic PyOpenCL structures (same test name: test_call_random_value_with_same_seeds_buffer_should_give_same_results): python3 -m unittest pytissueoptics/rayscattering/tests/opencl/src/testGeneralOpenCL.py

Expected behavior Using the same seeds twice should give the same random values, as demonstrated with the second successful tests