Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Any way to do array reduction ?

baranovsky
Principiante
2.004 Visualizações

Single variable reduction seems to be possible with sycl::reduction interface.

According to "SYCL 2020 Specification (revision 4)", array reduction will be achieved via reduction interface with std::span, which does not exist in current oneAPI release.

template <typename T, typename Extent, typename BinaryOperation>
__unspecified__ reduction(span<T, Extent> vars, const T& identity, BinaryOperation combiner, const property_list &propList = {});

Is there any way to do array reduction at this point?

Thank you in advance for your help!

0 Kudos
1 Solução
NoorjahanSk_Intel
Moderador
1.951 Visualizações

Hi,

Thanks for reaching out to us.

Yes, you are correct array reduction will be achieved via reduction interface with std::span, and is not supported in current oneAPI release. We will discuss with the Developer team and come back with an update soon.

 

Thanks & Regards,

Noorjahan

 

Ver solução na publicação original

5 Respostas
NoorjahanSk_Intel
Moderador
1.952 Visualizações

Hi,

Thanks for reaching out to us.

Yes, you are correct array reduction will be achieved via reduction interface with std::span, and is not supported in current oneAPI release. We will discuss with the Developer team and come back with an update soon.

 

Thanks & Regards,

Noorjahan

 

cw_intel
Moderador
1.924 Visualizações

Hi,


DPC++ supports built-in reduction operations, for more information, please refer to this guide https://www.intel.com/content/www/us/en/develop/documentation/oneapi-gpu-optimization-guide/top/kernels/reduction.html


Thanks


baranovsky
Principiante
1.901 Visualizações

Thank you everyone!
I'm going to implement array reduction by using the built-in reduction operation multiple time.
I will move to the std::span interface, once it is supported!

cw_intel
Moderador
1.884 Visualizações

Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


baranovsky
Principiante
1.819 Visualizações

I found that ruduction of sycl::float2/3/4/8/16 and sycl::double2/3/4/8/16 does the trick for me.

 

I hope arbitrary-size array reduction will be supported soon!

 

Responder