- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm just a beginner of DPC++ prgramming. (Previously I worked with Intel oneTBB and C++ threads). I have a "stupid" question:
when debugging the DPC++ code, I cannot set breakpoint after parallel_for, could anyone explain it? Thanks so much.
Below is the code example from DPC++ book.
___________________________
const int size = 16;
std::array<int, size> data;
sycl::property_list properties{ sycl::property::queue::enable_profiling() };
sycl::queue Q(sycl::cpu_selector_v);
sycl::buffer B(data);
//see selected devices
sycl::device divece_ = Q.get_device();
auto info = divece_.get_info<sycl::info::device::name>();
std::cout << "Selected device: " << info << std::endl;
Q.submit([&](sycl::handler& h) {
sycl::accessor A{ B, h };
h.parallel_for(size,
[=](auto& idx) {
A[idx] = idx; }
);
});
sycl::host_accessor A(B);
for (int i = 0; i < size; i++) {
std::cout << "data[" << i << "] = " << A[i] << std::endl; //FOR EXAMPLE, CANNOT STOP HERE
}
return;
_______________________________
Visual Studio shows the message "the breakpoint will not be hit, no executable code is associated with this line of code."
my understanding is that the for loop after host_accessor is run on host, and should be stopped.
Could anyone help me point out where I'm wrong...
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please close this post. I'm just notified to use Intel distribution for GBD......Sorry for making trouble.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
You can set the breakpoint by changing the below settings in Visual Studio:
Uncheck the option “Require source files to exactly match the original version” in Tools > Options > Debugging before you start debugging
Please refer to the below link for more details:
>>Please close this post
Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks & Regards,
Noorjahan.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page