本文整理汇总了C++中Globals::GetGlobalStructVar方法的典型用法代码示例。如果您正苦于以下问题:C++ Globals::GetGlobalStructVar方法的具体用法?C++ Globals::GetGlobalStructVar怎么用?C++ Globals::GetGlobalStructVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::GetGlobalStructVar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OutputEntryFunction
void CLOutputMgr::OutputEntryFunction(Globals& globals) {
// Would ideally use the ExtensionMgr, but there is no way to set it to our
// own custom made one (without modifying the code).
std::ostream& out = get_main_out();
out << "__kernel void entry(__global ulong *result";
if (CLOptions::atomics()) {
out << ", __global volatile uint *g_atomic_input";
out << ", __global volatile uint *g_special_values";
}
if (CLOptions::atomic_reductions()) {
out << ", __global volatile int *g_atomic_reduction";
}
if (CLOptions::emi())
out << ", __global int *emi_input";
if (CLOptions::fake_divergence())
out << ", __global int *sequence_input";
if (CLOptions::inter_thread_comm())
out << ", __global long *g_comm_values";
out << ") {" << std::endl;
globals.OutputArrayControlVars(out);
globals.OutputBufferInits(out);
globals.OutputStructInit(out);
// Block all threads before entering to ensure the local buffers have been
// initialised.
output_tab(out, 1);
StatementBarrier::OutputBarrier(out);
out << std::endl;
output_tab(out, 1);
out << "func_1(";
globals.GetGlobalStructVar().Output(out);
out << ");" << std::endl;
// If using message passing, check and update constraints to prevent deadlock.
if (CLOptions::message_passing())
MessagePassing::OutputMessageEndChecks(out);
// Block all threads after, to prevent hashing stale values.
output_tab(out, 1);
StatementBarrier::OutputBarrier(out);
out << std::endl;
// Handle hashing and outputting.
output_tab(out, 1);
out << "uint64_t crc64_context = 0xFFFFFFFFFFFFFFFFUL;" << std::endl;
output_tab(out, 1);
out << "int print_hash_value = 0;" << std::endl;
HashGlobalVariables(out);
if (CLOptions::atomics())
ExpressionAtomic::OutputHashing(out);
if (CLOptions::inter_thread_comm()) StatementComm::HashCommValues(out);
output_tab(out, 1);
out << "result[get_linear_global_id()] = crc64_context ^ 0xFFFFFFFFFFFFFFFFUL;"
<< std::endl;
out << "}" << std::endl;
}