Put attach/detach buffer back in for TensorDeviceSycl.

Also added a test to verify the original buffer is updated correctly.
This commit is contained in:
Antonio Sanchez
2021-07-09 09:41:37 -07:00
parent beea14a18f
commit 9c22795d65
2 changed files with 35 additions and 0 deletions

View File

@@ -962,6 +962,15 @@ struct SyclDevice : public SyclDeviceBase {
return queue_stream()->get(data);
}
/// attach existing buffer
EIGEN_STRONG_INLINE void *attach_buffer(
cl::sycl::buffer<buffer_scalar_t, 1> &buf) const {
return queue_stream()->attach_buffer(buf);
}
/// detach buffer
EIGEN_STRONG_INLINE void detach_buffer(void *p) const {
queue_stream()->detach_buffer(p);
}
EIGEN_STRONG_INLINE ptrdiff_t get_offset(const void *ptr) const {
return queue_stream()->get_offset(ptr);
}