Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
366 Discussions

The dimension and read problem when using DPC++ image arrays

shenuo
Employee
827 Views
This problem really confuse me. I wanna use DPC++ to read a group of images, so the sycl::image was used ,below are my code.
#define N 4   //dimensin
#define M 128 //dimension 
#define C 4   //4 channel
#define L 2   // 2 images
int * host_array3_2 = malloc_host<int>(N*M*C*L, Q);
image im3(host_array3_2, image_channel_order::rgba, image_channel_type::unsigned_int32, range{ M,N,L}); //the image format

The kernel code are as follows, I use accessor with image_array tags to  read the data:
Q.submit([&](handler &h) {
           auto out = sycl::stream(1024, 1024 * 2, h);
            accessor<int4, 2, access::mode::read, access::target::image_array> acs3(im3, h);//the accessor format
            h.parallel_for(nd_range{ range{ M ,N,L }, range{ N,N,L } }, [=](nd_item<3> it) {
            int idx = it.get_global_linear_id();
                if (idx == 0){
            confuse here:  out << acs3.get_count() << " " << acs3.get_range() << " \n";
                //const auto &ss = acs3[0];    no compile error
        confuse here:  //ss.read(int2(0, 1));         compiler error: "array subscript out of range"  "SYCL kernel cannot call a variadic function"}
            });
        });
In addition to the read problem , I found that the range is{128,4,4},why the third dimension is 4? Isn’t the value of L(2)? And it seems that the third dimension is only depend on the second dimension, no matter what the L is. Can anybody answer me?
0 Kudos
6 Replies
VidyalathaB_Intel
Moderator
793 Views

Hi,

 

Thanks for reaching out to us.

 

Could you please let us know your environment details on which you are compiling your source code.

 

OS & version

Compiler & Version

 

Regards,

Vidya.

 

shenuo
Employee
759 Views

Hello, thanks for your reply, my  compiler is oneAPI DPC++ Compiler  (2021.3.0) on windows 10, VS2017. and by the way ,release compile mode is ok

VidyalathaB_Intel
Moderator
716 Views

Hi,

Thanks for providing the details.

The issue is reproducible from our end in Debug mode and in release mode it is working fine.

We are looking into this issue internally. we will get back to you soon.

Regards,

Vidya.


ayu1
Employee
617 Views

We are still working on your issue internally and we will get back to you with update.



shenuo
Employee
593 Views
ayu1
Employee
371 Views

The issue regarding to last of the 3 numbers in a range that should reflect the quantity of the given 2D images has been fixed. However we're still working on the problem with accessor::read function. We'll come back with update.


Reply