本文整理汇总了C++中View1::block方法的典型用法代码示例。如果您正苦于以下问题:C++ View1::block方法的具体用法?C++ View1::block怎么用?C++ View1::block使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View1
的用法示例。
在下文中一共展示了View1::block方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
check_not_alias(
View1<T1, Block1>& vec1,
View2<T2, Block2>& vec2)
{
fill_block(vec1.block(), 2);
fill_block(vec2.block(), 3);
// Make sure that updates to vec2 do not affect vec1.
test_assert(check_vector(vec1, 2));
// And visa-versa.
fill_block(vec1.block(), 4);
test_assert(check_vector(vec2, 3));
}
示例2: apply_ukernel
void
apply_ukernel(View0 in0,
View1 in1,
View2 in2,
View3 out)
{
dda::Data<typename View0::block_type, dda::in> data0(in0.block());
dda::Data<typename View1::block_type, dda::in> data1(in1.block());
dda::Data<typename View2::block_type, dda::in> data2(in2.block());
dda::Data<typename View3::block_type, dda::out> data3(out.block());
assert(data0.stride(1) == 1);
assert(data1.stride(1) == 1);
assert(data2.stride(1) == 1);
assert(data3.stride(1) == 1);
example::Cblock kernel((uintptr_t)data0.ptr(), data0.stride(0),
(uintptr_t)data1.ptr(), data1.stride(0),
(uintptr_t)data2.ptr(), data2.stride(0),
(uintptr_t)data3.ptr(), data3.stride(0),
out.size(0), out.size(1));
vsip_csl::ukernel::Ukernel<example::Cblock> uk(kernel);
uk();
}
示例3: apply_ukernel
void
apply_ukernel(View0 in0,
View1 in1,
View2 in2,
View3 out)
{
dda::Ext_data<typename View0::block_type> ext0(in0.block());
dda::Ext_data<typename View1::block_type> ext1(in1.block());
dda::Ext_data<typename View2::block_type> ext2(in2.block());
dda::Ext_data<typename View3::block_type> ext3(out.block());
assert(ext0.stride(1) == 1);
assert(ext1.stride(1) == 1);
assert(ext2.stride(1) == 1);
assert(ext3.stride(1) == 1);
example::Cblock kernel((uintptr_t)ext0.data(), ext0.stride(0),
(uintptr_t)ext1.data(), ext1.stride(0),
(uintptr_t)ext2.data(), ext2.stride(0),
(uintptr_t)ext3.data(), ext3.stride(0),
out.size(0), out.size(1));
vsip_csl::ukernel::Ukernel<example::Cblock> uk(kernel);
uk();
}