#[repr(C)]pub enum DirectiveKind {
Show 69 variants
Parallel = 0,
ParallelFor = 1,
ParallelForSimd = 2,
ParallelSections = 3,
ParallelWorkshare = 4,
ParallelLoop = 5,
ParallelMasked = 6,
ParallelMaster = 7,
For = 10,
ForSimd = 11,
Sections = 12,
Section = 13,
Single = 14,
Workshare = 15,
Loop = 16,
Simd = 20,
DeclareSimd = 21,
Task = 30,
Taskloop = 31,
TaskloopSimd = 32,
Taskyield = 33,
Taskwait = 34,
Taskgroup = 35,
Target = 40,
TargetData = 41,
TargetEnterData = 42,
TargetExitData = 43,
TargetUpdate = 44,
TargetParallel = 45,
TargetParallelFor = 46,
TargetParallelForSimd = 47,
TargetParallelLoop = 48,
TargetSimd = 49,
TargetTeams = 50,
TargetTeamsDistribute = 51,
TargetTeamsDistributeSimd = 52,
TargetTeamsDistributeParallelFor = 53,
TargetTeamsDistributeParallelForSimd = 54,
TargetTeamsLoop = 55,
Teams = 60,
TeamsDistribute = 61,
TeamsDistributeSimd = 62,
TeamsDistributeParallelFor = 63,
TeamsDistributeParallelForSimd = 64,
TeamsLoop = 65,
Barrier = 70,
Critical = 71,
Atomic = 72,
Flush = 73,
Ordered = 74,
Master = 75,
Masked = 76,
DeclareReduction = 80,
DeclareMapper = 81,
DeclareTarget = 82,
DeclareVariant = 83,
Distribute = 90,
DistributeSimd = 91,
DistributeParallelFor = 92,
DistributeParallelForSimd = 93,
Metadirective = 100,
Threadprivate = 110,
Allocate = 111,
Requires = 112,
Scan = 113,
Depobj = 114,
Nothing = 115,
Error = 116,
Unknown = 255,
}
Expand description
OpenMP directive type
This enum covers all standard OpenMP directives from the 5.2 specification. Each directive is represented as a unique variant.
§Examples
let kind = DirectiveKind::Parallel;
assert_eq!(kind.to_string(), "parallel");
let kind = DirectiveKind::ParallelFor;
assert_eq!(kind.to_string(), "parallel for");
§Learning: Large Enum with Clear Organization
This enum demonstrates organizing a large number of variants (70+) into logical categories using comments and grouping.
Variants§
Parallel = 0
#pragma omp parallel
ParallelFor = 1
#pragma omp parallel for
ParallelForSimd = 2
#pragma omp parallel for simd
ParallelSections = 3
#pragma omp parallel sections
#pragma omp parallel workshare
(Fortran)
ParallelLoop = 5
#pragma omp parallel loop
ParallelMasked = 6
#pragma omp parallel masked
ParallelMaster = 7
#pragma omp parallel master
(deprecated in 5.1)
For = 10
#pragma omp for
ForSimd = 11
#pragma omp for simd
Sections = 12
#pragma omp sections
Section = 13
#pragma omp section
Single = 14
#pragma omp single
#pragma omp workshare
(Fortran)
Loop = 16
#pragma omp loop
Simd = 20
#pragma omp simd
DeclareSimd = 21
#pragma omp declare simd
Task = 30
#pragma omp task
Taskloop = 31
#pragma omp taskloop
TaskloopSimd = 32
#pragma omp taskloop simd
Taskyield = 33
#pragma omp taskyield
Taskwait = 34
#pragma omp taskwait
Taskgroup = 35
#pragma omp taskgroup
Target = 40
#pragma omp target
TargetData = 41
#pragma omp target data
TargetEnterData = 42
#pragma omp target enter data
TargetExitData = 43
#pragma omp target exit data
TargetUpdate = 44
#pragma omp target update
TargetParallel = 45
#pragma omp target parallel
TargetParallelFor = 46
#pragma omp target parallel for
TargetParallelForSimd = 47
#pragma omp target parallel for simd
TargetParallelLoop = 48
#pragma omp target parallel loop
TargetSimd = 49
#pragma omp target simd
TargetTeams = 50
#pragma omp target teams
TargetTeamsDistribute = 51
#pragma omp target teams distribute
TargetTeamsDistributeSimd = 52
#pragma omp target teams distribute simd
TargetTeamsDistributeParallelFor = 53
#pragma omp target teams distribute parallel for
TargetTeamsDistributeParallelForSimd = 54
#pragma omp target teams distribute parallel for simd
TargetTeamsLoop = 55
#pragma omp target teams loop
Teams = 60
#pragma omp teams
TeamsDistribute = 61
#pragma omp teams distribute
TeamsDistributeSimd = 62
#pragma omp teams distribute simd
TeamsDistributeParallelFor = 63
#pragma omp teams distribute parallel for
TeamsDistributeParallelForSimd = 64
#pragma omp teams distribute parallel for simd
TeamsLoop = 65
#pragma omp teams loop
Barrier = 70
#pragma omp barrier
Critical = 71
#pragma omp critical
Atomic = 72
#pragma omp atomic
Flush = 73
#pragma omp flush
Ordered = 74
#pragma omp ordered
Master = 75
#pragma omp master
Masked = 76
#pragma omp masked
DeclareReduction = 80
#pragma omp declare reduction
DeclareMapper = 81
#pragma omp declare mapper
DeclareTarget = 82
#pragma omp declare target
DeclareVariant = 83
#pragma omp declare variant
Distribute = 90
#pragma omp distribute
DistributeSimd = 91
#pragma omp distribute simd
DistributeParallelFor = 92
#pragma omp distribute parallel for
DistributeParallelForSimd = 93
#pragma omp distribute parallel for simd
Metadirective = 100
#pragma omp metadirective
Threadprivate = 110
#pragma omp threadprivate
Allocate = 111
#pragma omp allocate
Requires = 112
#pragma omp requires
Scan = 113
#pragma omp scan
Depobj = 114
#pragma omp depobj
Nothing = 115
#pragma omp nothing
Error = 116
#pragma omp error
Unknown = 255
Unknown or custom directive
Implementations§
Source§impl DirectiveKind
impl DirectiveKind
Sourcepub fn is_parallel(&self) -> bool
pub fn is_parallel(&self) -> bool
Check if this is a parallel construct
Sourcepub fn is_worksharing(&self) -> bool
pub fn is_worksharing(&self) -> bool
Check if this is a work-sharing construct
Sourcepub fn is_synchronization(&self) -> bool
pub fn is_synchronization(&self) -> bool
Check if this is a synchronization construct
Sourcepub fn is_declare(&self) -> bool
pub fn is_declare(&self) -> bool
Check if this is a declare construct
Sourcepub fn has_structured_block(&self) -> bool
pub fn has_structured_block(&self) -> bool
Check if this directive has a structured block (requires end directive)
Trait Implementations§
Source§impl Clone for DirectiveKind
impl Clone for DirectiveKind
Source§fn clone(&self) -> DirectiveKind
fn clone(&self) -> DirectiveKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more