Skip to content

Commit

Permalink
[pnnl#192] Documentation for dma operations
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoCastellana authored and mfbalin committed Jun 23, 2021
1 parent 01fc76a commit 7804027
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions include/shad/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -1171,20 +1171,43 @@ void asyncForEachOnAll(Handle &handle, FunT &&func,
handle, func, argsBuffer, bufferSize, numIters);
}

/// @brief Copies local data to a potentially remote memory allocation.
///
/// @tparam T type of the data to copy.
/// @param destLoc The locality where to copy to.
/// @param remoteAddress The pointer to the destination memory allocation.
/// @param localeData The pointer to the memory allocation to copy from.
/// @param numElements Number of elements to copy.
template <typename T>
void dma(const Locality &destLoc, const T* remoteAddress,
const T* localData, const size_t numElements) {
impl::SynchronousInterface<TargetSystemTag>::dma(
destLoc, remoteAddress, localData, numElements);
}

/// @brief Copies potentially remote data to local memory allocation.
///
/// @tparam T type of the data to copy.
/// @param localAddress The pointer to the local memory allocation.
/// @param srcLoc The locality where to copy from.
/// @param remoteData The pointer to the memory allocation to copy from.
/// @param numElements Number of elements to copy.
template <typename T>
void dma(const T* localAddress, const Locality &srcLoc,
const T* remoteData, const size_t numElements) {
impl::SynchronousInterface<TargetSystemTag>::dma(
localAddress, srcLoc, remoteData, numElements);
}

/// @brief Copies local data to a potentially remote
// memory allocation, asynchronously.
///
/// @tparam T type of the data to copy
/// @param handle An Handle for the associated task-group.
/// @param destLoc The locality where to copy to.
/// @param remoteAddress The pointer to the destination memory allocation.
/// @param localeData The pointer to the memory allocation to copy from.
/// @param numElements Number of elements to copy.
template <typename T>
void asyncDma(Handle &handle,
const Locality &destLoc, const T* remoteAddress,
Expand All @@ -1199,6 +1222,15 @@ void asyncDma(Handle &handle,
args);
}

/// @brief Copies (potentially remote) data
// to local memory allocation, asynchronously.
///
/// @tparam T type of the data to copy
/// @param handle An Handle for the associated task-group.
/// @param localAddress The pointer to the local memory allocation.
/// @param srcLoc The locality where to copy from.
/// @param remoteData The pointer to the memory allocation to copy from.
/// @param numElements Number of elements to copy.
template <typename T>
void asyncDma(Handle &handle,
const T* localAddress, const Locality &srcLoc,
Expand Down

0 comments on commit 7804027

Please sign in to comment.