本文整理汇总了C++中tl::Symbol::get_user_defined_type方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::get_user_defined_type方法的具体用法?C++ Symbol::get_user_defined_type怎么用?C++ Symbol::get_user_defined_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tl::Symbol
的用法示例。
在下文中一共展示了Symbol::get_user_defined_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loop_spawn_worksharing
void LoweringVisitor::loop_spawn_worksharing(OutlineInfo& outline_info,
Nodecl::NodeclBase construct,
Nodecl::List distribute_environment,
Nodecl::RangeLoopControl& range,
const std::string& outline_name,
TL::Symbol structure_symbol,
TL::Symbol slicer_descriptor,
Nodecl::NodeclBase task_label)
{
Symbol enclosing_function = Nodecl::Utils::get_enclosing_function(construct);
Nodecl::OpenMP::Schedule schedule = distribute_environment.find_first<Nodecl::OpenMP::Schedule>();
ERROR_CONDITION(schedule.is_null(), "Schedule tree is missing", 0);
Nodecl::NodeclBase lower = range.get_lower();
Nodecl::NodeclBase upper = range.get_upper();
Nodecl::NodeclBase step = range.get_step();
Source struct_size, dynamic_size, struct_arg_type_name;
struct_arg_type_name
<< ((structure_symbol.get_type().is_template_specialized_type()
&& structure_symbol.get_type().is_dependent()) ? "typename " : "")
<< structure_symbol.get_qualified_name(enclosing_function.get_scope())
;
struct_size << "sizeof( " << struct_arg_type_name << " )" << dynamic_size;
Source immediate_decl;
allocate_immediate_structure(
structure_symbol.get_user_defined_type(),
outline_info,
struct_arg_type_name,
struct_size,
// out
immediate_decl,
dynamic_size);
Source call_outline_function;
Source schedule_setup;
schedule_setup
<< "int nanos_chunk;"
;
if (schedule.get_text() == "runtime")
{
schedule_setup
<< "nanos_omp_sched_t nanos_runtime_sched;"
<< "nanos_err = nanos_omp_get_schedule(&nanos_runtime_sched, &nanos_chunk);"
<< "if (nanos_err != NANOS_OK)"
<< "nanos_handle_error(nanos_err);"
<< "nanos_ws_t current_ws_policy = nanos_omp_find_worksharing(nanos_runtime_sched);"
;
}
else
{
Source schedule_name;
if (Nanos::Version::interface_is_at_least("openmp", 8))
{
schedule_name << "nanos_omp_sched_" << schedule.get_text();
}
else
{
// We used nanos_omp_sched in versions prior to 8
schedule_name << "omp_sched_" << schedule.get_text();
}
schedule_setup
<< "nanos_ws_t current_ws_policy = nanos_omp_find_worksharing(" << schedule_name << ");"
<< "if (current_ws_policy == 0)"
<< "nanos_handle_error(NANOS_UNIMPLEMENTED);"
<< "nanos_chunk = " << as_expression(schedule.get_chunk()) << ";"
;
}
Source worksharing_creation;
if (IS_CXX_LANGUAGE)
{
worksharing_creation
<< as_statement(Nodecl::CxxDef::make(Nodecl::NodeclBase::null(), slicer_descriptor));
}
worksharing_creation
<< "nanos_err = nanos_worksharing_create("
<< "&" << as_symbol(slicer_descriptor) << ","
<< "current_ws_policy,"
<< "(void**)&nanos_setup_info_loop,"
<< "&single_guard);"
<< "if (nanos_err != NANOS_OK)"
<< "nanos_handle_error(nanos_err);"
;
Nodecl::NodeclBase fill_outline_arguments_tree, fill_immediate_arguments_tree;
TL::Source pm_specific_code;
if (!_lowering->in_ompss_mode())
{
// OpenMP
//.........这里部分代码省略.........