oneapi-src / oneTBB

oneAPI Threading Building Blocks (oneTBB)
https://oneapi-src.github.io/oneTBB/
Apache License 2.0
5.57k stars 1.01k forks source link

oneTBB to schedule work execution on Intel GPUs #1304

Closed mabalenk closed 1 month ago

mabalenk commented 7 months ago

Dear all,

I'm learning oneTBB now. In the future I would like to use oneTBB as an easier interface to submit work for execution on Intel GPUs. Is it a good approach or is it better to embrace SYCL and leave oneTBB aside? My task at hand is to convert a shared-memory code instrumented with OpenMP pragmas to oneTBB and run most of the work in parallel_for loops on GPU. Think of it as an analog to OpenMP offloading work to GPUs. If possible, would you please point me to some oneTBB parallel_for examples schedulling work for execution on GPUs? So far, I have found these three examples: https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneTBB. But I cannot say I find it easy and straightforward to run code on GPUs. Thank you for your help!

dnmokhov commented 7 months ago

Hi @mabalenk,

oneTBB only provides CPU parallelism, so you would need to use SYCL or oneDPL (Getting Started, samples) for GPU offloading.

The examples you found above illustrate how more advanced oneTBB features (flow graph, task group, and resumable tasks) can be used to split and coordinate work between CPU (oneTBB parallel algorithms) and GPU (SYCL parallel kernels).

nofuturre commented 1 month ago

@mabalenk is this issue still relevant?

nofuturre commented 1 month ago

If anyone encounter this issue in the future please open new issue with a link to this one