[FEA] `cudf::scalar` cache `is_valid` to reduce amount of stream syncs
Open
feature request
libcudf
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
As discovered in https://github.com/rapidsai/cudf/pull/8004 the `is_valid` call in `cudf::scalar` is not cached locally, and therefore a stream sync / `cudaMemcpyAsync` will be executed for each call.
If algorithms such as `clamp` this cost is very high and has a impact on total runtime.
**Describe the solution you'd like**
Cache the value of `is_valid` on initial construction and any modification.
Contributor guide
Assessment
This issue has not been assessed yet.