File Coverage: lib/OpenMP/Environment/Constants.pm

# File Coverage

File: | lib/OpenMP/Environment/Constants.pm
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 |  |  |  |  |  |  | package OpenMP::Environment::Constants;
2 | 8 8 8 |  |  | 8 |  | 44 10 207 | use strict;
3 | 8 8 8 |  |  | 8 |  | 31 9 308 | use warnings;
4 |
5 | 8 8 8 |  |  | 8 |  | 44 11 330 | use Exporter qw/import/;
6 |
7 |  |  |  |  |  |  | our $VERSION = q{1.5.0};
8 |
9 | 8 8 8 |  |  | 8 |  | 35 13 598 | use constant omp_cancellation => q{OMP_CANCELLATION};
10 | 8 8 8 |  |  | 8 |  | 35 23 374 | use constant omp_display_env => q{OMP_DISPLAY_ENV};
11 | 8 8 8 |  |  | 8 |  | 31 12 364 | use constant omp_default_device => q{OMP_DEFAULT_DEVICE};
12 | 8 8 8 |  |  | 8 |  | 39 19 343 | use constant omp_num_teams => q{OMP_NUM_TEAMS};
13 | 8 8 8 |  |  | 8 |  | 34 8 418 | use constant omp_dynamic => q{OMP_DYNAMIC};
14 | 8 8 8 |  |  | 8 |  | 35 7 323 | use constant omp_max_active_levels => q{OMP_MAX_ACTIVE_LEVELS};
15 | 8 8 8 |  |  | 8 |  | 31 15 322 | use constant omp_max_task_priority => q{OMP_MAX_TASK_PRIORITY};
16 | 8 8 8 |  |  | 8 |  | 34 10 346 | use constant omp_nested => q{OMP_NESTED};
17 | 8 8 8 |  |  | 8 |  | 36 9 345 | use constant omp_num_threads => q{OMP_NUM_THREADS};
18 | 8 8 8 |  |  | 8 |  | 31 9 355 | use constant omp_proc_bind => q{OMP_PROC_BIND};
19 | 8 8 8 |  |  | 8 |  | 30 9 313 | use constant omp_places => q{OMP_PLACES};
20 | 8 8 8 |  |  | 8 |  | 31 13 329 | use constant omp_stacksize => q{OMP_STACKSIZE};
21 | 8 8 8 |  |  | 8 |  | 34 20 373 | use constant omp_schedule => q{OMP_SCHEDULE};
22 | 8 8 8 |  |  | 8 |  | 50 11 315 | use constant omp_target_offload => q{OMP_TARGET_OFFLOAD};
23 | 8 8 8 |  |  | 8 |  | 32 22 350 | use constant omp_thread_limit => q{OMP_THREAD_LIMIT};
24 | 8 8 8 |  |  | 8 |  | 38 11 330 | use constant omp_wait_policy => q{OMP_WAIT_POLICY};
25 | 8 8 8 |  |  | 8 |  | 71 13 331 | use constant gomp_cpu_affinity => q{GOMP_CPU_AFFINITY};
26 | 8 8 8 |  |  | 8 |  | 34 9 365 | use constant gomp_debug => q{GOMP_DEBUG};
27 | 8 8 8 |  |  | 8 |  | 35 23 324 | use constant gomp_stacksize => q{GOMP_STACKSIZE};
28 | 8 8 8 |  |  | 8 |  | 32 9 331 | use constant gomp_spincount => q{GOMP_SPINCOUNT};
29 | 8 8 8 |  |  | 8 |  | 32 8 327 | use constant gomp_rtems_thread_pools => q{GOMP_RTEMS_THREAD_POOLS};
30 | 8 8 8 |  |  | 8 |  | 33 15 338 | use constant omp_teams_thread_limit => q{OMP_TEAMS_THREAD_LIMIT};
31 | 8 8 8 |  |  | 8 |  | 31 9 311 | use constant omp_allocator => q{OMP_ALLOCATOR};
32 | 8 8 8 |  |  | 8 |  | 33 16 310 | use constant omp_affinity_format => q{OMP_AFFINITY_FORMAT};
33 | 8 8 8 |  |  | 8 |  | 32 8 1846 | use constant omp_display_affinity => q{OMP_DISPLAY_AFFINITY};
34 |
35 |  |  |  |  |  |  | our @CONSTANT_NAMES = qw/
36 |  |  |  |  |  |  | omp_cancellation omp_display_env omp_default_device omp_num_teams
37 |  |  |  |  |  |  | omp_dynamic omp_max_active_levels omp_max_task_priority omp_nested
38 |  |  |  |  |  |  | omp_num_threads omp_proc_bind omp_places omp_stacksize omp_schedule
39 |  |  |  |  |  |  | omp_target_offload omp_thread_limit omp_wait_policy gomp_cpu_affinity
40 |  |  |  |  |  |  | gomp_debug gomp_stacksize gomp_spincount gomp_rtems_thread_pools
41 |  |  |  |  |  |  | omp_teams_thread_limit omp_allocator omp_affinity_format
42 |  |  |  |  |  |  | omp_display_affinity
43 |  |  |  |  |  |  | /;
44 |
45 |  |  |  |  |  |  | our @ENVIRONMENT_NAMES = map { __PACKAGE__->can($_)->() } @CONSTANT_NAMES;
46 |  |  |  |  |  |  | our @EXPORT_OK = @CONSTANT_NAMES;
47 |  |  |  |  |  |  | our %EXPORT_TAGS = ( all => \@CONSTANT_NAMES );
48 |
49 |  |  |  |  |  |  | sub constant_names {
50 | 10 |  |  | 10 | 1 | 33 | return @CONSTANT_NAMES;
51 |  |  |  |  |  |  | }
52 |
53 |  |  |  |  |  |  | sub environment_names {
54 | 96 |  |  | 96 | 1 | 479 | return @ENVIRONMENT_NAMES;
55 |  |  |  |  |  |  | }
56 |
57 |  |  |  |  |  |  | sub is_environment_name {
58 | 1157 |  |  | 1157 | 1 | 1325 | my ($name) = @_;
59 | 1157 28925 |  |  |  |  | 1542 30349 | return scalar grep { $_ eq $name } @ENVIRONMENT_NAMES;
60 |  |  |  |  |  |  | }
61 |
62 |  |  |  |  |  |  | 1;
63 |