本文整理汇总了C++中Dims::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Dims::size方法的具体用法?C++ Dims::size怎么用?C++ Dims::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dims
的用法示例。
在下文中一共展示了Dims::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memcpy
void ADIOS1CommonRead::ScheduleReadCommon(const std::string &name,
const Dims &offs, const Dims &ldims,
const int fromStep, const int nSteps,
const bool readAsLocalValue,
const bool readAsJoinedArray,
void *data)
{
if (readAsLocalValue)
{
/* Get all the requested values from metadata now */
ADIOS_VARINFO *vi = adios_inq_var(m_fh, name.c_str());
if (vi)
{
adios_inq_var_stat(m_fh, vi, 0, 1);
int elemsize = adios_type_size(vi->type, nullptr);
long long blockidx = 0;
for (int i = 0; i < fromStep; i++)
{
blockidx += vi->nblocks[i];
}
char *dest = (char *)data;
for (int i = fromStep; i < fromStep + nSteps; i++)
{
for (int j = 0; j < vi->nblocks[i]; j++)
{
memcpy(dest, vi->statistics->blocks->mins[blockidx],
elemsize);
++blockidx;
dest += elemsize;
}
}
adios_free_varinfo(vi);
}
}
else
{
uint64_t start[32], count[32];
for (int i = 0; i < ldims.size(); i++)
{
start[i] = (uint64_t)offs[i];
count[i] = (uint64_t)ldims[i];
}
ADIOS_SELECTION *sel = nullptr;
if (ldims.size() > 0)
{
sel = adios_selection_boundingbox(ldims.size(), start, count);
}
adios_schedule_read(m_fh, sel, name.c_str(), (int)fromStep, (int)nSteps,
data);
adios_selection_delete(sel);
}
}