LLVM OpenMP 20.0.0git
|
#include "kmp.h"
#include "kmp_error.h"
#include "kmp_i18n.h"
#include "kmp_itt.h"
#include "kmp_stats.h"
#include "kmp_str.h"
#include "kmp_collapse.h"
Go to the source code of this file.
Classes | |
class | CollapseAllocator< T > |
Macros | |
#define | level_of_precision 0.1 |
#define level_of_precision 0.1 |
Definition at line 1333 of file kmp_collapse.cpp.
kmp_uint32 __kmp_abs | ( | const kmp_uint32 | val | ) |
Definition at line 32 of file kmp_collapse.cpp.
References val.
kmp_uint64 __kmp_abs | ( | const kmp_uint64 | val | ) |
Definition at line 33 of file kmp_collapse.cpp.
References val.
T __kmp_abs | ( | const T | val | ) |
Definition at line 29 of file kmp_collapse.cpp.
References val.
Referenced by kmp_calc_number_of_iterations_XX(), and kmp_calculate_trip_count_XX().
int __kmp_sign | ( | T | val | ) |
Definition at line 39 of file kmp_collapse.cpp.
References val.
Referenced by kmp_calc_new_bounds_XX().
void __kmpc_calc_original_ivs_rectang | ( | ident_t * | loc, |
kmp_loop_nest_iv_t | new_iv, | ||
const bounds_info_t * | original_bounds_nest, | ||
kmp_uint64 * | original_ivs, | ||
kmp_index_t | n | ||
) |
Definition at line 488 of file kmp_collapse.cpp.
References KMP_ASSERT, and kmp_calc_one_iv_rectang().
kmp_int32 __kmpc_for_collapsed_init | ( | ident_t * | loc, |
kmp_int32 | gtid, | ||
bounds_info_t * | original_bounds_nest, | ||
bounds_info_t * | chunk_bounds_nest, | ||
kmp_index_t | n, | ||
kmp_int32 * | plastiter | ||
) |
Definition at line 1588 of file kmp_collapse.cpp.
References __kmp_assert_valid_gtid(), __kmp_env_consistency_check, __kmp_push_workshare(), __kmp_threads, __kmp_tid_from_gtid(), chunk_size, ct_pdo, FALSE, i, KE_TRACE, kmp_calc_new_iv_from_original_ivs(), kmp_calc_next_original_ivs(), kmp_calc_original_ivs_for_chunk_end(), kmp_calc_original_ivs_for_end(), kmp_calc_original_ivs_for_start(), kmp_canonicalize_loop_nest(), KMP_DEBUG_ASSERT, kmp_handle_lower_triangle_matrix(), kmp_handle_upper_triangle_matrix(), kmp_identify_nested_loop_structure(), kmp_process_loop_nest(), bounds_info_t::lb0_u64, bounds_info_t::lb1_u64, loc, nested_loop_type_lower_triangular_matrix, nested_loop_type_upper_triangular_matrix, kmp_team::t, TRUE, bounds_info_t::ub0_u64, and bounds_info_t::ub1_u64.
kmp_loop_nest_iv_t __kmpc_process_loop_nest_rectang | ( | ident_t * | loc, |
kmp_int32 | gtid, | ||
bounds_info_t * | original_bounds_nest, | ||
kmp_index_t | n | ||
) |
Definition at line 460 of file kmp_collapse.cpp.
References kmp_calculate_trip_count(), kmp_canonicalize_loop_nest(), and loc.
void kmp_calc_new_bounds_XX | ( | bounds_info_internalXX_template< T > * | bounds, |
bounds_info_internal_t * | bounds_nest | ||
) |
Definition at line 676 of file kmp_collapse.cpp.
References __kmp_sign(), add, bounds_info_internalXX_template< T >::b, comp_greater_or_eq, comp_less_or_eq, KMP_ASSERT, bounds_info_internalXX_template< T >::loop_bounds_adjusted, bounds_info_internalXX_template< T >::span_biggest, bounds_info_internalXX_template< T >::span_smallest, and sub.
Referenced by kmp_process_one_loop_XX().
kmp_loop_nest_iv_t kmp_calc_new_iv_from_original_ivs | ( | const bounds_info_internal_t * | bounds_nest, |
const kmp_point_t | original_ivs, | ||
kmp_index_t | n | ||
) |
Definition at line 886 of file kmp_collapse.cpp.
References bounds_info_internal_t::b, and kmp_calc_number_of_iterations().
Referenced by __kmpc_for_collapsed_init().
bool kmp_calc_next_original_ivs | ( | const bounds_info_t * | original_bounds_nest, |
kmp_index_t | n, | ||
const kmp_point_t | original_ivs, | ||
kmp_point_t | next_original_ivs | ||
) |
Definition at line 969 of file kmp_collapse.cpp.
References b, kmp_calc_number_of_iterations(), and kmp_calc_original_ivs_from_iterations().
Referenced by __kmpc_for_collapsed_init().
kmp_loop_nest_iv_t kmp_calc_number_of_iterations | ( | const bounds_info_t * | bounds, |
const kmp_point_t | original_ivs, | ||
kmp_index_t | ind | ||
) |
Definition at line 851 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by kmp_calc_new_iv_from_original_ivs(), and kmp_calc_next_original_ivs().
kmp_loop_nest_iv_t kmp_calc_number_of_iterations_XX | ( | const bounds_infoXX_template< T > * | bounds, |
const kmp_point_t | original_ivs, | ||
kmp_index_t | ind | ||
) |
Definition at line 827 of file kmp_collapse.cpp.
References __kmp_abs(), comp_greater_or_eq, comp_less_or_eq, bounds_infoXX_template< T >::comparison, KMP_DEBUG_ASSERT, bounds_infoXX_template< T >::lb0, bounds_infoXX_template< T >::lb1, bounds_infoXX_template< T >::outer_iv, and bounds_infoXX_template< T >::step.
bool kmp_calc_one_iv | ( | const bounds_info_t * | bounds, |
kmp_point_t | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind, | ||
bool | start_with_lower_bound, | ||
bool | checkBounds | ||
) |
Definition at line 357 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by kmp_calc_original_ivs_from_iterations().
void kmp_calc_one_iv_end | ( | const bounds_info_t * | bounds, |
kmp_point_t | original_ivs, | ||
kmp_index_t | ind | ||
) |
Definition at line 1233 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by kmp_calc_original_ivs_for_end().
void kmp_calc_one_iv_end_XX | ( | const bounds_infoXX_template< T > * | bounds, |
kmp_point_t | original_ivs, | ||
kmp_index_t | ind | ||
) |
Definition at line 1223 of file kmp_collapse.cpp.
References kmp_fix_iv(), bounds_infoXX_template< T >::loop_iv_type, bounds_infoXX_template< T >::outer_iv, bounds_infoXX_template< T >::ub0, and bounds_infoXX_template< T >::ub1.
bool kmp_calc_one_iv_for_chunk_end | ( | const bounds_info_t * | bounds, |
const bounds_info_t * | updated_bounds, | ||
kmp_point_t | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind, | ||
bool | start_with_lower_bound, | ||
bool | compare_with_start, | ||
const kmp_point_t | original_ivs_start | ||
) |
Definition at line 1086 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by kmp_calc_original_ivs_for_chunk_end().
bool kmp_calc_one_iv_for_chunk_end_XX | ( | const bounds_infoXX_template< T > * | bounds, |
const bounds_infoXX_template< T > * | updated_bounds, | ||
kmp_point_t | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind, | ||
bool | start_with_lower_bound, | ||
bool | compare_with_start, | ||
const kmp_point_t | original_ivs_start | ||
) |
Definition at line 1002 of file kmp_collapse.cpp.
References comp_greater_or_eq, comp_less_or_eq, bounds_infoXX_template< T >::comparison, kmp_fix_iv(), bounds_infoXX_template< T >::lb0, bounds_infoXX_template< T >::lb1, bounds_infoXX_template< T >::loop_iv_type, bounds_infoXX_template< T >::outer_iv, bounds_infoXX_template< T >::step, bounds_infoXX_template< T >::ub0, and bounds_infoXX_template< T >::ub1.
void kmp_calc_one_iv_rectang | ( | const bounds_info_t * | bounds, |
kmp_uint64 * | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind | ||
) |
Definition at line 415 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by __kmpc_calc_original_ivs_rectang().
void kmp_calc_one_iv_rectang_XX | ( | const bounds_infoXX_template< T > * | bounds, |
kmp_uint64 * | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind | ||
) |
Definition at line 399 of file kmp_collapse.cpp.
References kmp_fix_iv(), bounds_infoXX_template< T >::lb0, bounds_infoXX_template< T >::lb1, bounds_infoXX_template< T >::loop_iv_type, bounds_infoXX_template< T >::outer_iv, and bounds_infoXX_template< T >::step.
bool kmp_calc_one_iv_XX | ( | const bounds_infoXX_template< T > * | bounds, |
kmp_point_t | original_ivs, | ||
const kmp_iterations_t | iterations, | ||
kmp_index_t | ind, | ||
bool | start_with_lower_bound, | ||
bool | checkBounds | ||
) |
bool kmp_calc_original_ivs_for_chunk_end | ( | const bounds_info_t * | original_bounds_nest, |
kmp_index_t | n, | ||
const bounds_info_internal_t * | updated_bounds_nest, | ||
const kmp_point_t | original_ivs_start, | ||
kmp_loop_nest_iv_t | new_iv, | ||
kmp_point_t | original_ivs | ||
) |
Definition at line 1147 of file kmp_collapse.cpp.
References bounds_info_internal_t::b, i, kmp_calc_one_iv_for_chunk_end(), KMP_DEBUG_ASSERT, kmp_ivs_eq(), and bounds_info_t::trip_count.
Referenced by __kmpc_for_collapsed_init().
void kmp_calc_original_ivs_for_end | ( | const bounds_info_t *const | original_bounds_nest, |
kmp_index_t | n, | ||
kmp_point_t | original_ivs | ||
) |
Definition at line 1266 of file kmp_collapse.cpp.
References kmp_calc_one_iv_end().
Referenced by __kmpc_for_collapsed_init().
bool kmp_calc_original_ivs_for_start | ( | const bounds_info_t * | original_bounds_nest, |
kmp_index_t | n, | ||
kmp_point_t | original_ivs | ||
) |
Definition at line 947 of file kmp_collapse.cpp.
References b, and kmp_calc_original_ivs_from_iterations().
Referenced by __kmpc_for_collapsed_init().
bool kmp_calc_original_ivs_from_iterations | ( | const bounds_info_t * | original_bounds_nest, |
kmp_index_t | n, | ||
kmp_point_t | original_ivs, | ||
kmp_iterations_t | iterations, | ||
kmp_index_t | ind | ||
) |
Definition at line 907 of file kmp_collapse.cpp.
References i, and kmp_calc_one_iv().
Referenced by kmp_calc_next_original_ivs(), and kmp_calc_original_ivs_for_start().
void kmp_calc_span_greateroreq_XX | ( | bounds_info_internalXX_template< T > * | bounds, |
bounds_info_internal_t * | bounds_nest | ||
) |
Definition at line 592 of file kmp_collapse.cpp.
References bounds_info_internalXX_template< T >::b, bounds_info_internalXX_template< T >::loop_bounds_adjusted, bounds_info_internalXX_template< T >::span_biggest, and bounds_info_internalXX_template< T >::span_smallest.
Referenced by kmp_calc_span_XX().
void kmp_calc_span_lessoreq_XX | ( | bounds_info_internalXX_template< T > * | bounds, |
bounds_info_internal_t * | bounds_nest | ||
) |
Definition at line 528 of file kmp_collapse.cpp.
References bounds_info_internalXX_template< T >::b, bounds_info_internalXX_template< T >::loop_bounds_adjusted, bounds_info_internalXX_template< T >::span_biggest, and bounds_info_internalXX_template< T >::span_smallest.
Referenced by kmp_calc_span_XX().
void kmp_calc_span_XX | ( | bounds_info_internalXX_template< T > * | bounds, |
bounds_info_internal_t * | bounds_nest | ||
) |
Definition at line 657 of file kmp_collapse.cpp.
References bounds_info_internalXX_template< T >::b, comp_greater_or_eq, comp_less_or_eq, KMP_ASSERT, kmp_calc_span_greateroreq_XX(), and kmp_calc_span_lessoreq_XX().
Referenced by kmp_process_one_loop_XX().
kmp_loop_nest_iv_t kmp_calculate_trip_count | ( | bounds_info_t * | bounds | ) |
Definition at line 189 of file kmp_collapse.cpp.
References KMP_ASSERT, bounds_info_t::loop_type, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by __kmpc_process_loop_nest_rectang().
kmp_loop_nest_iv_t kmp_calculate_trip_count_XX | ( | bounds_infoXX_template< T > * | bounds | ) |
Definition at line 153 of file kmp_collapse.cpp.
References __kmp_abs(), comp_greater_or_eq, comp_less_or_eq, bounds_infoXX_template< T >::comparison, KMP_ASSERT, bounds_infoXX_template< T >::lb0, bounds_infoXX_template< T >::step, bounds_infoXX_template< T >::trip_count, and bounds_infoXX_template< T >::ub0.
Referenced by kmp_process_one_loop_XX().
void kmp_canonicalize_loop_nest | ( | ident_t * | loc, |
bounds_info_t * | original_bounds_nest, | ||
kmp_index_t | n | ||
) |
Definition at line 109 of file kmp_collapse.cpp.
References KMP_ASSERT, loc, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by __kmpc_for_collapsed_init(), and __kmpc_process_loop_nest_rectang().
void kmp_canonicalize_one_loop_XX | ( | ident_t * | loc, |
bounds_infoXX_template< T > * | bounds | ||
) |
Definition at line 76 of file kmp_collapse.cpp.
References __kmp_env_consistency_check, __kmp_error_construct(), comp_greater, comp_greater_or_eq, comp_less, comp_less_or_eq, comp_not_eq, bounds_infoXX_template< T >::comparison, ct_pdo, loc, bounds_infoXX_template< T >::step, and bounds_infoXX_template< T >::ub0.
kmp_uint64 kmp_fix_iv | ( | loop_type_t | loop_iv_type, |
kmp_uint64 | original_iv | ||
) |
Definition at line 222 of file kmp_collapse.cpp.
References KMP_ASSERT, kmp_int16, kmp_int8, loop_type_int16, loop_type_int32, loop_type_int64, loop_type_int8, loop_type_uint16, loop_type_uint32, loop_type_uint64, loop_type_uint8, and res.
Referenced by kmp_calc_one_iv_end_XX(), kmp_calc_one_iv_for_chunk_end_XX(), kmp_calc_one_iv_rectang_XX(), kmp_calc_one_iv_XX(), kmp_handle_lower_triangle_matrix(), kmp_handle_upper_triangle_matrix(), and kmp_identify_nested_loop_structure().
void kmp_handle_lower_triangle_matrix | ( | kmp_uint32 | nth, |
kmp_uint32 | tid, | ||
kmp_index_t | n, | ||
bounds_info_t * | original_bounds_nest, | ||
bounds_info_t * | chunk_bounds_nest | ||
) |
Definition at line 1349 of file kmp_collapse.cpp.
References i, kmp_fix_iv(), bounds_info_t::lb0_u64, bounds_info_t::lb1_u64, sqrt_newton_approx(), bounds_info_t::ub0_u64, and bounds_info_t::ub1_u64.
Referenced by __kmpc_for_collapsed_init().
void kmp_handle_upper_triangle_matrix | ( | kmp_uint32 | nth, |
kmp_uint32 | tid, | ||
kmp_index_t | n, | ||
bounds_info_t * | original_bounds_nest, | ||
bounds_info_t * | chunk_bounds_nest | ||
) |
Definition at line 1469 of file kmp_collapse.cpp.
References i, kmp_fix_iv(), bounds_info_t::lb0_u64, bounds_info_t::lb1_u64, sqrt_newton_approx(), bounds_info_t::ub0_u64, and bounds_info_t::ub1_u64.
Referenced by __kmpc_for_collapsed_init().
nested_loop_type_t kmp_identify_nested_loop_structure | ( | bounds_info_t * | original_bounds_nest, |
kmp_index_t | n | ||
) |
Definition at line 1284 of file kmp_collapse.cpp.
References comp_less_or_eq, KMP_ASSERT, kmp_fix_iv(), nested_loop_type_lower_triangular_matrix, nested_loop_type_unkown, and nested_loop_type_upper_triangular_matrix.
Referenced by __kmpc_for_collapsed_init().
bool kmp_iv_is_in_upper_bound_XX | ( | const bounds_infoXX_template< T > * | bounds, |
const kmp_point_t | original_ivs, | ||
kmp_index_t | ind | ||
) |
Definition at line 308 of file kmp_collapse.cpp.
References comp_greater_or_eq, comp_less_or_eq, bounds_infoXX_template< T >::comparison, bounds_infoXX_template< T >::outer_iv, bounds_infoXX_template< T >::ub0, and bounds_infoXX_template< T >::ub1.
Referenced by kmp_calc_one_iv_XX().
bool kmp_ivs_eq | ( | loop_type_t | loop_iv_type, |
kmp_uint64 | original_iv1, | ||
kmp_uint64 | original_iv2 | ||
) |
Definition at line 259 of file kmp_collapse.cpp.
References KMP_ASSERT, kmp_int16, kmp_int8, loop_type_int16, loop_type_int32, loop_type_int64, loop_type_int8, loop_type_uint16, loop_type_uint32, loop_type_uint64, loop_type_uint8, and res.
Referenced by kmp_calc_original_ivs_for_chunk_end().
kmp_loop_nest_iv_t kmp_process_loop_nest | ( | bounds_info_internal_t * | bounds_nest, |
kmp_index_t | n | ||
) |
Definition at line 781 of file kmp_collapse.cpp.
References KMP_ASSERT, loop_type_int32, loop_type_int64, loop_type_uint32, and loop_type_uint64.
Referenced by __kmpc_for_collapsed_init().
kmp_loop_nest_iv_t kmp_process_one_loop_XX | ( | bounds_info_internalXX_template< T > * | bounds, |
bounds_info_internal_t * | bounds_nest | ||
) |
Definition at line 767 of file kmp_collapse.cpp.
References bounds_info_internalXX_template< T >::b, kmp_calc_new_bounds_XX(), kmp_calc_span_XX(), and kmp_calculate_trip_count_XX().
double sqrt_newton_approx | ( | kmp_uint64 | x | ) |
Definition at line 1334 of file kmp_collapse.cpp.
References double, and level_of_precision.
Referenced by kmp_handle_lower_triangle_matrix(), and kmp_handle_upper_triangle_matrix().