Reorganizing current data structure in order to take advantage of GPU

4 ビュー (過去 30 日間)
Science Machine
Science Machine 2022 年 4 月 15 日
回答済み: Joss Knight 2022 年 4 月 15 日
I currently have nested structures like
myStructreadIn(var1).NestedLevel1(var2)NestedLevel2(var3).dat(vector); Step (1)
I would like to use Matlab's gpu parallization support, and for that I know data must be optimally structured. Also, I know that gpu use doesn't always make sense, and that CPU parallelization is often better. In my case, I am taking a bunch of fft's and I understand from reading that GPU 'could' be a good way to go, by making gpuArrays and take fft's columnwise.
I also know that nested structures are not good for gpu. Is there a way I can reorganize this nested strucuture, eg
  • Is it gpu-paradigmatic to organize this nested structure data instead in a really large matrix, in order to vectorize it?
  • I also take xcorr of data after re-shuffling the nested levels, in order to get the correct (x-dir, y-dir, z-dir), then take fft in another direction
Thanks

採用された回答

Joss Knight
Joss Knight 2022 年 4 月 15 日
Evidently with your nested structure you are not required to have uniform data - every element at each level can have a different size of sub-level, whereas if you reorganise as an array everything has to be the same. But yes, if you can reasonably rearrange your data structure as a multi-dimensional array you will gain an advantage on the GPU (and on CPU).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by