#[non_exhaustive]#[repr(u32)]pub enum FunctionAttribute {
Show 17 variants
SharedMemoryMode = 17,
MaxThreadsPerBlock = 0,
SharedSizeBytes = 1,
ConstSizeBytes = 2,
LocalSizeBytes = 3,
NumRegs = 4,
PtxVersion = 5,
BinaryVersion = 6,
CacheModeCa = 7,
MaxDynamicSharedSizeBytes = 8,
PreferredSharedMemoryCarveout = 9,
ClusterSizeMustBeSet = 10,
RequiredClusterWidth = 11,
RequiredClusterHeight = 12,
RequiredClusterDepth = 13,
NonPortableClusterSizeAllowed = 14,
ClusterSchedulingPolicyPreference = 15,
}Expand description
Attribute of a compiled kernel function, queried or set per function.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
The shared memory mode of a function, as a SharedMemoryMode.
MaxThreadsPerBlock = 0
The maximum number of threads per block, beyond which a launch of the function would fail.
This number depends on both the function and the device on which the function is currently loaded.
The size in bytes of statically-allocated shared memory required by this function.
This does not include dynamically-allocated shared memory requested by the user at runtime.
ConstSizeBytes = 2
The size in bytes of user-allocated constant memory required by this function.
LocalSizeBytes = 3
The size in bytes of local memory used by each thread of this function.
NumRegs = 4
The number of registers used by each thread of this function.
PtxVersion = 5
The PTX virtual architecture version for which the function was compiled.
This value is the major PTX version times 10 plus the minor PTX version, so a PTX version 1.3 function returns 13. Cubins compiled before CUDA 3.0 may report the undefined value 0.
BinaryVersion = 6
The binary architecture version for which the function was compiled.
This value is the major binary version times 10 plus the minor binary version, so a binary version 1.3 function returns 13. Legacy cubins without a properly encoded binary architecture version report 10.
CacheModeCa = 7
Whether the function was compiled with the -Xptxas --dlcm=ca option.
The maximum size in bytes of dynamically-allocated shared memory that can be used by this function.
If the user-specified dynamic shared memory size is larger than this value, the launch will fail.
The default is DeviceAttribute::MaxSharedMemoryPerBlock minus Self::SharedSizeBytes, or 0 when the static size exceeds that maximum.
It can be raised to DeviceAttribute::MaxSharedMemoryPerBlockOptin minus Self::SharedSizeBytes.
This attribute is ignored if the function or launch sets a shared memory mode, such as Self::SharedMemoryMode.
This attribute cannot be used to access oversized shared memory, which only a shared memory mode enables.
On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory.
The total is DeviceAttribute::MaxSharedMemoryPerMultiprocessor.
This is only a hint, and the driver can choose a different ratio if required to execute the function.
ClusterSizeMustBeSet = 10
If this attribute is set, the kernel must launch with a valid cluster size specified.
RequiredClusterWidth = 11
The required cluster width in blocks.
The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
If the value is set during compile time, it cannot be set at runtime.
Setting it at runtime returns Status::NotPermitted.
RequiredClusterHeight = 12
The required cluster height in blocks.
The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
If the value is set during compile time, it cannot be set at runtime.
Setting it at runtime returns Status::NotPermitted.
RequiredClusterDepth = 13
The required cluster depth in blocks.
The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
If the value is set during compile time, it cannot be set at runtime.
Setting it at runtime returns Status::NotPermitted.
NonPortableClusterSizeAllowed = 14
Whether the function can be launched with non-portable cluster size.
1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform.
An occupancy query for the maximum active clusters checks whether a size can launch on the current device.
A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability.
The portable cluster size for sm_90 is 8 blocks per cluster.
This value may increase for future compute capabilities.
The specific hardware unit may support higher cluster sizes that are not guaranteed to be portable.
ClusterSchedulingPolicyPreference = 15
The block scheduling policy of a function, as a ClusterSchedulingPolicy.
Trait Implementations§
Source§impl Clone for FunctionAttribute
impl Clone for FunctionAttribute
impl Copy for FunctionAttribute
Source§impl Debug for FunctionAttribute
impl Debug for FunctionAttribute
Source§impl Display for FunctionAttribute
impl Display for FunctionAttribute
impl Eq for FunctionAttribute
Source§impl From<FunctionAttribute> for u32
impl From<FunctionAttribute> for u32
Source§fn from(enum_value: FunctionAttribute) -> Self
fn from(enum_value: FunctionAttribute) -> Self
Source§impl From<FunctionAttribute> for CUfunction_attribute
impl From<FunctionAttribute> for CUfunction_attribute
Source§fn from(value: FunctionAttribute) -> Self
fn from(value: FunctionAttribute) -> Self
Source§impl Hash for FunctionAttribute
impl Hash for FunctionAttribute
Source§impl PartialEq for FunctionAttribute
impl PartialEq for FunctionAttribute
impl StructuralPartialEq for FunctionAttribute
Source§impl TryFrom<CUfunction_attribute_enum> for FunctionAttribute
impl TryFrom<CUfunction_attribute_enum> for FunctionAttribute
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: CUfunction_attribute) -> Result<Self, UnknownEnumValue>
fn try_from(value: CUfunction_attribute) -> Result<Self, UnknownEnumValue>
Source§impl TryFrom<u32> for FunctionAttribute
impl TryFrom<u32> for FunctionAttribute
Source§type Error = TryFromPrimitiveError<FunctionAttribute>
type Error = TryFromPrimitiveError<FunctionAttribute>
Source§impl TryFromPrimitive for FunctionAttribute
impl TryFromPrimitive for FunctionAttribute
const NAME: &'static str = "FunctionAttribute"
type Primitive = u32
type Error = TryFromPrimitiveError<FunctionAttribute>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Forget for FunctionAttribute
impl Freeze for FunctionAttribute
impl Move for FunctionAttribute
impl RefUnwindSafe for FunctionAttribute
impl Send for FunctionAttribute
impl Sync for FunctionAttribute
impl Unpin for FunctionAttribute
impl UnsafeUnpin for FunctionAttribute
impl UnwindSafe for FunctionAttribute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.