Skip to content

Commit 15cdffc

Browse files
committed
Use cuLaunchHostFunc
1 parent e5144d3 commit 15cdffc

File tree

1 file changed

+3
-5
lines changed
  • offload/plugins-nextgen/cuda/src

1 file changed

+3
-5
lines changed

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,6 @@ struct CUDADeviceTy : public GenericDeviceTy {
630630
Error synchronizeImpl(__tgt_async_info &AsyncInfo) override {
631631
CUstream Stream = reinterpret_cast<CUstream>(AsyncInfo.Queue);
632632
CUresult Res;
633-
// If we have an RPC server running on this device we will continuously
634-
// query it for work rather than blocking.
635633
Res = cuStreamSynchronize(Stream);
636634

637635
// Once the stream is synchronized, return it to stream pool and reset
@@ -1287,13 +1285,13 @@ Error CUDAKernelTy::launchImpl(GenericDeviceTy &GenericDevice,
12871285

12881286
// Register a callback to indicate when the kernel is complete.
12891287
if (GenericDevice.getRPCServer())
1290-
cuStreamAddCallback(
1288+
cuLaunchHostFunc(
12911289
Stream,
1292-
[](CUstream Stream, CUresult Status, void *Data) {
1290+
[](void *Data) {
12931291
GenericPluginTy &Plugin = *reinterpret_cast<GenericPluginTy *>(Data);
12941292
Plugin.getRPCServer().Thread->finish();
12951293
},
1296-
&GenericDevice.Plugin, /*flags=*/0);
1294+
&GenericDevice.Plugin);
12971295

12981296
return Plugin::check(Res, "Error in cuLaunchKernel for '%s': %s", getName());
12991297
}

0 commit comments

Comments
 (0)