Skip to content

Commit

Permalink
Merge Pull Request #9266 from masterleinad/Trilinos/enable_more_sycl_…
Browse files Browse the repository at this point in the history
…tests

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Tpetra: Enable more SYCL tests
PR Author: masterleinad
  • Loading branch information
trilinos-autotester authored Oct 21, 2021
2 parents 186a40b + 3b4f116 commit b6b9d46
Show file tree
Hide file tree
Showing 6 changed files with 870 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,18 @@ namespace BlockCrsTest {
template<typename T1, typename T2>
KOKKOS_INLINE_FUNCTION
static void heapify(T1 *v, T2 n, T2 i) {
T2 largest = i;
T2 l = 2*i + 1;
T2 r = 2*i + 2;

if (l < n && v[l] > v[largest]) largest = l;
if (r < n && v[r] > v[largest]) largest = r;
if (largest != i) {
while (true) {
T2 largest = i;
T2 l = 2*i + 1;
T2 r = 2*i + 2;

if (l < n && v[l] > v[largest]) largest = l;
if (r < n && v[r] > v[largest]) largest = r;
if (largest == i)
break;
// swap
T1 tmp = v[i]; v[i] = v[largest]; v[largest] = tmp;
heapify(v, n, largest);
i = largest;
}
}

Expand Down
Loading

0 comments on commit b6b9d46

Please sign in to comment.