本文整理汇总了C++中BlockT类的典型用法代码示例。如果您正苦于以下问题:C++ BlockT类的具体用法?C++ BlockT怎么用?C++ BlockT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BlockT类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exec
static void exec(BlockT& block, value_type const& val)
{
for (vsip::index_type x=0; x<block.size(3, 2); ++x)
for (vsip::index_type y=0; y<block.size(3, 1); ++y)
for (vsip::index_type z=0; z<block.size(3, 0); ++z)
block.put(z, y, x, val);
}
示例2: rebind_interleaved
void
rebind_interleaved(
Domain<Dim> const& dom,
BlockT& block,
int k)
{
length_type const size = block.size();
T* data = new T[2*size];
T* ptr;
fill_interleaved_array<Order>(data, dom, CFiller<T>(k, 0, 1));
block.rebind(data);
test_assert(block.admitted() == false);
test_assert(block.user_storage() == interleaved_format);
block.find(ptr);
test_assert(ptr == data);
block.admit(true);
test_assert(block.admitted() == true);
test_assert(check_block<Order>(block, dom, CFiller<T>(k, 0, 1)));
fill_block<Order>(block, dom, CFiller<T>(k+1, 0, 1));
block.release(true);
test_assert(block.admitted() == false);
test_assert(check_interleaved_array<Order>(data, dom, CFiller<T>(k+1, 0, 1)));
delete[] data;
}
示例3: redim_get
typename BlockT::value_type
redim_get(BlockT const& blk, index_type l_idx, integral_constant<int, 3>)
{
index_type idx[3];
for (dimension_type d=3; d-->0;)
{
idx[d] = l_idx % blk.size(3, d);
l_idx /= blk.size(3, d);
}
return blk.get(idx[0], idx[1], idx[2]);
}
示例4: redim_put
void
redim_put(BlockT &blk,
index_type l_idx,
typename BlockT::value_type value,
integral_constant<int, 3>)
{
index_type idx[3];
for (dimension_type d=3; d-->0;)
{
idx[d] = l_idx % blk.size(3, d);
l_idx /= blk.size(3, d);
}
blk.put(idx[0], idx[1], idx[2], value);
}
示例5: redim_get
typename BlockT::value_type
redim_get(BlockT const& blk, index_type l_idx, Int_type<2>)
{
typedef typename Block_layout<BlockT>::order_type order_type;
dimension_type dim[2];
index_type idx[2];
dim[0] = order_type::impl_dim0;
dim[1] = order_type::impl_dim1;
for (dimension_type d=2; d-->0;)
{
idx[dim[d]] = l_idx % blk.size(2, dim[d]);
l_idx /= blk.size(2, dim[d]);
}
return blk.get(idx[0], idx[1]);
}
示例6: redim_put
void
redim_put(
BlockT& blk,
index_type l_idx,
typename BlockT::value_type value,
Int_type<2>)
{
typedef typename Block_layout<BlockT>::order_type order_type;
dimension_type dim[2];
index_type idx[2];
dim[0] = order_type::impl_dim0;
dim[1] = order_type::impl_dim1;
for (dimension_type d=2; d-->0;)
{
idx[dim[d]] = l_idx % blk.size(2, dim[d]);
l_idx /= blk.size(2, dim[d]);
}
blk.put(idx[0], idx[1], value);
}
示例7: rebind_split
void
rebind_split(
Domain<Dim> const& dom,
BlockT& block,
int k)
{
length_type const size = block.size();
T* real = new T[size];
T* imag = new T[size];
T* real_ptr;
T* imag_ptr;
fill_split_array<Order>(real, imag, dom, CFiller<T>(k, 0, 1));
block.rebind(real, imag);
test_assert(block.admitted() == false);
test_assert(block.user_storage() == split_format); // rebind could change format
block.find(real_ptr, imag_ptr);
test_assert(real_ptr == real);
test_assert(imag_ptr == imag);
block.admit(true);
test_assert(block.admitted() == true);
test_assert(check_block<Order>(block, dom, CFiller<T>(k, 0, 1)));
fill_block<Order>(block, dom, CFiller<T>(k+1, 0, 1));
block.release(true);
test_assert(block.admitted() == false);
test_assert(check_split_array<Order>(real, imag, dom, CFiller<T>(k+1, 0, 1)));
delete[] real;
delete[] imag;
}