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

can I call vslConvCopyTask asynchronously

SNena1
New Contributor I
572 Views

Hi

 

I'm trying to parallelize convolution/correlation, so I wonder if can I asynchonously call vslConvCopyTask in another thread while main thread executes a convolution/correlation operation ? Thanks.

 

0 Kudos
3 Replies
Fengrui
Moderator
480 Views

Did you give it a try? It sounds do-able if the main thread doesn't edit the task. Is the time spent on vslConvCopyTask comparable to the time on execution in you case?

0 Kudos
SNena1
New Contributor I
473 Views

I need guarantees it is an allowed and safe operation in a multithreaded environment (using single threaded mkl).

Even if I try and it works, it doesn't mean it won't break in production.  ATM. I'm creating new plan with same arguments for each new thread.

0 Kudos
Fengrui
Moderator
417 Views

The guaranteed safe way of copying the task from the main thread and doing the subsequent execution is to wait for all the threads to finish the copy operation first.

Thread0 -- create task0 --- wait all threads to copy --- execute task0

Thread1 --------------------- copy task 0 to task1 ----- execute task1

Thread2 --------------------- copy task 0 to task2 ----- execute task2

0 Kudos
Reply