Skip to content

Commit

Permalink
WIP -- buffer explicit placement
Browse files Browse the repository at this point in the history
  • Loading branch information
burlen committed Aug 24, 2023
1 parent d3d8592 commit 2d8b227
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions hamr_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,26 @@ class HAMR_EXPORT buffer
int host_accessible() const;

#if !defined(SWIG)
/** @returns a read only pointer to the contents of the buffer accessible
* from the active CUDA device. If the buffer is currently accessible on
* the active CUDA device then this call is a NOOP. If the buffer is not
* currently accessible on the active CUDA device then a temporary buffer
* is allocated and the data is moved. The returned shared_ptr deals with
/** Returns a read only pointer to the contents of the buffer accessible
* from the specified CUDA device. If the buffer is currently accessible on
* the device, direct access to the device pointer is granted.
* this call is a NOOP in that case. If the buffer is not currently
* accessible on the active CUDA device then a temporary buffer is
* allocated and the data is moved. The returned shared_ptr deals with
* deallocation of the temporary if needed.
*/
std::shared_ptr<const T> get_cuda_accessible() const;
*
* @param[in] dev The CUDA device where access is desired. Pass -1 to use
* the active device.
* @param[in] strm The stream used to order data movement, should it be
* needed. If not specified the instance's stream will be used.
* @param[in] sync specifies synchronization behavior of the call. If not
* specified the instance's transfer mode will be used.
* @returns a read only view of the data accessible in the CUDA programming
* model.
*/
std::shared_ptr<const T> get_cuda_accessible(int dev = -1,
const hamr::stream &strm = get_stream(),
transfer sync = transfer::async) const;
#endif

/// returns true if the data is accessible from CUDA codes
Expand Down

0 comments on commit 2d8b227

Please sign in to comment.