Max size for efficient vectorization?
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!