Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP -- buffer explicit placement #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading