本文整理汇总了C++中boost::dynamic_bitset::count方法的典型用法代码示例。如果您正苦于以下问题:C++ dynamic_bitset::count方法的具体用法?C++ dynamic_bitset::count怎么用?C++ dynamic_bitset::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::dynamic_bitset
的用法示例。
在下文中一共展示了dynamic_bitset::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: branchContext
bool executive::ReconvergenceBarrier::eval_Bra(executive::CTAContext &context,
const ir::PTXInstruction &instr,
const boost::dynamic_bitset<> & branch,
const boost::dynamic_bitset<> & fallthrough) {
bool isDivergent = false;
if (instr.uni) {
// unfiorm
if (branch.count()) {
// all threads branch
context.PC = instr.branchTargetInstruction;
}
else {
// all threads fall through
context.PC ++;
}
}
else {
// divergence - complicated
CTAContext branchContext(context), fallthroughContext(context);
branchContext.active = branch;
branchContext.PC = instr.branchTargetInstruction;
fallthroughContext.active = fallthrough;
fallthroughContext.PC++;
runtimeStack.pop_back();
if (branchContext.active.any()) {
runtimeStack.push_back(branchContext);
}
if (fallthroughContext.active.any()) {
runtimeStack.push_back(fallthroughContext);
}
isDivergent = true;
}
return isDivergent;
}
示例2: informative
/// \brief Check if the split is informative
///
/// \param p The split
bool informative(const boost::dynamic_bitset<>& p) {
int N = p.size();
int C = p.count();
return (C >= 2) and ((N-C) >= 2);
}
示例3: range_calculate_size
std::size_t range_calculate_size(boost::dynamic_bitset<I,A> const& c) {
return c.count();
}