How to create a sequence of numbers on the GPU
조회 수: 4 (최근 30일)
이전 댓글 표시
I want to do the follow in a new GPU Array, efficiently:
myarray = 1:100000
gpuArray(1:100000) works of course, but if I'm not wrong it's creating the large array in main memory then moving the whole thing to the GPU. I would expect that I can create the sequence of numbers on the GPU directly more efficiently, as I can do with many random numbers.
댓글 수: 0
채택된 답변
Edric Ellis
2016년 1월 21일
The direct equivalent is to use gpuArray.colon, like so:
myarray = gpuArray.colon(1,100000);
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 GPU Computing in MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!