本文整理汇总了C++中View1类的典型用法代码示例。如果您正苦于以下问题:C++ View1类的具体用法?C++ View1怎么用?C++ View1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View1类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: tbb_copy_pixels
GIL_FORCEINLINE void tbb_copy_pixels( const View1& src, const View2& dst)
{
assert(src.dimensions()==dst.dimensions());
tbb::parallel_for( tbb::blocked_range<std::size_t>( 0, src.height()),
detail::make_tbb_copy_pixels_fun( src, dst),
GIL_TBB_ALGORITHMS_DEFAULT_PARTITIONER());
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:7,代码来源:tbb_copy.hpp
示例2: if
ExecStatus
Nq<View0,View1>::post(Home home, View0 x0, View1 x1){
if (x0.assigned() && x1.assigned()) {
if (overlap(x0.val(),x1.val()))
return ES_FAILED;
} else if (same(x0,x1)) {
return ES_FAILED;
} else {
(void) new (home) Nq<View0,View1>(home,x0,x1);
}
return ES_OK;
}
开发者ID:Wushaowei001,项目名称:vcp,代码行数:12,代码来源:nq.hpp
示例3: operator
void operator () (View1 to, View2 from)
{
auto w = std::min(to.GetWidth(), from.GetWidth());
auto h = std::min(to.GetHeight(), from.GetHeight());
for (size_t i = 0; i < h; i++)
{
auto p1 = to.BeginRow(i);
auto p2 = from.BeginRow(i);
for (size_t j = 0; j < w; j++, p1++, p2++)
{
*p1 = *p2;
}
}
}
开发者ID:hweom,项目名称:ccb,代码行数:14,代码来源:BitmapAlgorithm.hpp
示例4: check_not_alias
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));
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:15,代码来源:vector.cpp
示例5: transform_pixels_progress
GIL_FORCEINLINE
F transform_pixels_progress( const View1& src, const View2& dst, const F& fun, IProgress& p )
{
assert( src.dimensions() == dst.dimensions() );
for( std::ptrdiff_t y = 0; y < src.height(); ++y )
{
typename View1::x_iterator srcIt = src.row_begin( y );
typename View2::x_iterator dstIt = dst.row_begin( y );
for( std::ptrdiff_t x = 0; x < src.width(); ++x )
dstIt[x] = fun( srcIt[x] );
if( p.progressForward( dst.width() ) )
return fun;
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:15,代码来源:algorithm.hpp
示例6: 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();
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:26,代码来源:cblock.cpp
示例7: tbb_transform3_pixels
GIL_FORCEINLINE void tbb_transform3_pixels( const View1& src1, const View2& src2,
const View3& src3, const View4& dst, Fun f)
{
tbb::parallel_for( tbb::blocked_range<std::size_t>( 0, src1.height()),
detail::make_tbb_transform3_pixels_fun( src1, src2, src3, dst, f),
GIL_TBB_ALGORITHMS_DEFAULT_PARTITIONER());
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:7,代码来源:tbb_transform3.hpp
示例8: 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();
}
开发者ID:bambang,项目名称:vsipl,代码行数:26,代码来源:cblock.cpp
示例9: transform_pixels_locator
GIL_FORCEINLINE F transform_pixels_locator(const View1& src1, const Rect<std::ptrdiff_t>& src1Rod, const View2& src2,
const Rect<std::ptrdiff_t>& src2Rod, const View2& src3,
const Rect<std::ptrdiff_t>& src3Rod, const ViewDst& dst,
const Rect<std::ptrdiff_t>& dstRod, const Rect<std::ptrdiff_t>& renderWin,
const F& fun)
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View1::xy_locator s1loc = src1.xy_at(renderWin.x1 - src1Rod.x1, renderWin.y1 - src1Rod.y1);
typename View2::xy_locator s2loc = src2.xy_at(renderWin.x1 - src2Rod.x1, renderWin.y1 - src2Rod.y1);
typename View3::xy_locator s3loc = src3.xy_at(renderWin.x1 - src3Rod.x1, renderWin.y1 - src3Rod.y1);
for(std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y)
{
typename ViewDst::x_iterator dstIt = dst.x_at(dstRod.x1, y - dstRod.y1);
for(std::ptrdiff_t x = renderWin.x1; x < renderWin.x2; ++x, ++s1loc.x(), ++s2loc.x(), ++s3loc.x(), ++dstIt)
{
*dstIt = fun(s1loc, s2loc, s3loc);
}
s1loc.x() -= renderWidth;
++s1loc.y();
s2loc.x() -= renderWidth;
++s2loc.y();
s3loc.x() -= renderWidth;
++s3loc.y();
}
return fun;
}
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:26,代码来源:transform_pixels.hpp
示例10: transform_pixels_locator_progress
GIL_FORCEINLINE
F transform_pixels_locator_progress( const View1& src1, const OfxRectI& src1Rod,
const View2& src2, const OfxRectI& src2Rod,
const ViewDst& dst, const OfxRectI& dstRod,
const OfxRectI& renderWin, const F& fun, IProgress& p )
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View1::xy_locator s1loc = src1.xy_at( renderWin.x1-src1Rod.x1, renderWin.y1-src1Rod.y1 );
typename View2::xy_locator s2loc = src2.xy_at( renderWin.x1-src2Rod.x1, renderWin.y1-src2Rod.y1 );
for( std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y )
{
typename ViewDst::x_iterator dstIt = dst.x_at( dstRod.x1, y-dstRod.y1 );
for( std::ptrdiff_t x = renderWin.x1;
x < renderWin.x2;
++x, ++s1loc.x(), ++s2loc.x(), ++dstIt )
{
*dstIt = fun( s1loc, s2loc );
}
s1loc.x() -= renderWidth; ++s1loc.y();
s2loc.x() -= renderWidth; ++s2loc.y();
if( p.progressForward( renderWidth ) )
return fun;
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:25,代码来源:algorithm.hpp
示例11: checkNewViewWasAllocated
inline void checkNewViewWasAllocated( View1 const &v1, View2 const &v2 )
{
BOOST_TEST( v1.data() != v2.data() );
BOOST_TEST( (int)View1::rank == (int)View2::rank );
BOOST_TEST( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
BOOST_TEST( v1.dimension_0() == v2.dimension_0() );
BOOST_TEST( v1.dimension_1() == v2.dimension_1() );
BOOST_TEST( v1.dimension_2() == v2.dimension_2() );
BOOST_TEST( v1.dimension_3() == v2.dimension_3() );
BOOST_TEST( v1.dimension_4() == v2.dimension_4() );
BOOST_TEST( v1.dimension_5() == v2.dimension_5() );
BOOST_TEST( v1.dimension_6() == v2.dimension_6() );
BOOST_TEST( v1.dimension_7() == v2.dimension_7() );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:17,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例12: check_alias
void
check_alias(
View1<T1, Block1>& vec1,
View2<T2, Block2>& vec2)
{
fill_block(vec1.block(), 2);
test_assert(check_vector(vec1, 2));
test_assert(check_vector(vec2, 2));
fill_block(vec2.block(), 3);
test_assert(check_vector(vec1, 3));
test_assert(check_vector(vec2, 3));
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:13,代码来源:vector.cpp
示例13: switch
ExecStatus PartitionN<View0,View1>::post(Home home, ViewArray<View0>& x,
View1 y) {
switch (x.size()) {
case 0:
GECODE_ME_CHECK(y.cardMax(home, 0));
return ES_OK;
case 1:
return Rel::Eq<View0,View1>::post(home, x[0], y);
default:
(void) new (home) PartitionN<View0,View1>(home,x,y);
return ES_OK;
}
}
开发者ID:lquan,项目名称:CSAI,代码行数:13,代码来源:partition.hpp
示例14: checkViewWasNotAllocated
inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2 )
{
// NOTE: cannot use operator== here because array layout may "change" for
// rank-1 views
BOOST_TEST( v1.data() == v2.data() );
BOOST_TEST( v1.span() == v2.span() );
BOOST_TEST( (int)View1::rank == (int)View2::rank );
BOOST_TEST( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
BOOST_TEST( ( std::is_same<typename View1::memory_space,
typename View2::memory_space>::value ) );
BOOST_TEST( v1.dimension_0() == v2.dimension_0() );
BOOST_TEST( v1.dimension_1() == v2.dimension_1() );
BOOST_TEST( v1.dimension_2() == v2.dimension_2() );
BOOST_TEST( v1.dimension_3() == v2.dimension_3() );
BOOST_TEST( v1.dimension_4() == v2.dimension_4() );
BOOST_TEST( v1.dimension_5() == v2.dimension_5() );
BOOST_TEST( v1.dimension_6() == v2.dimension_6() );
BOOST_TEST( v1.dimension_7() == v2.dimension_7() );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:22,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例15: checkNewViewWasAllocated
inline void checkNewViewWasAllocated( View1 const &v1, View2 const &v2,
bool &success,
Teuchos::FancyOStream &out )
{
TEST_INEQUALITY( v1.data(), v2.data() );
TEST_EQUALITY( (int)View1::rank, (int)View2::rank );
TEST_ASSERT( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
TEST_EQUALITY( v1.dimension_0(), v2.dimension_0() );
TEST_EQUALITY( v1.dimension_1(), v2.dimension_1() );
TEST_EQUALITY( v1.dimension_2(), v2.dimension_2() );
TEST_EQUALITY( v1.dimension_3(), v2.dimension_3() );
TEST_EQUALITY( v1.dimension_4(), v2.dimension_4() );
TEST_EQUALITY( v1.dimension_5(), v2.dimension_5() );
TEST_EQUALITY( v1.dimension_6(), v2.dimension_6() );
TEST_EQUALITY( v1.dimension_7(), v2.dimension_7() );
}
开发者ID:Rombur,项目名称:DataTransferKit,代码行数:19,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例16: checkViewWasNotAllocated
inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2,
bool &success,
Teuchos::FancyOStream &out )
{
// NOTE: cannot use operator== here because array layout may "change" for
// rank-1 views
TEST_EQUALITY( v1.data(), v2.data() );
TEST_EQUALITY( v1.span(), v2.span() );
TEST_EQUALITY( (int)View1::rank, (int)View2::rank );
TEST_ASSERT( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
TEST_ASSERT( ( std::is_same<typename View1::memory_space,
typename View2::memory_space>::value ) );
TEST_EQUALITY( v1.dimension_0(), v2.dimension_0() );
TEST_EQUALITY( v1.dimension_1(), v2.dimension_1() );
TEST_EQUALITY( v1.dimension_2(), v2.dimension_2() );
TEST_EQUALITY( v1.dimension_3(), v2.dimension_3() );
TEST_EQUALITY( v1.dimension_4(), v2.dimension_4() );
TEST_EQUALITY( v1.dimension_5(), v2.dimension_5() );
TEST_EQUALITY( v1.dimension_6(), v2.dimension_6() );
TEST_EQUALITY( v1.dimension_7(), v2.dimension_7() );
}
开发者ID:Rombur,项目名称:DataTransferKit,代码行数:24,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例17: GECODE_ME_CHECK
ExecStatus
Eq<View0,View1>::post(Home home, View0 x0, View1 x1){
if (x0.assigned()) {
GECODE_ME_CHECK(x1.eq(home,x0.val()));
} else if (x1.assigned()) {
GECODE_ME_CHECK(x0.eq(home,x1.val()));
} else if (!same(x0,x1)) {
GECODE_ME_CHECK(x0.lq(home,x1.max()));
GECODE_ME_CHECK(x1.lq(home,x0.max()));
GECODE_ME_CHECK(x0.gq(home,x1.min()));
GECODE_ME_CHECK(x1.gq(home,x0.min()));
(void) new (home) Eq<View0,View1>(home,x0,x1);
}
return ES_OK;
}
开发者ID:Gecode,项目名称:gecode,代码行数:15,代码来源:eq.hpp
示例18: xr
ExecStatus
Distinct<View0,View1>::post(Home home, View0 x, View1 y) {
if (x.assigned()) {
GlbRanges<View0> xr(x);
IntSet xs(xr);
ConstSetView cv(home, xs);
GECODE_ES_CHECK((DistinctDoit<View1>::post(home,y,cv)));
}
if (y.assigned()) {
GlbRanges<View1> yr(y);
IntSet ys(yr);
ConstSetView cv(home, ys);
GECODE_ES_CHECK((DistinctDoit<View0>::post(home,x,cv)));
}
(void) new (home) Distinct<View0,View1>(home,x,y);
return ES_OK;
}
开发者ID:MGKhKhD,项目名称:easy-IP,代码行数:17,代码来源:nq.hpp
示例19: AssignFunctor
AssignFunctor( const View1 view_1, View2 view_2 )
: _view_1( view_1 )
, _view_2( view_2 )
{
static_assert( std::is_same<typename View1::traits::value_type,
typename View2::traits::value_type>::value,
"View data types must be the same" );
static_assert( std::is_same<typename View1::traits::device_type,
typename View2::traits::device_type>::value,
"View device types must be the same" );
static_assert( static_cast<unsigned>( View1::Rank ) == 2,
"View ranks must be 2" );
static_assert( static_cast<unsigned>( View2::Rank ) == 2,
"View ranks must be 2" );
DTK_REQUIRE( view_1.extent( 0 ) == view_2.extent( 0 ) );
DTK_REQUIRE( view_1.extent( 1 ) == view_2.extent( 1 ) );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:17,代码来源:tstKokkosView.cpp
注:本文中的View1类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论