Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*

dpct not converting cudaStream_t m_streams[MAX_NUM_PATHS] properly

Shukla__Gagandeep
1,111 Views

Hi,

This is to report a conversion issue with DPCT.

I was converting path_aggregation.cu from libSGM.An include file path_aggregation.hpp creates a member cudaStream_t m_streams[MAX_NUM_PATHS];. DPCT converted it to sycl::queue m_streams[MAX_NUM_PATHS]; but this is causing compilation error :

path_aggregation.dp.cpp:31:18: error: no viable overloaded '='
    m_streams = dpct::get_current_device().create_queue();
    ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When I looked at dpct::get_current_device().create_queue(), it returns cl::sycl::queue *. So I modified the header file m_streams member definition to

sycl::queue *m_streams[MAX_NUM_PATHS];

And now it is compiling without error with dpcpp.

May be DPCT team needs to look at this conversion.

Regards,
Gagan

0 Kudos
6 Replies
RahulV_intel
Moderator
1,111 Views

Hi Gagan,

Thanks for reporting this bug.

dpct::create_queue() indeed returns a pointer to the queue. 

I will escalate this issue to the concerned team.

 

Regards,

Rahul

0 Kudos
Subarnarek_G_Intel
1,111 Views

Hi Gagan,

Thank you for trying DPCT. DPCT may require manual intervention sometimes. A feature can only be converted if we have an equivalent feature in DPCPP. I think the issue you reported can be added as a feature. Let me discuss the same with the development team.

 

Regards,

Subarna

0 Kudos
Shukla__Gagandeep
1,111 Views

Thanks for looking into the issue, Subama.

But I think the issue is that dpct is not able to detect data type properly and is incorrectly generating an array when whats required is array of pointers. At other places like in case of function parameters, dpct was successfully able to convert 'cudaStream_t' type to 'sycl::queue *'. But at the point of variable declaration it converted 'cudaStream_t' to 'sycl::queue'. If equivalent code for 'cudaStream_t' is 'sycl::queue *' at other places why is it 'sycl::queue' at this one point.

It's inconsistent behaviour. But if it involves complexity, it can be left for manual intervention.

And a small question: During your own testing, you must have come across where dpct is not generating proper code and dpct team decided to leave such conversions to manual intervention. Can dpct team publish such list where they point out common issues and how they can be corrected manually? It could be helpful as people can look at this list before resolving such issues on their own. It's just a suggestion.

Regards,
Gagan

 

0 Kudos
PrasanthD_intel
Moderator
888 Views

Hi Gagandeep,


Thanks for your patience. The issue raised by you has been fixed in the latest OneAPI version 2021.2. Please download and let us know your experience with it.


0 Kudos
PrasanthD_intel
Moderator
868 Views

Hi Gagandeep,


We haven't heard back from you. Please let us know your feedback after testing the latest version.


Regards

Prasanth


0 Kudos
PrasanthD_intel
Moderator
854 Views

Hi,


We are closing this thread as the issue has been resolved in the latest version.

We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only


Regards

Prasanth


0 Kudos
Reply