docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class WorkerFactory

    Provides methods for instantiating workers and ops on given back ends.

    Inheritance
    object
    WorkerFactory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Sentis
    Assembly: Unity.Sentis.dll
    Syntax
    public class WorkerFactory

    Methods

    CreateBackend(BackendType)

    Initializes and returns an instance of IBackend for a backend type..

    Declaration
    public static IBackend CreateBackend(BackendType backendType)
    Parameters
    Type Name Description
    BackendType backendType

    The type of backend to use.

    Returns
    Type Description
    IBackend

    The created IBackend instance.

    CreateWorker(BackendType, Model)

    Initializes and returns an instance of IWorker on a given back end with a model to execute.

    Declaration
    public static IWorker CreateWorker(BackendType backendType, Model model)
    Parameters
    Type Name Description
    BackendType backendType

    The type of backend to use.

    Model model

    The model to execute with this IWorker.

    Returns
    Type Description
    IWorker

    The created IWorker instance.

    CreateWorker(BackendType, Model, WorkerConfiguration)

    Initializes and returns an instance of IWorker on a given back end with a model to execute and workerConfiguration.

    Declaration
    public static IWorker CreateWorker(BackendType backendType, Model model, WorkerFactory.WorkerConfiguration workerConfiguration)
    Parameters
    Type Name Description
    BackendType backendType

    The type of backend to use.

    Model model

    The model to execute with this IWorker.

    WorkerFactory.WorkerConfiguration workerConfiguration

    The worker configuration to use when executing.

    Returns
    Type Description
    IWorker

    The created IWorker instance.

    CreateWorker(Model, DeviceType)

    Initializes and returns an instance of IWorker on a given device with a model to execute. Sentis selects the best backend type available for deviceType.

    Declaration
    public static IWorker CreateWorker(Model model, DeviceType deviceType)
    Parameters
    Type Name Description
    Model model

    The model to execute with this IWorker.

    DeviceType deviceType

    The type of device to use. Sentis selects the best backend type available for deviceType.

    Returns
    Type Description
    IWorker

    The created IWorker instance.

    GetBestTypeForDevice(DeviceType)

    Returns the best backend type for the given deviceType.

    Declaration
    public static BackendType GetBestTypeForDevice(DeviceType deviceType)
    Parameters
    Type Name Description
    DeviceType deviceType

    The device type.

    Returns
    Type Description
    BackendType

    The selected backend type for the device type.

    IsType(BackendType, DeviceType)

    Checks if a backend type matches a device type. For example, IsType(BackendType.GPUCompute, DeviceType.GPU) returns true.

    Declaration
    public static bool IsType(BackendType backendType, DeviceType deviceType)
    Parameters
    Type Name Description
    BackendType backendType

    The backend type to check.

    DeviceType deviceType

    The device type to check.

    Returns
    Type Description
    bool

    Whether the backend type matches the device type.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)