Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ManuelCostanzo22
Beginner
208 Views

Intel oneAPI DPCT can't convert from CUDA 1-Channel texture to DPCT 4-Channel image_wrapper

Hi everyone !!

I have the following problem:

I have a CUDA code that uses texture, for example:

 

 

texture<unsigned char, 2, cudaReadModeElementType> text;
unsigned char a = tex2D(text, cx + lx, cy);

 

 

So when I use DPCT, I have this output:

 

/*
DPCT1059:12: SYCL only supports 4-channel image format. Adjust the code.
*/
dpct::image_wrapper<unsigned char, 2> text;

 

SO, I changed the declaration with this:

 

 

dpct::image_wrapper<sycl::uchar4, 2> text_wrp;

And after launch kernel:
dpct::image_accessor_ext<sycl::uchar4, 2> text

 

 

My problem is that I don't know how to create an equivalent when reading. I have this:

 

sycl::uchar4 a = text.read(cx + lx, cy);

 

But I don't know how to get the same unsigned char from CUDA in my DPC code. Do I have to modify the indexes on the read ? I'm really lost.

Thank you so much in advance !!

0 Kudos
5 Replies
NoorjahanSk_Intel
Moderator
171 Views

Hi,

Thanks for reaching out to us.

Could you please provide us a sample reproducer of both CUDA, DPCPP so that we can work on it from our end.

And also please do let us know your environment details

OS & version

compiler version.

 

Thanks & Regards

Noorjahan.

 

ManuelCostanzo22
Beginner
152 Views

Hi @NoorjahanSk_Intel  Thank you so much for reply.

 

Here I attach two files: the original CUDA code and the original DPCT output. Could you help me to finish the migration ? 

 

Thank you again !

 

 

ManuelCostanzo22
Beginner
135 Views

@NoorjahanSk_Intel  Here I have a code that compiles, but I get a wrong output (is not the same as CUDA output).

 

 

 

NoorjahanSk_Intel
Moderator
53 Views

Hi,

We are working on it. We will get back to you soon.


Thanks & Regards

Noorjahan


ManuelCostanzo22
Beginner
45 Views

Hi !

Thank you so much ! I will be waiting .
Reply