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!