Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sirgienko
Employee
236 Views

DPC++ crash inside llvm code (libOclCpuBackEnd) in runtime

Jump to solution

The problem described in title. Minimal reproduce example is attached. File with building instruction, full backtrace and system description is attached too.

Labels (1)
0 Kudos
1 Solution
GouthamK_Intel
Moderator
215 Views

Hi,

As per the code provided by you, we observed that you are working on a buffer data of length 100.

 

const size_t ARRAY_SIZE = 100;
int* data = new int[ARRAY_SIZE];

 

Whereas you are launching the kernel with 50*50 threads using range with 2 dimensions.

 

range<2> num_items{ARRAY_SIZE / 2, ARRAY_SIZE / 2};

 

Since you are launching threads in 2d, the range of idx.get(0) and idx.get(1) are {0,49}. So the possible range of index variable is {0,539} which exceeds the max size of our buffer i.e 100.

 

size_t index = idx.get(0) * 10 + idx.get(1);

 

Could you please try running your code with the below modification.

 

range<2> num_items{ARRAY_SIZE / 10, ARRAY_SIZE / 10};

 

 

Please let us know if the provided solution helps you.

 

 

Thanks & Regards

Goutham

View solution in original post

3 Replies
GouthamK_Intel
Moderator
216 Views

Hi,

As per the code provided by you, we observed that you are working on a buffer data of length 100.

 

const size_t ARRAY_SIZE = 100;
int* data = new int[ARRAY_SIZE];

 

Whereas you are launching the kernel with 50*50 threads using range with 2 dimensions.

 

range<2> num_items{ARRAY_SIZE / 2, ARRAY_SIZE / 2};

 

Since you are launching threads in 2d, the range of idx.get(0) and idx.get(1) are {0,49}. So the possible range of index variable is {0,539} which exceeds the max size of our buffer i.e 100.

 

size_t index = idx.get(0) * 10 + idx.get(1);

 

Could you please try running your code with the below modification.

 

range<2> num_items{ARRAY_SIZE / 10, ARRAY_SIZE / 10};

 

 

Please let us know if the provided solution helps you.

 

 

Thanks & Regards

Goutham

View solution in original post

sirgienko
Employee
208 Views

Hi Goutham

Yes, you right, this is a code error with range size.

But, i think, it will be great, especially for debug builds, if the compiler won't crash deep inside dpc++ runtime inside, but instead fall on failed assert of line

buf2_w[index] = buf1_r[index];

But this is just suggestion.

GouthamK_Intel
Moderator
197 Views

Hi,

Glad to know that your issue is resolved.

Thanks for your suggestion, we will forward it to the concerned team.

As your issue has been resolved and 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.

Have a Good day.!

 

Thanks & Regards

Goutham

Reply