Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

Notify progress from parallel_for

leonardo_forum
New Contributor I
741 Views

Hello,

I would like to know if there is a way to report to the console the current progress (ex. a progress variable that's calculated inside the parallel_for) before that the whole parallel_for end.

I already tried the sycl::stream class but is printing everything togheter only when the whole computation is ended.

Thank you

0 Kudos
7 Replies
SantoshY_Intel
Moderator
705 Views

Hi,

 

Thank you for posting in Intel Communities.

 

>>" if there is a way to report to the console the current progress before that the whole parallel_for end."

Unfortunately, there is no way to report the progress until the kernel finishes execution.

 

You can use sycl::stream to print the values inside a kernel which will display after the execution of the kernel.

 

>>"I already tried the sycl::stream class but is printing everything together only when the whole computation is ended."

When strings are streamed to the object within a kernel, the contents are stored on an internal cl_mem object until the kernel finishes execution. The output is then passed to stdout when the stream object is destroyed by the runtime. Note that there is no guarantee on when the output will be displayed on stdout, only that it will be printed when the command group is executed.

 

Thanks & Regards,

Santosh

 

 

 

0 Kudos
leonardo_forum
New Contributor I
698 Views

At this point the only way to have a kind of progress indication that I can think of is to use  get_wait_list() and wait for every element of the computation to increase a counter. Do you think this can works?

 

Thank you

0 Kudos
SantoshY_Intel
Moderator
681 Views

Hi,

 

>>"Do you think this can work?"

No, cl::sycl::event::get_wait_list() will return the list of events that this event waits for. Only direct dependencies are returned. Already completed events are not included in the returned vector.

 

Thanks & Regards,

Santosh

 

 

 

 

0 Kudos
leonardo_forum
New Contributor I
669 Views

This is a pity and a big limitation.

With CUDA we can use a printf from the kernel and is executed almost immediately.

0 Kudos
SantoshY_Intel
Moderator
636 Views

Hi,


We can use gdb-oneapi debugger to debug the kernel code during its execution.


For more details please refer to the below link:

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-debugging-dpcpp-linux/top.html


Thanks & Regards,

Santosh


0 Kudos
SantoshY_Intel
Moderator
597 Views

Hi,


We haven't heard back from you. Is the solution provided helped? Please get back to us if you face any issues.


Thanks & Regards,

Santosh


0 Kudos
SantoshY_Intel
Moderator
573 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Santosh


0 Kudos
Reply