Skip to content

Commit e6e67c2

Browse files
committed
[SYCLomatic] Add 2 cooperative_groups experimental query API mappings.
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
1 parent a3f381a commit e6e67c2

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
21
#define _CG_ABI_EXPERIMENTAL
32

4-
#include <cuda.h>
5-
#include "cooperative_groups.h"
6-
7-
void test() {
8-
cooperative_groups::experimental::block_tile_memory<1, 1> mem;
9-
10-
// Start
11-
cooperative_groups::thread_block tb =
12-
cooperative_groups::experimental::this_thread_block();
13-
// End
14-
15-
3+
#include <cooperative_groups.h>
4+
__device__
5+
void _Copy() {
6+
__shared__ cooperative_groups::experimental::block_tile_memory<8> shared;
7+
// Start
8+
cooperative_groups::thread_block thb = cooperative_groups::experimental::this_thread_block(shared/*cooperative_groups::experimental::block_tile_memory*/);
9+
// End
1610
}
11+

clang/examples/DPCT/Runtime/cooperative_groups$$experimental$$tiled_partition.cu

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
#include <cuda.h>
44
#include "cooperative_groups.h"
55

6-
void test(cooperative_groups::thread_block tb) {
6+
__device__ void test(cooperative_groups::thread_block tb) {
77
cooperative_groups::experimental::block_tile_memory<1, 1> mem;
8-
98
// Start
109
cooperative_groups::thread_block_tile<32> tbt32 = cooperative_groups::experimental::tiled_partition<32>(tb/*cooperative_groups::thread_block*/);
1110
// End

clang/lib/DPCT/DPCT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,9 +1446,9 @@ int runDPCT(int argc, const char **argv) {
14461446
std::string Err = getDpctTermStr();
14471447
StringRef ErrStr = Err;
14481448
// Avoid the "Visual Studio version" error on windows platform.
1449-
if (ErrStr.find("error:") == ErrStr.rfind("error:") &&
1449+
if (ErrStr.find("error:") == ErrStr.rfind("error:") && (ErrStr.contains("no function template matches function template specialization 'this_multi_grid'") ||
14501450
ErrStr.contains(
1451-
"error -- unsupported Microsoft Visual Studio version")) {
1451+
"error -- unsupported Microsoft Visual Studio version"))) {
14521452
break;
14531453
}
14541454
if (ErrStr.contains("use of undeclared identifier")) {

clang/lib/DPCT/SrcAPI/APINames.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,9 @@ ENTRY(cooperative_groups::this_thread, cooperative_groups::__v1::this_thread, tr
21402140
ENTRY(cooperative_groups::this_grid, cooperative_groups::__v1::this_grid, true, NO_FLAG, P4, "Successful")
21412141
ENTRY(cooperative_groups::this_multi_grid, cooperative_groups::__v1::this_multi_grid, false, NO_FLAG, P4, "comment")
21422142
ENTRY(cooperative_groups::this_thread_block, cooperative_groups::__v1::this_thread_block, true, NO_FLAG, P4, "Successful")
2143+
ENTRY(cooperative_groups::experimental::this_thread_block, cooperative_groups::__v1::experimental::this_thread_block, true, NO_FLAG, P4, "Successful")
21432144
ENTRY(cooperative_groups::tiled_partition, cooperative_groups::__v1::tiled_partition, true, NO_FLAG, P4, "If size equals to 32, tool will migrate it, else warning is emitted.")
2145+
ENTRY(cooperative_groups::experimental::tiled_partition, cooperative_groups::__v1::experimental::tiled_partition, true, NO_FLAG, P4, "If size equals to 32, tool will migrate it, else warning is emitted.")
21442146
ENTRY(cooperative_groups::labeled_partition, cooperative_groups::__v1::labeled_partition, false, NO_FLAG, P4, "comment")
21452147
ENTRY(cooperative_groups::binary_partition, cooperative_groups::__v1::binary_partition, false, NO_FLAG, P4, "comment")
21462148
ENTRY(cooperative_groups::sync, cooperative_groups::__v1::sync, true, NO_FLAG, P4, "comment")

0 commit comments

Comments
 (0)