本文整理汇总了C++中ArrayRCP::persistingView方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayRCP::persistingView方法的具体用法?C++ ArrayRCP::persistingView怎么用?C++ ArrayRCP::persistingView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayRCP
的用法示例。
在下文中一共展示了ArrayRCP::persistingView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewBuffer
//! \brief Return a const view of a buffer for use on the host.
template <class T> inline
ArrayRCP<const T> viewBuffer(size_t size, ArrayRCP<const T> buff) {
if (isHostNode == false) {
CHECK_COMPUTE_BUFFER(buff);
}
return buff.persistingView(0,size);
}
示例2: viewBufferNonConst
//! \brief Return a non-const view of a buffer for use on the host.
template <class T> inline
ArrayRCP<T> viewBufferNonConst(ReadWriteOption rw, size_t size, const ArrayRCP<T> &buff) {
(void) rw; // Silence "unused parameter" compiler warning
if (isHostNode == false) {
CHECK_COMPUTE_BUFFER(buff);
}
return buff.persistingView(0,size);
}
示例3: setMap_PartsForRank
void setMap_PartsForRank(ArrayRCP<int> &idx, ArrayRCP<part_t> &parts) {
nRanks = idx.size() - 1;
nParts = parts.size();
// Need data stored in unordered_map; create it
rankForPart = rcp(new rankmap_t(idx[nRanks]));
maxPart = 0;
for (int i = 0; i < nRanks; i++) {
for (part_t j = idx[i]; j < idx[i+1]; j++) {
(*rankForPart)[parts[j]] = i;
if (parts[j] > maxPart) maxPart = parts[j];
}
}
// Parts for this rank are already contiguous in parts arcp.
// Keep a view of them.
partsForRank = parts.persistingView(idx[myRank],idx[myRank+1]-idx[myRank]);
}