GetHardwareDevices property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtEnv> env, Pointer<Pointer<OrtHardwareDevice>> devices, Size num_devices)>> GetHardwareDevices
getter/setter pair

\brief Get the list of available hardware devices.

Enumerates hardware devices available on the system. Populates a user-provided array with pointers to OrtHardwareDevice instances. The caller is responsible for allocating the array with sufficient space (use GetNumHardwareDevices() to get the count).

The returned pointers reference internal ORT data structures that are discovered once at process startup and remain valid for the lifetime of the OrtEnv. The caller does not need to release these pointers, but should not use them after calling ReleaseEnv().

\paramin env The OrtEnv instance where device discovery results are stored. \paramout devices User-allocated array to receive pointers to OrtHardwareDevice instances. The array must have space for at least num_devices elements. \paramin num_devices The size of the user-allocated devices array.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.24.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtEnv> env,
      ffi.Pointer<ffi.Pointer<OrtHardwareDevice>> devices,
      ffi.Size num_devices,
    )
  >
>
GetHardwareDevices;