Class AssumeRangeAttribute
Can be used to specify that a parameter or return has a range assumption. Assumptions feed directly into the optimizer and allow better codegen.
Only usable on values of type scalar integer.
The range is a closed interval [min..max] - EG. the attributed value is greater-than-or-equal-to min and less-than-or-equal-to max.
Inherited Members
Namespace: Unity.Burst.CompilerServices
Syntax
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
public class AssumeRangeAttribute : Attribute, _Attribute
Constructors
AssumeRangeAttribute(Int64, Int64)
Assume that an integer is in the signed closed interval [min..max].
Declaration
public AssumeRangeAttribute(long min, long max)
Parameters
Type | Name | Description |
---|---|---|
Int64 | min | The inclusive minimum value. |
Int64 | max | The inclusive maximum value. |
AssumeRangeAttribute(UInt64, UInt64)
Assume that an integer is in the unsigned closed interval [min..max].
Declaration
public AssumeRangeAttribute(ulong min, ulong max)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | min | The inclusive minimum value. |
UInt64 | max | The inclusive maximum value. |