kkraus14 commented on code in PR #36489:
URL: https://github.com/apache/arrow/pull/36489#discussion_r1259014082
##########
cpp/src/arrow/buffer.h:
##########
@@ -57,18 +57,25 @@ class ARROW_EXPORT Buffer {
///
/// \note The passed memory must be kept alive through some other means
Buffer(const uint8_t* data, int64_t size)
- : is_mutable_(false), is_cpu_(true), data_(data), size_(size),
capacity_(size) {
+ : is_mutable_(false), is_cpu_(true), data_(data), size_(size),
capacity_(size), device_type_(DeviceType::CPU) {
Review Comment:
While the pointers are accessible to the CPU, there's no guarantee that
there isn't stream ordered work happening on them where it could cause a race
condition to CPU code accessing the buffer. Given `is_cpu_` is existing ABI,
I'm wondering if it wouldn't be a safer option to have it return `False` in
these cases where if someone wants to do CPU things against `CUDA_HOST` or
`ROCM_HOST` buffers they should explicitly check the device type instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]