Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- How to do a 2d Fourier tranformation stored in column-major?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Ye_C_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-28-2016
03:39 AM

10 Views

How to do a 2d Fourier tranformation stored in column-major?

I have read the MKL manual but I can hardly understand the explanation below:

MKL_LONG dims[] = { nd, …, n2, n1 }; DftiCreateDescriptor( &hand, precision, domain, d, dims ); // The above call assumes data declaration: type X[nd]…[n2][n1] // Default strides are { 0, nd*…*n2*n1, …, n2*n1, n1, 1 }

It is obvious that there are nd+2 elements in the strides configurations, i.e., for 2d data, the default strides are {0, n2*n1, n1, 1},

the first element 0 is the default value for s0, except which there are still 3 elements.

I don't know how to under the configuration of strides.

By now, I have a 2d data stored in column-major, how to set the strides for the column-major storage?

2 Replies

Highlighted
##

Ying_H_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-28-2016
11:01 PM

10 Views

Hi

It seems bring some confusion here. I will check internally.

but the key is how the x(k1, K2) are gotten.

The memory address of the

element X(k1, k2 , ..., kd) is expressed by the formula

address of X(k1, k2, ..., kd) = address of X(0, 0, ..., 0) + offset

= address of X(0, 0, ..., 0) + s0 + k1*s1 + k2*s2 + ...+ kd*sd,

where s0 is the displacement and s1, ..., sd are generalized strides.

So for 2d data, for column-major storage, X(k1,k2)= x(0,0)+K1*1 + K2* row-number, the strides looks be {0, 1, row-number}

You may refer to some sample coded under MKL install directory. for example, mkl_example\examples_core_c\dftc\source\config_placement.c to understand the stride and the compress format if real.

Regards

Ying

Highlighted
##

Ye_C_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-28-2016
11:47 PM

10 Views

Thanks！

I have guessed the solution.

Grateful for your clear answer!

Yours,

Ying H (Intel) wrote:

Hi

It seems bring some confusion here. I will check internally.

but the key is how the x(k1, K2) are gotten.

The memory address of the

element X(k1, k2 , ..., kd) is expressed by the formula

address of X(k1, k2, ..., kd) = address of X(0, 0, ..., 0) + offset

= address of X(0, 0, ..., 0) + s0 + k1*s1 + k2*s2 + ...+ kd*sd,

where s0 is the displacement and s1, ..., sd are generalized strides.So for 2d data, for column-major storage, X(k1,k2)= x(0,0)+K1*1 + K2* row-number, the strides looks be {0, 1, row-number}

You may refer to some sample coded under MKL install directory. for example, mkl_example\examples_core_c\dftc\source\config_placement.c to understand the stride and the compress format if real.

Regards

Ying

For more complete information about compiler optimizations, see our Optimization Notice.