Skip to content

Commit 1185217

Browse files
authored
[SYCLomatic] Add query-api-mapping for 1 runtime API cudaEventRecordWithFlags (#2926)
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
1 parent f982949 commit 1185217

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Option: --enable-profiling
2+
3+
void test(cudaEvent_t event, cudaStream_t stream) {
4+
// Start
5+
cudaEventRecordWithFlags(event /*cudaEvent_t*/, stream /*cudaStream_t*/,
6+
cudaEventRecordDefault /*unsigned int*/);
7+
// End
8+
}

clang/lib/DPCT/DPCT.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,8 @@ int runDPCT(int argc, const char **argv) {
10721072
Experimentals.addValue(ExperimentalFeatures::Exp_NonUniformGroups);
10731073
} else if (Option == "--no-dry-pattern") {
10741074
NoDRYPattern.setValue(true);
1075+
} else if (Option == "--enable-profiling") {
1076+
EnablepProfiling.setValue(true);
10751077
}
10761078
// Need add more option.
10771079
}

clang/test/dpct/query_api_mapping/Runtime/test.cu

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@
520520
// CUDARUNTIMEGETVERSION-NEXT: Is migrated to:
521521
// CUDARUNTIMEGETVERSION-NEXT: *pi = dpct::get_major_version(dpct::get_current_device());
522522

523-
524-
525523
// RUN: dpct --cuda-include-path="%cuda-path/include" -query-api-mapping=cudaMemcpy3DPeer | FileCheck %s -check-prefix=CUDAMEMCPY3DPEER
526524
// CUDAMEMCPY3DPEER: CUDA API:
527525
// CUDAMEMCPY3DPEER-NEXT: cudaMemcpy3DPeer(p/*const cudaMemcpy3DPeerParms**/);
@@ -557,3 +555,9 @@
557555
// CUDAPROFILERSTOP-NEXT: cudaProfilerStop();
558556
// CUDAPROFILERSTOP-NEXT: The API is Removed.
559557
// CUDAPROFILERSTOP-EMPTY:
558+
// RUN: dpct --cuda-include-path="%cuda-path/include" --query-api-mapping=cudaEventRecordWithFlags | FileCheck %s -check-prefix=cudaEventRecordWithFlags
559+
// cudaEventRecordWithFlags: CUDA API:
560+
// cudaEventRecordWithFlags-NEXT: cudaEventRecordWithFlags(event /*cudaEvent_t*/, stream /*cudaStream_t*/,
561+
// cudaEventRecordWithFlags-NEXT: cudaEventRecordDefault /*unsigned int*/);
562+
// cudaEventRecordWithFlags-NEXT: Is migrated to (with the option --enable-profiling):
563+
// cudaEventRecordWithFlags-NEXT: dpct::sync_barrier(event /*cudaEvent_t*/, stream /*unsigned int*/);

clang/test/dpct/query_api_mapping/test_all.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@
14471447
// CHECK-NEXT: cudaEventElapsedTime
14481448
// CHECK-NEXT: cudaEventQuery
14491449
// CHECK-NEXT: cudaEventRecord
1450+
// CHECK-NEXT: cudaEventRecordWithFlags
14501451
// CHECK-NEXT: cudaEventSynchronize
14511452
// CHECK-NEXT: cudaExternalMemoryGetMappedBuffer
14521453
// CHECK-NEXT: cudaExternalMemoryGetMappedMipmappedArray

0 commit comments

Comments
 (0)