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*
718 Discussions

Unable to work with 4 Dimensional data for batch2d program in dpc++

Pranathi_R
Beginner
1,217 Views

Hello team, 

 

I was trying to run my codes parallelly using dpcpp, but I am facing some issues, my input data is 4 dimension but while using buffer it is not accepting 4D data and throwing following error,  static_assert failed due to requirement '4 >= 1 && 4 <= 3' "range can only be 1, 2, or 3 dimensional." . So, Do you have any alternative to work on 4D data.

 

 

Thank you,
Pranathi R


0 Kudos
4 Replies
NoorjahanSk_Intel
Moderator
1,168 Views

Hi,


Thanks for reaching out to us.


Could you please provide us with a sample reproducer and compiler version?

Also, please provide the OS details so that we can try it from our end.


Thanks & Regards,

Noorjahan.


0 Kudos
Ethan_F_Intel
Moderator
1,087 Views

There are a number of ways one can process 4 dimensional data even despite buffers being limited to three dimensions.

It all is a matter of understanding what you are trying to do, and designing an algorithm which achieves this.

 

For example, you could store all your data in a 1 dimensional array, but index it in a way to simulate four dimensions.

More details on that here: 4d-position-from-1d-index 

 

Another way is to store the data in a 1D list of 4D tuples.

I have provided an example of this using DPC++ in the attached file.

0 Kudos
Ethan_F_Intel
Moderator
1,047 Views

Has your issue been resolved? If I don't hear from you within 5 business days, I will assume your support request is resolved. 

0 Kudos
Ethan_F_Intel
Moderator
1,031 Views

After case closure, you will receive a survey email. We appreciate it if you can complete this survey regarding the support you received. 

0 Kudos
Reply