You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support [sycl_ext_codeplay_enqueue_native_command](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_codeplay_enqueue_native_command.asciidoc) with SYCL-Graph.
Introduces `interop_handle::ext_codeplay_get_native_graph<backend>()` to
give the user access to the native graph object which native commands
can be appended to.
To use CUDA as an example, code using `ext_codeplay_enqueue_native_command`
eagerly can be updated from:
```cpp
CGH.ext_codeplay_enqueue_native_command([=](interop_handle IH) {
auto NativeStream = IH.get_native_queue<cuda>();
myNativeLibraryCall(NativeStream);
}
```
To
```cpp
CGH.ext_codeplay_enqueue_native_command([=](interop_handle IH) {
if (IH.ext_codeplay_has_graph()) {
auto NativeGraph = IH.ext_codeplay_get_native_graph<cuda>();
auto NativeStream = IH.get_native_queue<cuda>();
// Start capture stream calls into graph
cuStreamBeginCaptureToGraph(NativeStream, NativeGraph, nullptr,
nullptr, 0,
CU_STREAM_CAPTURE_MODE_GLOBAL);
myNativeLibraryCall(NativeStream);
// Stop capturing stream calls into graph
cuStreamEndCapture(NativeStream, &NativeGraph);
} else {
auto NativeStream = IH.get_native_queue<cuda>();
myNativeLibraryCall(NativeStream );
}
}
```
Example of how this integration could work in GROMACS https://gitlab.com/gromacs/gromacs/-/merge_requests/4954
0 commit comments