当前位置: 首页>>代码示例>>C++>>正文


C++ dynamic_bitset::count方法代码示例

本文整理汇总了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;
}
开发者ID:AlexanderStohr,项目名称:gpuocelot,代码行数:43,代码来源:ReconvergenceMechanism.cpp

示例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);
}
开发者ID:sibonli,项目名称:BAli-Phy,代码行数:8,代码来源:partition.C

示例3: range_calculate_size

std::size_t range_calculate_size(boost::dynamic_bitset<I,A> const& c) {
  return c.count();
}
开发者ID:fullstackenviormentss,项目名称:sbmt,代码行数:3,代码来源:bitset.hpp


注:本文中的boost::dynamic_bitset::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。