void test_zero_copy_serialization(double d, T1& arg1, std::string const& s,
    int i, T2& arg2)
{
    hpx::naming::id_type const here = hpx::find_here();
    hpx::naming::address addr(hpx::get_locality(),
        hpx::components::component_invalid,
        reinterpret_cast<std::uint64_t>(&test_function2));

    // compose archive flags
    unsigned out_archive_flags = 0U;
#ifdef BOOST_BIG_ENDIAN
    out_archive_flags |= hpx::serialization::endian_big;
#else
    out_archive_flags |= hpx::serialization::endian_little;
#endif

    // create a parcel with/without continuation
    hpx::naming::gid_type dest = here.get_gid();
    hpx::parcelset::parcel outp(
        hpx::parcelset::detail::create_parcel::call(std::true_type(), std::true_type(),
            std::move(dest), std::move(addr),
            hpx::actions::typed_continuation<int>(here),
            test_action3(), hpx::threads::thread_priority_normal, d, arg1, s, i, arg2
        )
    );

    outp.set_source_id(here);

    test_parcel_serialization(std::move(outp), out_archive_flags, true);
}
void test_normal_serialization(T& arg)
{
    hpx::naming::id_type const here = hpx::find_here();
    hpx::naming::address addr(hpx::get_locality(),
        hpx::components::component_invalid,
        reinterpret_cast<std::uint64_t>(&test_function1));

    // compose archive flags
    unsigned out_archive_flags = hpx::serialization::disable_data_chunking;
#ifdef BOOST_BIG_ENDIAN
    out_archive_flags |= hpx::serialization::endian_big;
#else
    out_archive_flags |= hpx::serialization::endian_little;
#endif

    // create a parcel with/without continuation
    hpx::naming::gid_type dest = here.get_gid();
    hpx::parcelset::parcel outp(
        hpx::parcelset::detail::create_parcel::call(std::true_type(), std::true_type(),
            std::move(dest), std::move(addr),
            hpx::actions::typed_continuation<int>(here),
            Action(), hpx::threads::thread_priority_normal, arg
        )
    );

    outp.set_source_id(here);

    test_parcel_serialization(std::move(outp), out_archive_flags, false);
}
Beispiel #3
0
 bool are_from_devices( const hpx::naming::id_type& device1,
                        const hpx::naming::id_type& device2 ){
     hpx::naming::gid_type device_gid1 = device1.get_gid();
     hpx::naming::gid_type device_gid2 = device2.get_gid();
     for(const auto& id : device_ids){
         if((device_gid1 != id) && (device_gid2 != id))
             return false;
     }
     return true;
 }
Beispiel #4
0
 bool are_from_device(const hpx::naming::id_type& device_id){
     hpx::naming::gid_type device_gid = device_id.get_gid();
     for(const auto& id : device_ids){
         if(device_gid != id)
             return false;
     }
     return true;
 }