本文整理汇总了C++中hpx::partitioned_vector::size方法的典型用法代码示例。如果您正苦于以下问题:C++ partitioned_vector::size方法的具体用法?C++ partitioned_vector::size怎么用?C++ partitioned_vector::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hpx::partitioned_vector
的用法示例。
在下文中一共展示了partitioned_vector::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verify_values_count_async
void verify_values_count_async(ExPolicy && policy,
hpx::partitioned_vector<T> const& v, U const& val)
{
HPX_TEST_EQ(
std::size_t(hpx::parallel::count(
policy, v.begin(), v.end(), val).get()),
v.size());
HPX_TEST_EQ(
std::size_t(hpx::parallel::count_if(
policy, v.begin(), v.end(), cmp<T>(val)).get()),
v.size());
}
示例2: exclusive_scan_algo_tests_with_policy
void exclusive_scan_algo_tests_with_policy(
std::size_t size, DistPolicy const& dist_policy,
hpx::partitioned_vector<T>& in,
std::vector<T> ver, ExPolicy const& policy)
{
msg7(typeid(ExPolicy).name(), typeid(DistPolicy).name(), typeid(T).name(),
regular, size, dist_policy.get_num_partitions(),
dist_policy.get_localities().size());
hpx::util::high_resolution_timer t1;
std::vector<T> out(in.size());
T val(0);
double e1 = t1.elapsed();
t1.restart();
hpx::parallel::exclusive_scan(policy,
in.begin(), in.end(), out.begin(), val, opt<T>());
double e2 = t1.elapsed();
t1.restart();
HPX_TEST(std::equal(out.begin(), out.end(), ver.begin()));
double e3 = t1.elapsed();
std::cout << std::setprecision(4) << "\t" << e1 << " " << e2 << " " << e3 << "\n";
}
示例3: compare_vectors
void compare_vectors(hpx::partitioned_vector<T> const& v1,
hpx::partitioned_vector<T> const& v2, bool must_be_equal = true)
{
typedef typename hpx::partitioned_vector<T>::const_iterator const_iterator;
HPX_TEST_EQ(v1.size(), v2.size());
const_iterator it1 = v1.begin(), it2 = v2.begin();
const_iterator end1 = v1.end(), end2 = v2.end();
for (/**/; it1 != end1 && it2 != end2; ++it1, ++it2)
{
if (must_be_equal)
{
HPX_TEST_EQ(*it1, *it2);
}
else
{
HPX_TEST_NEQ(*it1, *it2);
}
}
}
示例4: verify_values
void verify_values(ExPolicy && policy, hpx::partitioned_vector<T> const& v,
U const& val)
{
typedef typename hpx::partitioned_vector<T>::const_iterator const_iterator;
std::size_t size = 0;
const_iterator end = v.end();
for (const_iterator it = v.begin(); it != end; ++it, ++size)
{
HPX_TEST_EQ(*it, val);
}
HPX_TEST_EQ(size, v.size());
}