Class BurstCompatibleAttribute | Collections | 0.15.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Class BurstCompatibleAttribute

    Documents and enforces (via generated tests) that the tagged method or property has to stay burst compatible.

    Inheritance
    Object
    Attribute
    BurstCompatibleAttribute
    Namespace: Unity.Collections
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = true)]
    public class BurstCompatibleAttribute : Attribute, _Attribute

    Fields

    RequiredUnityDefine

    Declaration
    public string RequiredUnityDefine
    Field Value
    Type Description
    String

    Properties

    GenericTypeArguments

    Types to be used for the declared generic type or method.

    Declaration
    public Type[] GenericTypeArguments { get; set; }
    Property Value
    Type Description
    Type[]
    Remarks

    The generic type arguments are tracked separately for types and methods. Say a generic type also contains a generic method, like in the case of Foo<T>.Bar<U>(T baz, U blah). You must specify GenericTypeArguments for Foo and also for Bar to establish the concrete types for T and U. When code generation occurs for the Burst compatibility tests, any time T appears (in the definition of Foo) it will be replaced with the generic type argument you specified for Foo and whenever U appears (in method Bar's body) it will be replaced by whatever generic type argument you specified for the method Bar.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023