Closed ymhsieh closed 5 years ago
Try replacing
for(const auto& i: array) {
cout << i << " ";
}
with
for(auto i = array.begin; i != array.end(); i++)
{
cout << i.read(compute::system::default_queue()) << " ";
}
Alternatively, you can also add compute::system::default_queue().finish()
after sorting.
I'm not 100% sure, but the problem might be that
for(const auto& i: array) {
cout << i << " ";
}
uses different queue to read values than sorting operations, therefore they are not synchronised.
Thank you for your quick advise, and it did solve the problem...
Hello, I've gotten wrong results doing sorting with the following code using NVIDIA or Intel GPU. I've tried both the master branch or develop branch and they both give me incorrect results.
Would you please look into this issue? Thanks.