Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __device__ int lowerBound(Particle* particles, int size, int index) {
- int lo = 0, hi = size - 1;
- while (lo < hi) {
- int mid = (lo + hi) / 2;
- if (particles[mid].cell >= index) {
- hi = mid;
- } else {
- lo = mid + 1;
- }
- }
- if (particles[lo].cell == index) {
- return lo;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement