How to convert this vectorized code into GPU code for MAXIMUM speedup ?
이전 댓글 표시

댓글 수: 1
Jan
2017년 4월 26일
Please post code as text and not as a screenshot. Then it can be used by copy&paste to create an answer.
답변 (2개)
Joss Knight
2017년 4월 18일
I was able to get a marginal speedup with additional vectorization of the mask:
x = sum(I < cat(3, 120, 155, 160), 3) == true;
but otherwise you've done pretty well. You've got to wonder why you need to replicate the output on every channel however. Why not discard the colour channels if you're using grayscale?
댓글 수: 2
Tanmay Virnodkar
2017년 4월 20일
편집: Tanmay Virnodkar
2017년 4월 20일
Joss Knight
2017년 4월 26일
Right, but then you're including the cost of replicating data in GPU memory and doing indexing, which is memory-bound and doesn't necessarily show the GPU in a great light.
Jan
2017년 4월 18일
0 개 추천
The bottlenecks of the code are the darn clear all and the disk access using imwrite. Moving this to the GPU will not help.
카테고리
도움말 센터 및 File Exchange에서 GPU Computing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!