You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. While simulating the beam path using the tracing method, I noticed that the reflect function takes considerably more time to compute compared to the expose and propagate functions. I see that diffraction calculations are already parallelized using OpenCL, which is great for accelerating performance on the GPU.
This made me wonder: Could the reflect function also benefit from OpenCL parallelization? If so, I’d appreciate any thoughts or suggestions on how to implement OpenCL for the reflection calculation. Thank you for your guidance!
The text was updated successfully, but these errors were encountered:
Reflection/diffraction and intersection search have been implemented in OpenCL, but we intentionally use python-based procedures for most cases (except for computationally heavy diffraction in bent crystals, multi-reflect diffraction and multilayers) for three major reasons: 1) Intersection search requires custom OpenCL code for each optical element/surface shape, 2) OpenCL cannot be used with multithreading/multiprocessing, 3) numpy is usually fast enough.
If you want to play with OpenCL-based intersection search, you can uncomment the condition in _reflect_local
If it's really necessary to accelerate regular flat-crystal diffraction calculation, you can modify the conditions for reflect (option 0), basically changing the implementation from numpy to OpenCL
This might be tricky, so be sure to double-check your results.
If you think the performance gain is worth the effort, let me know.
Hi. While simulating the beam path using the tracing method, I noticed that the reflect function takes considerably more time to compute compared to the expose and propagate functions. I see that diffraction calculations are already parallelized using OpenCL, which is great for accelerating performance on the GPU.
This made me wonder: Could the reflect function also benefit from OpenCL parallelization? If so, I’d appreciate any thoughts or suggestions on how to implement OpenCL for the reflection calculation. Thank you for your guidance!
The text was updated successfully, but these errors were encountered: