- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made a code that looked a sample code.
The small size(100X40) was worked. but The big size(2560X3072) was not worked.
Are there bugs in a code?
Here are sample code that I edited.
void BoolLib::Run4()//
{
int Level_limit =5;
int i,j;
_complex** x;
float** y;
y = new float* [3074];
for(i=0; i<3074; i++) y = new float[2562];
x = new _complex* [3072];
for(i=0; i<3072; i++) x = new _complex[2560];
int Height_f = 3072;
int Widtht_f = 2560;
DFTI_DESCRIPTOR_HANDLE my_desc1_handle;
DFTI_DESCRIPTOR_HANDLE my_desc2_handle;
MKL_LONG status;
MKL_LONG l[2];
l[0] = Height_f, l[1] = Widtht_f;
for(i=0; i
{
for(j=0; j
{
x
x
}
}
for(i=0; i<(Height_f+2); i++)
{
for(j=0; j<(Widtht_f+2); j++)
{
y
}
}
for(i=0; i
{
for(j=0; j
{
if((j%10) == 0)
{
x
}
}
}
float src;
////////////////////////////////////////////////////////////////////////////////////////
status = DftiCreateDescriptor( &my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Height_f);
status = DftiCreateDescriptor( &my_desc2_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Widtht_f);
l[0] = 0, l[1] = Widtht_f;
status = DftiSetValue(my_desc1_handle, DFTI_NUMBER_OF_TRANSFORMS, Widtht_f);
status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, 1);
status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, 1);
status = DftiSetValue(my_desc1_handle, DFTI_INPUT_STRIDES, l);
status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_STRIDES, l);
status = DftiCommitDescriptor( my_desc1_handle);
status = DftiComputeForward( my_desc1_handle, x);
//////////////////////////////////////////////////////////////////////////////////
l[0] = 0, l[1] = Height_f;
status = DftiSetValue(my_desc2_handle, DFTI_NUMBER_OF_TRANSFORMS, Height_f);
status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, Widtht_f);
status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, Widtht_f);
status = DftiCommitDescriptor( my_desc2_handle);
status = DftiComputeForward( my_desc2_handle, x);
status = DftiFreeDescriptor( &my_desc1_handle);
status = DftiFreeDescriptor( &my_desc2_handle);
delete [] x;
delete [] y;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi siinii,
You probably did the small size on a static array, defined as x[100][40]. The way the dynamic array is arranged in your exampleis incorrect and it demonstrates typical mistake. For static array '_complex x
I'd suggest you to refrain from the practice of using double-subscript notation for dynamic arrays, and adoptthe following usage instead:
const int ROWS=3072, COLS=2560;
const int ROWSIZE=COLS, COLSIZE=ROWS;
_complex *x = new _complex[ROWS*COLS];
#define x(r,c) x[*ROWSIZE+(c)] /* explicit row-major indexing */
memset(x,0,sizeof(x[0])*ROWS*COLS); /* zero fill initialization */
for (r=0;r
The rest of this reply is duplicating your example in the above terms.
DftiCreateDescriptor(rowfft,DFTI_SINGLE,DFTI_COMPLEX,1,ROWSIZE); /* stride 1 by default */
DftiSetValue(rowfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)ROWS);
DftiSetValue(rowfft,DFTI_INPUT_DISTANCE,(MKL_LONG)ROWSIZE);
DftiSetValue(rowfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)ROWSIZE);
DftiCreateDescriptor(colfft,DFTI_SINGLE,DFTI_COMPLEX,1,COLSIZE); /* will setstrides */
MKL_LONG colfft_strides[] = { 0,ROWSIZE };
DftiSetValue(colfft,DFTI_INPUT_STRIDES,colfft_strides);
DftiSetValue(colfft,DFTI_OUTPUT_STRIDES,colfft_strides);
DftiSetValue(colfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)COLS);
DftiSetValue(colfft,DFTI_INPUT_DISTANCE,(MKL_LONG)1);
DftiSetValue(colfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)1);
...
DftiComputeForward(rowfft,x);
DftiComputeForward(colfft,x);
Thanks
Dima
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page