| 118 | const Data<T> data; |
| 119 | |
| 120 | __device__ bool is_above(int left, int right) { |
| 121 | T left_value = data.get_value(left); |
| 122 | T right_value = data.get_value(right); |
| 123 | if (left_value == right_value) { |
| 124 | if (preferIndices == PreferIndices::kLower) { |
| 125 | return data.get_index(left) < data.get_index(right); |
| 126 | } else { |
| 127 | return data.get_index(left) > data.get_index(right); |
| 128 | } |
| 129 | } |
| 130 | if (heapType == HeapType::kMinHeap) { |
| 131 | return left_value < right_value; |
| 132 | } else { |
| 133 | return left_value > right_value; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | __device__ void assign(int i, const Entry& entry) { data[i] = entry; } |
| 138 | |