 # 3D and 4D indexing & 4D FFT

I think I have asked this before, but here it goes again.

What is the best way to setup the dimensions of the grid and the block for 3D indexing? Is there any example in the SDK?

How about 4D indexing and higher?

If I want to perform a 4D FFT, how do I do that in the simplest way with CUDA?

1. how to do indexing in 3D data?

you can look at following link,

http://forums.nvidia.com/index.php?showtop…rt=#entry591025

the same idea can be extended into 4-D data indexing

1. how to do 4-D FFT?

I suggest that you can try a simple solution, do 1-D FFT in batch mode along each dimension

suppose 4-D data A(1:n1, 1:n2, 1:n3, 1:n3)

step 1: do 1-D FFT along x4 with number of element n4 and batch=n1n2n3

step 2: do tranpose operation A(i,j,k,l) --> A(j,k,l,i)

step 3: do 1-D FFT along x1 with number of element n1 and batch=n2n3n4

step 4: do tranpose operation A(j,k,l,i) --> A(k,l,i,j)

step 5: do 1-D FFT along x2 with number of element n2 and batch=n3n4n1

step 6: do tranpose operation A(k,l,i,j) --> A(l,i,j,k)

step 7: do 1-D FFT along x3 with number of element n3 and batch=n4n1n2

step 7: do tranpose operation A(l,i,j,k) --> A(i,j,k,l)

this approach would require (1) 4-D data indexing and (2) tranpose operation

you can look at folloing link for “transpose operation”

http://forums.nvidia.com/index.php?showtop…rt=#entry592569