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
[Kernels][stdlib] Replace DeviceContextPtr with direct use of
DeviceContext
The `DeviceContextPtr` type is a legacy type which was needed to satisfy
the requirement that kernel arguments be register passable. Internally,
`DeviceContextPtr` is structurally equivalent to `DeviceContext`, with
the caveat that it does not increment the reference count on the
`DeviceContext` C++ implementation.
Now that we have the EmitMojo backend, kernels are able to accept
`DeviceContext` or containers thereof. This change replaces
`DeviceContextPtr` with direct uses of `DeviceContext`.
Summary of changes:
* Kernel registrations now take a `DeviceContext` argument rather than a
`DeviceContextPtr` argument.
* Multi-device kernels now take a `DeviceContextList` type, rather than
`DeviceContextPtrList`.
* Kernel implementations which used the nullability of
`DeviceContextPtr` now take `Optional[DeviceContext]`. Where possible,
these cases were eliminated as a null `DeviceContextPtr` is uncommon
with the introduction of `CpuDeviceContext`.
MODULAR_ORIG_COMMIT_REV_ID: fad38ebea8c999c67dd807ce13e5589d641ba38a
0 commit comments