Computer Graphics Asked by wduk on August 27, 2021
I am creating a fast fourier transform algorithm for the compute shader – i am no expert on how GPUs really run optimally so thought i would ask here.
I have the option to calculate on the fly or precompute a lot of the trig function (cos and sin) values and store it in a read only float buffer.
My question is, though i am aware cos() and sin() is fast, how do they compare to simply getting the value precomputed in a buffer instead?
I don’t mean a LUT here i do not need to interpolate between values from the buffer so i just get them values directly. I don’t know how to really bench test shaders properly so i am unsure which is faster.
Perhaps some one knows more info on this?
My question is, though i am aware cos() and sin() is fast, how do they compare to simply getting the value precomputed in a buffer instead?
This will depend on your shader code and GPU model.
If your shader code allows for latency hiding, it may be faster.
The best option here is to profile the shader performance.
I don't know how to really bench test shaders properly so i am unsure which is faster.
I think the easiest way would be to download RenderDoc and get a frame capture of your application.
After that, you click on the timing icon (shown red) to get some measurements.
Although these are not super accurate measurements, they're good enough and sort of representative of the application performance.
For precise measurements, you'll need your GPU vendor's graphics profiling tools.
Update: Below are some captures from RGP, showing GPU assembly instructions and instruction timings of various instruction types. You can see latency hiding in action below:
vmem
: texture readsmem
: constant buffer / descriptor<texture/buffer> readALU
: math ops (arithmetic / logic)sync
: waits for vmem/smem instructions to finish loading data from memoryAnother capture showing instruction timings while first two texture loads not having latency hiding.
Correct answer by Varaquilex on August 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP