Skip to main content
Log in

Mojo struct

FuncAttribute

@register_passable(trivial) struct FuncAttribute

Implement Cuda's CUfunction_attribute enum. https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g9d955dde0904a9b43ca4d875ac1551bc.

Only add 'max_dynamic_shared_size_bytes`.

Aliases

  • NULL = FuncAttribute(Attribute(SIMD(-1)), SIMD(-1)):

Fields

  • attribute (Attribute):
  • value (SIMD[int32, 1]):

Implemented traits

AnyType, CollectionElement, Copyable, EqualityComparable, ExplicitlyCopyable, Movable, UnknownDestructibility

Methods

__init__

__init__(*, other: Self) -> Self

Explicitly construct a deep copy of the provided value.

Args:

  • other (Self): The value to copy.

__eq__

__eq__(self, other: Self) -> Bool

__ne__

__ne__(self, other: Self) -> Bool

CACHE_MODE_CA

static CACHE_MODE_CA(val: Bool) -> Self

Indicates whether the function has been compiled with user specified option CacheMode.L1_CACHE_DISABLED set.

MAX_DYNAMIC_SHARED_SIZE_BYTES

static MAX_DYNAMIC_SHARED_SIZE_BYTES(val: SIMD[uint32, 1]) -> Self

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.

PREFERRED_SHARED_MEMORY_CARVEOUT

static PREFERRED_SHARED_MEMORY_CARVEOUT(val: SIMD[int32, 1]) -> Self

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.