Max size for efficient vectorization?
显示 更早的评论
As far as I understand, vectorization can highly optimize code, because of its parallelization properties.
As you have for example n separate samples to treat, a classical for loop would imply that the computational time grows linealy:
.
By vectorizing, t remains virtually constant as function of n, as all n samples fit together in the shift register of the CPU.
However, this only works as long as
for some
that determines the maximum amount of floats to enter the register simultaneously. For
, computation will be sequential and thus with a linearly growing time again.
My question is: is there a simple way to find this
?
In addition: am I correct that the advantage of using gpuArray is that these can have larger
, while c is also larger? Are there similar commands to retrieve these parameters of the GPU?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!