@@ -113,12 +113,12 @@ __device__ void apply_within_kernel(
113
113
std::int64_t low = 0 ;
114
114
std::int64_t high = result_batch_size - 1 ;
115
115
std::int64_t mid = 0 ;
116
- auto compare = array_less<std::uint8_t , n_qubytes>();
116
+ auto less = array_less<std::uint8_t , n_qubytes>();
117
117
while (low <= high) {
118
118
mid = (low + high) / 2 ;
119
- if (compare (current_configs, result_configs[mid])) {
119
+ if (less (current_configs, result_configs[mid])) {
120
120
high = mid - 1 ;
121
- } else if (compare (result_configs[mid], current_configs)) {
121
+ } else if (less (result_configs[mid], current_configs)) {
122
122
low = mid + 1 ;
123
123
} else {
124
124
success = true ;
@@ -309,14 +309,14 @@ __device__ void mutex_unlock(int* mutex1, int* mutex2) {
309
309
_mutex_unlock (mutex2);
310
310
}
311
311
312
- template <typename T, typename Compare = thrust::less<T>>
312
+ template <typename T, typename Less = thrust::less<T>>
313
313
__device__ void add_into_heap (T* heap, int * mutex, std::int64_t heap_size, const T& value) {
314
- auto compare = Compare ();
314
+ auto less = Less ();
315
315
std::int64_t index = 0 ;
316
- if (compare (value, heap[index])) {
316
+ if (less (value, heap[index])) {
317
317
} else {
318
318
mutex_lock (&mutex[index]);
319
- if (compare (value, heap[index])) {
319
+ if (less (value, heap[index])) {
320
320
mutex_unlock (&mutex[index]);
321
321
} else {
322
322
while (true ) {
@@ -329,14 +329,14 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
329
329
if (left_present) {
330
330
if (right_present) {
331
331
// Both left and right children are present
332
- if (compare (value, heap[left])) {
333
- if (compare (value, heap[right])) {
332
+ if (less (value, heap[left])) {
333
+ if (less (value, heap[right])) {
334
334
// Both children are greater than the value, break
335
335
break ;
336
336
} else {
337
337
// The left child is greater than the value, treat it as if only the right child is present
338
338
mutex_lock (&mutex[right]);
339
- if (compare (value, heap[right])) {
339
+ if (less (value, heap[right])) {
340
340
mutex_unlock (&mutex[right]);
341
341
break ;
342
342
} else {
@@ -346,10 +346,10 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
346
346
}
347
347
}
348
348
} else {
349
- if (compare (value, heap[right])) {
349
+ if (less (value, heap[right])) {
350
350
// The right child is greater than the value, treat it as if only the left child is present
351
351
mutex_lock (&mutex[left]);
352
- if (compare (value, heap[left])) {
352
+ if (less (value, heap[left])) {
353
353
mutex_unlock (&mutex[left]);
354
354
break ;
355
355
} else {
@@ -359,8 +359,8 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
359
359
}
360
360
} else {
361
361
mutex_lock (&mutex[left], &mutex[right]);
362
- if (compare (heap[left], heap[right])) {
363
- if (compare (value, heap[left])) {
362
+ if (less (heap[left], heap[right])) {
363
+ if (less (value, heap[left])) {
364
364
mutex_unlock (&mutex[left], &mutex[right]);
365
365
break ;
366
366
} else {
@@ -369,7 +369,7 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
369
369
index = left;
370
370
}
371
371
} else {
372
- if (compare (value, heap[right])) {
372
+ if (less (value, heap[right])) {
373
373
mutex_unlock (&mutex[left], &mutex[right]);
374
374
break ;
375
375
} else {
@@ -382,11 +382,11 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
382
382
}
383
383
} else {
384
384
// Only the left child is present
385
- if (compare (value, heap[left])) {
385
+ if (less (value, heap[left])) {
386
386
break ;
387
387
} else {
388
388
mutex_lock (&mutex[left]);
389
- if (compare (value, heap[left])) {
389
+ if (less (value, heap[left])) {
390
390
mutex_unlock (&mutex[left]);
391
391
break ;
392
392
} else {
@@ -399,11 +399,11 @@ __device__ void add_into_heap(T* heap, int* mutex, std::int64_t heap_size, const
399
399
} else {
400
400
if (right_present) {
401
401
// Only the right child is present
402
- if (compare (value, heap[right])) {
402
+ if (less (value, heap[right])) {
403
403
break ;
404
404
} else {
405
405
mutex_lock (&mutex[right]);
406
- if (compare (value, heap[right])) {
406
+ if (less (value, heap[right])) {
407
407
mutex_unlock (&mutex[right]);
408
408
break ;
409
409
} else {
@@ -473,12 +473,12 @@ __device__ void find_relative_kernel(
473
473
std::int64_t low = 0 ;
474
474
std::int64_t high = exclude_size - 1 ;
475
475
std::int64_t mid = 0 ;
476
- auto compare = array_less<std::uint8_t , n_qubytes>();
476
+ auto less = array_less<std::uint8_t , n_qubytes>();
477
477
while (low <= high) {
478
478
mid = (low + high) / 2 ;
479
- if (compare (current_configs, exclude_configs[mid])) {
479
+ if (less (current_configs, exclude_configs[mid])) {
480
480
high = mid - 1 ;
481
- } else if (compare (exclude_configs[mid], current_configs)) {
481
+ } else if (less (exclude_configs[mid], current_configs)) {
482
482
low = mid + 1 ;
483
483
} else {
484
484
success = false ;
@@ -704,12 +704,12 @@ __device__ void single_relative_kernel(
704
704
std::int64_t low = 0 ;
705
705
std::int64_t high = exclude_size - 1 ;
706
706
std::int64_t mid = 0 ;
707
- auto compare = array_less<std::uint8_t , n_qubytes>();
707
+ auto less = array_less<std::uint8_t , n_qubytes>();
708
708
while (low <= high) {
709
709
mid = (low + high) / 2 ;
710
- if (compare (current_configs, exclude_configs[mid])) {
710
+ if (less (current_configs, exclude_configs[mid])) {
711
711
high = mid - 1 ;
712
- } else if (compare (exclude_configs[mid], current_configs)) {
712
+ } else if (less (exclude_configs[mid], current_configs)) {
713
713
low = mid + 1 ;
714
714
} else {
715
715
success = false ;
0 commit comments