Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
118 Views

dpct not converting cudaStream_t m_streams[MAX_NUM_PATHS] properly

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

Tags (1)
0 Kudos
3 Replies
Highlighted
Moderator
118 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
Highlighted
118 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
Highlighted
118 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