Skip to content

Commit 5d261f0

Browse files
authored
[SYCLomatic] Add query api mapping for 22 cub blocklevel API and 4 cub devicelevel API (#2900)
Signed-off-by: intwanghao <hao3.wang@intel.com>
1 parent d141627 commit 5d261f0

29 files changed

+511
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).BlockedToStriped(thread_data/*int(&)[4]*/, thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).BlockedToWarpStriped(thread_data/*int(&)[4]*/, thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4], int (&thread_rank)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).ScatterToBlocked(thread_data/*int(&)[4]*/, thread_rank/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4], int (&thread_rank)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).ScatterToStriped(thread_data/*int(&)[4]*/, thread_rank/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).StripedToBlocked(thread_data/*int(&)[4]*/, thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockExchange<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockExchange<int, 128, 4>(temp_storage).WarpStripedToBlocked(thread_data/*int(&)[4]*/, thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int *src, int (&thread_data)[4], int end, int default_value) {
6+
// Start
7+
__shared__ typename cub::BlockLoad<int, 128, 4, cub::BLOCK_LOAD_DIRECT>::TempStorage temp_storage;
8+
cub::BlockLoad<int, 128, 4, cub::BLOCK_LOAD_DIRECT>(temp_storage).Load(src/*int **/, thread_data/*int(&)[4]*/);
9+
cub::BlockLoad<int, 128, 4, cub::BLOCK_LOAD_DIRECT>(temp_storage).Load(src/*int **/, thread_data/*int(&)[4]*/, end/*int*/);
10+
cub::BlockLoad<int, 128, 4, cub::BLOCK_LOAD_DIRECT>(temp_storage).Load(src/*int **/, thread_data/*int(&)[4]*/, end/*int*/, default_value/*int*/);
11+
// End
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockRadixSort<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockRadixSort<int, 128, 4>(temp_storage).Sort(thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockRadixSort<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockRadixSort<int, 128, 4>(temp_storage).SortBlockedToStriped(thread_data/*int(&)[4]*/);
9+
// End
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// clang-format off
2+
#include <cstddef>
3+
#include <cub/cub.cuh>
4+
5+
__device__ void test(int (&thread_data)[4]) {
6+
// Start
7+
__shared__ typename cub::BlockRadixSort<int, 128, 4>::TempStorage temp_storage;
8+
cub::BlockRadixSort<int, 128, 4>(temp_storage).SortDescending(thread_data/*int(&)[4]*/);
9+
// End
10+
}

0 commit comments

Comments
 (0)