pub enum EntryFunctionHeaderDirective {
MaxNReg {
value: u32,
span: Span,
},
MaxNTid {
dim: FunctionDim,
span: Span,
},
ReqNTid {
dim: FunctionDim,
span: Span,
},
MinNCtaPerSm {
value: u32,
span: Span,
},
MaxNCtaPerSm {
value: u32,
span: Span,
},
Pragma {
args: Vec<String>,
span: Span,
},
ReqNctaPerCluster {
dim: FunctionDim,
span: Span,
},
ExplicitCluster {
span: Span,
},
MaxClusterRank {
value: u32,
span: Span,
},
BlocksAreClusters {
span: Span,
},
}Expand description
Directive tokens that may decorate a PTX function header.
Variants§
MaxNReg
Syntax: .maxnreg n
Example: .entry foo .maxnreg 16 { … } // max regs per thread = 16
MaxNTid
Syntax: .maxntid nx .maxntid nx, ny .maxntid nx, ny, nz
Example: .entry foo .maxntid 256 { … } // max threads = 256 .entry bar .maxntid 16,16,4 { … } // max threads = 1024
ReqNTid
Syntax: .reqntid nx .reqntid nx, ny .reqntid nx, ny, nz
Example: .entry foo .reqntid 256 { … } // num threads = 256 .entry bar .reqntid 16,16,4 { … } // num threads = 1024
MinNCtaPerSm
Syntax: .minnctapersm ncta
Example: .entry foo .maxntid 256 .minnctapersm 4 { … }
MaxNCtaPerSm
Syntax: .maxnctapersm ncta
Example: .entry foo .maxntid 256 .maxnctapersm 4 { … }
Pragma
Syntax: .pragma list-of-strings ;
Example: .entry foo .pragma “nounroll”; { … } // disable unrolling for current kernel
ReqNctaPerCluster
Syntax: .reqnctapercluster nx .reqnctapercluster nx, ny .reqnctapercluster nx, ny, nz
Example: .entry foo .reqnctapercluster 2 { . . . } .entry bar .reqnctapercluster 2, 2, 1 { . . . } .entry ker .reqnctapercluster 3, 2 { . . . }
ExplicitCluster
Syntax: .explicitcluster
Example: .entry foo .explicitcluster { . . . }
MaxClusterRank
Syntax: .maxclusterrank n
Example: .entry foo ..maxclusterrank 8 { . . . }
BlocksAreClusters
Syntax: .blocksareclusters
Example: .entry foo .reqntid 32, 32, 1 .reqnctapercluster 32, 32, 1 .blocksareclusters { … } // only allowed when with .reqnctapercluster and .reqntid
Implementations§
Trait Implementations§
Source§impl Clone for EntryFunctionHeaderDirective
impl Clone for EntryFunctionHeaderDirective
Source§fn clone(&self) -> EntryFunctionHeaderDirective
fn clone(&self) -> EntryFunctionHeaderDirective
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntryFunctionHeaderDirective
impl Debug for EntryFunctionHeaderDirective
Source§impl PartialEq for EntryFunctionHeaderDirective
impl PartialEq for EntryFunctionHeaderDirective
Source§fn eq(&self, other: &EntryFunctionHeaderDirective) -> bool
fn eq(&self, other: &EntryFunctionHeaderDirective) -> bool
self and other values to be equal, and is used by ==.Source§impl PtxParser for EntryFunctionHeaderDirective
impl PtxParser for EntryFunctionHeaderDirective
Source§fn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
fn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
Self.