Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 19ad326

Browse files
authored
Update 20190814-kernel-and-op-registration.md
1 parent b6ea8f4 commit 19ad326

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

rfcs/20190814-kernel-and-op-registration.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,10 @@ For details on how we plan to switch between `std::function<void>` and `void
399399
### Device Assignment API
400400
401401
This approach lets us construct device objects (e.g. `Eigen::GpuDevice`) on the
402-
plugin side. This is preferred over the approach described in "Alternatives
403-
Considered" because it is more flexible when it comes to Eigen assignments and
404-
operations. Basically, we get an Eigen device object and can apply any
402+
plugin side. Basically, we get an Eigen device object and can apply any
405403
operations we currently apply to an Eigen device.
406404
407-
We could wrap `StreamInterface`, `ThreadPoolInterface` and `Allocator`. These
405+
We could wrap `Eigen::StreamInterface`, `Eigen::ThreadPoolInterface` and `Eigen::Allocator`. These
408406
wrappers will consist of a C API and a C++ wrapper on top of the C API. A
409407
sample C API for `StreamInterface` is given below:
410408
@@ -546,10 +544,10 @@ TensorFlow core of the form:
546544
void foo(std::function<void()> arg) { ... }
547545
```
548546
549-
We can't pass std::function across the C API boundary. Instead, we plan to wrap it with a struct and break this call up into 3 steps:
547+
We can't pass `std::function` across the C API boundary. Instead, we plan to wrap it with a struct and break this call up into 3 steps:
550548

551549
* Wrap `std::function<void()>` with a struct. The struct will contain pointers
552-
to callbacks for manipulating std::function<void()> pointer. (This will happen
550+
to callbacks for manipulating `std::function<void()>` pointer. (This will happen
553551
on the kernel plugin side).
554552

555553
* Pass the struct across C API boundary.
@@ -649,9 +647,8 @@ get from a HIP function (on the TensorFlow core side) and pass to another HIP
649647
function (on the kernel side).
650648

651649
Ideally, we should only rely on extern C parts of `hip_runtime_api.h`. There is
652-
now an equivalent in the C API right now for `hipLaunchKernelGGL`. However, AMD
653-
have said they are looking into adding an equivalent function to the C API in
654-
the near future and are willing to add more functions if needed.
650+
no equivalent in the C API right now for `hipLaunchKernelGGL`. However, AMD
651+
might add an equivalent function to the C API in the near future.
655652

656653
Note that we have to update `LAUNCH_GPU_KERNEL` in Eigen to call the HIP C API
657654
once it is available.

0 commit comments

Comments
 (0)