Enum DirectiveKind

Source
#[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

§

ParallelWorkshare = 4

#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

§

Workshare = 15

#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

Source

pub fn is_parallel(&self) -> bool

Check if this is a parallel construct

Source

pub fn is_worksharing(&self) -> bool

Check if this is a work-sharing construct

Source

pub fn is_simd(&self) -> bool

Check if this is a SIMD construct

Source

pub fn is_task(&self) -> bool

Check if this is a task construct

Source

pub fn is_target(&self) -> bool

Check if this is a target construct

Source

pub fn is_teams(&self) -> bool

Check if this is a teams construct

Source

pub fn is_loop(&self) -> bool

Check if this is a loop construct

Source

pub fn is_synchronization(&self) -> bool

Check if this is a synchronization construct

Source

pub fn is_declare(&self) -> bool

Check if this is a declare construct

Source

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

Source§

fn clone(&self) -> DirectiveKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DirectiveKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DirectiveKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for DirectiveKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DirectiveKind

Source§

fn eq(&self, other: &DirectiveKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for DirectiveKind

Source§

impl Eq for DirectiveKind

Source§

impl StructuralPartialEq for DirectiveKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.