Arrayfun GPU in "Game of Life" works slower than CPU

2 ビュー (過去 30 日間)
Uladzislau
Uladzislau 2020 年 3 月 18 日
編集済み: Joss Knight 2020 年 3 月 28 日
Hello! I've run the demo "paralleldemo_gpu_stencil" and have such a result:
CPU: 2.815ms per generation.
Simple GPU: 2.650ms per generation (1.1x faster).
Arrayfun GPU: 13.253ms per generation (0.2x faster).
I've used ThinkPad P50 with Quadro M1000M and Matlab R2019b with appropriate drivers. Why Arrayfun works such slow ??
Uladzislau.

採用された回答

Joss Knight
Joss Knight 2020 年 3 月 28 日
編集済み: Joss Knight 2020 年 3 月 28 日
Check out this Answer. The arrayfun version is rather dependent on good memory performance since the kernel is accessing global GPU memory in a non-coalesced way (multiple threads accessing overlapping regions of memory that aren't contiguous). For your chip, the version that runs multiple kernels on multiple shifted copies of the grid is actually more efficient, despite the kernel launch overhead and the extra memory allocation needed.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Computing in MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by