docs.unity3d.com
    Show / Hide Table of Contents

    Class BurstHelper

    Helper functions for Burst

    Inheritance
    Object
    BurstHelper
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Logging
    Syntax
    [BurstCompile]
    public static class BurstHelper

    Properties

    IsBurst

    Checks if a method is called from a managed or Burst environment.

    Declaration
    public static bool IsBurst { get; }
    Property Value
    Type Description
    Boolean

    Returns true if method is called from Burst, not a managed environment

    IsBurstEnabled

    Returns True if Burst is enabled. Can be called from Burst of a managed environments

    Declaration
    public static bool IsBurstEnabled { get; }
    Property Value
    Type Description
    Boolean
    Exceptions
    Type Condition
    Exception

    If CheckThatBurstIsEnabled(Boolean) was never called before

    IsManaged

    Checks if a method is called from a managed or Burst environment.

    Declaration
    public static bool IsManaged { get; }
    Property Value
    Type Description
    Boolean

    Returns true if method is called from a managed, not Burst environment

    Methods

    AssertMustBeBurstCompiled()

    Throws / Debug.LogError-s if IsBurstEnabled is true and this is called from a managed environment

    Declaration
    [BurstDiscard]
    public static void AssertMustBeBurstCompiled()
    Exceptions
    Type Condition
    Exception

    If IsBurstEnabled is true and this is called from a managed environment

    CheckThatBurstIsEnabled(Boolean)

    Checks if Burst is enabled, caches the result. Should be called from a managed environment

    Declaration
    public static bool CheckThatBurstIsEnabled(bool forceRefresh)
    Parameters
    Type Name Description
    Boolean forceRefresh

    If forceRefresh is true, refreshes the cache.

    Returns
    Type Description
    Boolean

    True if Burst is enabled

    Exceptions
    Type Condition
    Exception

    If called from Burst environment

    DebugLogIsBurstEnabled()

    Calls Debug.Log that prints if Burst enabled of not

    Declaration
    public static void DebugLogIsBurstEnabled()

    DebugLogIsManaged()

    Calls Debug.Log that prints if this is a managed or Burst environment

    Declaration
    public static void DebugLogIsManaged()
    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