permute in GPU

7 次查看(过去 30 天)
Rodrigo
Rodrigo 2011-8-25
I am trying to do a 3D fft on some data using the built in GPU toolbox of 2011a and am having some trouble. Since the fftn function doesn't exist I find myself needing to do fft2 followed by fft. However, since "permute" doesn't seem to exist for GPU arrays either, I have to reshape the [l m n] matrix into a [l*m n] matrix, transposing it, applying fft, transposing back and reshaping back. Is there a more elegant/less asinine way of doing this?

采纳的回答

Jan
Jan 2011-8-25
RESHAPE is very efficient, because it does not touch the data, but only the vector of dimensions. Therefore the computational costs of your procedure are optimal already, if the TRANSPOSE is programmed efficiently. A PERMUTE cannot be faster.
I'd expect, that süpecifying the dimension to operate on is helpful here: "fft(X,[],dim)". But I don't know, if this works with the GPU toolbox.

更多回答(2 个)

Walter Roberson
Walter Roberson 2011-8-25
I seem to recall John saying that Jacket supports fftn(); if you are doing heavy GPU work, you may wish to investigate Accelereyes Jacket .

Rodrigo
Rodrigo 2011-8-29
The reshape command works very fast. The .' operation needed to shift the dimensions not so much. The routine spends about 20% of it's time doing that, but it's still much faster than the CPU version.
If my department has a site license for Jacket I'll give it a shot. Otherwise I don't want to spend the extra money for such a simple operation.

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by