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; }
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(); }
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(); }
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; }
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; }