Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Access violation when calling multiple trig transforms

John_R_4
Beginner
1,038 Views

When I call s_init_trig_transform

then make successive calls to the pair of functions

s_commit_trig_transform(work_space , & mkl_dct_handle, mkl_ipar, mkl_spar, & mkl_status );
s_forward_trig_transform(work_space , & mkl_dct_handle, mkl_ipar, mkl_spar, & mkl_status );

to do trig transforms on arrays in consecutive chunks of memory I get a memory access violation. How many transforms I do before this happens varies from one run to the next even with no change in the code, though it is roughly on the order of 70,000 (the number is possibly irrelevant of course, could just be something about situation in memory)

If instead I set up the trig transform afresh for every single transform I want to make and call free_trig_transform after each , I get no memory access violatation.

Note: When I posted this I stated that I did transforms on arrays in consecutive chunks of memory, but in actuality those arrays were copied to another location before calling the transform. This apparently happens even when I designate a single peice of memory on which every transformation is run (i.e. I copy to that memory, run the transformation, then copy the results out of it).

0 Kudos
7 Replies
Alexander_K_Intel2
1,038 Views
HI, In case when you call init once and commit several times did you modified ipar[7]? With best regards, Alexander Kalinkin
0 Kudos
John_R_4
Beginner
1,038 Views
No changes were made by me to any of ipar.
0 Kudos
Alexander_K_Intel2
1,038 Views
Hi, based on documentation you need to set ipar[7] to 0 before commit step. Could you try to implement it and in case nothing change send to me example of your code? With best regards, Alexander Kalinkin
0 Kudos
John_R_4
Beginner
1,038 Views
Well, it does look like changing it works. Here is what my documentation says. Thank you so much for your help, I would have had a hard time getting that out of this documentation, so I very much appreciate your clarification. ipar[7] Informs the ?_commit_trig_transform routines whether to initialize data structures dpar (spar) and handle. ipar[7]=0 indicates that the routine should skip the initialization and only check correctness and consistency of the parameters. Otherwise, the routine initializes the data structures. The default value is 1. The possibility to check correctness and consistency of input data without initializing data structures dpar, spar and handle enables avoiding performance losses in a repeated use of the same transform for different data vectors. Note that you can benefit from the opportunity that ipar[7] gives only if you are sure to have supplied proper tolerance value in the dpar or spar array. Otherwise, avoid tuning this parameter.
0 Kudos
Alexander_K_Intel2
1,038 Views
John, Feel free to ask any question about TT or any other MKL components. We like to talk over it. With best regards, Alexander Kalinkin
0 Kudos
John_R_4
Beginner
1,038 Views
Sure. Am I correct in believing that once I call ?_commit_trig_transform with a given data location, ipar, dpar and handle that I can load data into that data location, compute a transform, then copy the data back out and just keep on doing that without needing to call commit trig transform again as long as I don't change any of: 1. The type of the trig transform 2. The location of the data to be transformed 3. The size of the data to be transformed Is this correct?
0 Kudos
Alexander_K_Intel2
1,038 Views
Hi John, You are right, you can call forward-backward steps in loop call commit step once. With best regards, Alexander Kalinkin
0 Kudos
Reply