Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 300b3245 authored by Lev Proleev's avatar Lev Proleev
Browse files

Add units to hal times and durations names

The change adds "Ns" suffix to timeOnDevice, timeInDriver,
loopTimeoutDuration, deadline and duration.

Fix: 183118329
Test: mm
Change-Id: Id1f9ee4b8e41873c97690bb19a5e84572dd9ccf1
parent 48ac0d6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,6 +34,6 @@
package android.hardware.neuralnetworks;
@VintfStability
interface IBurst {
  android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadline, in long loopTimeoutDuration);
  android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in long[] memoryIdentifierTokens, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs);
  void releaseMemoryResource(in long memoryIdentifierToken);
}
+2 −2
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ interface IDevice {
  boolean[] getSupportedOperations(in android.hardware.neuralnetworks.Model model);
  android.hardware.neuralnetworks.DeviceType getType();
  String getVersionString();
  void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadline, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback);
  void prepareModelFromCache(in long deadline, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback);
  void prepareModel(in android.hardware.neuralnetworks.Model model, in android.hardware.neuralnetworks.ExecutionPreference preference, in android.hardware.neuralnetworks.Priority priority, in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback);
  void prepareModelFromCache(in long deadlineNs, in ParcelFileDescriptor[] modelCache, in ParcelFileDescriptor[] dataCache, in byte[] token, in android.hardware.neuralnetworks.IPreparedModelCallback callback);
  const int BYTE_SIZE_OF_CACHE_TOKEN = 32;
  const int MAX_NUMBER_OF_CACHE_FILES = 32;
  const int EXTENSION_TYPE_HIGH_BITS_PREFIX = 15;
+2 −2
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@
package android.hardware.neuralnetworks;
@VintfStability
interface IPreparedModel {
  android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadline, in long loopTimeoutDuration);
  android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadline, in long loopTimeoutDuration, in long duration);
  android.hardware.neuralnetworks.ExecutionResult executeSynchronously(in android.hardware.neuralnetworks.Request request, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs);
  android.hardware.neuralnetworks.FencedExecutionResult executeFenced(in android.hardware.neuralnetworks.Request request, in ParcelFileDescriptor[] waitFor, in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs, in long durationNs);
  android.hardware.neuralnetworks.IBurst configureExecutionBurst();
  const long DEFAULT_LOOP_TIMEOUT_DURATION_NS = 2000000000;
  const long MAXIMUM_LOOP_TIMEOUT_DURATION_NS = 15000000000;
+2 −2
Original line number Diff line number Diff line
@@ -34,6 +34,6 @@
package android.hardware.neuralnetworks;
@VintfStability
parcelable Timing {
  long timeOnDevice;
  long timeInDriver;
  long timeOnDeviceNs;
  long timeInDriverNs;
}
+13 −13
Original line number Diff line number Diff line
@@ -77,18 +77,18 @@ interface IBurst {
     * @param measure Specifies whether or not to measure duration of the execution. The duration
     *                runs from the time the driver sees the call to the executeSynchronously
     *                function to the time the driver returns from the function.
     * @param deadline The time by which the execution is expected to complete. The time is measured
     *                 in nanoseconds since epoch of the steady clock (as from
     * @param deadlineNs The time by which the execution is expected to complete. The time is
     *                   measured in nanoseconds since epoch of the steady clock (as from
     *                   std::chrono::steady_clock). If the execution cannot be finished by the
     *                   deadline, the execution may be aborted. Passing -1 means the deadline is
     *                   omitted. Other negative values are invalid.
     * @param loopTimeoutDuration The maximum amount of time in nanoseconds that should be spent
     * @param loopTimeoutDurationNs The maximum amount of time in nanoseconds that should be spent
     *                              executing a {@link OperationType::WHILE} operation. If a loop
     *                              condition model does not output false within this duration, the
     *                              execution must be aborted. If -1 is provided, the maximum amount
     *                              of time is {@link DEFAULT_LOOP_TIMEOUT_DURATION_NS}. Other
     *                            negative values are invalid. When provided, the duration must not
     *                            exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}.
     *                              negative values are invalid. When provided, the duration must
     *                              not exceed {@link MAXIMUM_LOOP_TIMEOUT_DURATION_NS}.
     * @return ExecutionResult parcelable, containing the status of the execution, output shapes and
     *     timing information.
     * @throws ServiceSpecificException with one of the following ErrorStatus values:
@@ -100,7 +100,7 @@ interface IBurst {
     *     - RESOURCE_EXHAUSTED_* if the task was aborted by the driver
     */
    ExecutionResult executeSynchronously(in Request request, in long[] memoryIdentifierTokens,
            in boolean measureTiming, in long deadline, in long loopTimeoutDuration);
            in boolean measureTiming, in long deadlineNs, in long loopTimeoutDurationNs);

    /**
     * releaseMemoryResource is used by the client to signal to the service that a memory buffer
Loading