- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem described in title. Minimal reproduce example is attached. File with building instruction, full backtrace and system description is attached too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page