-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set intersection #113
Set intersection #113
Conversation
|
||
for (unsigned int i = 0; i < tile_a.size(); ++i) | ||
{ | ||
std::cout<<tile_a[i]<<" "<<tile_b[i]<<std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging code? should be removed.
Looks good! The tests pass on my machine. Left a few inline comments. After those are addressed it should be good to merge. |
Oh sorry for the kind of half-baked version, forgot to mention that I actually wanted you to test it on your machine since I had issues with it passing on my machine and failing on travis. Anyway good to hear that it is working on your setup as well. Will make a final version fit for merging soon... |
Added kernel to tile sets based on a balanced path
Added kernel to compact the results of set kernels into actual sets
Done :) |
|
||
exclusive_scan(counts.begin(), counts.end(), counts.begin(), queue); | ||
|
||
queue.finish(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be needed (calling clFinish()
can be expensive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is needed to determine the number of elements in the intersection. Without waiting for the queue to finish, how would I be able to return an iterator pointing to end of intersection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, i see. so instead of calling finish()
here, down below when you get counts.back()
, I would change it to use the internal detail::read_single_value()
function which takes a queue argument and enqueues the operation. so something like: return result + detail::read_single_value(counts.get_buffer(), counts.size() - 1, queue);
. This will still block at the end, but will remove the need for two separate host-device synchronization points (which happens now when you explicitly call finish()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Neat!
Cool! Left a few more comments. I'm away right now but I should be able to test this on my AMD machine early next week. |
Change tile_size from string to int, use read_single_value instead of finish
Done.. :) |
Awesome! Merged! |
Added new kernels, algorithm and test for
set_intersection