Class PanamaNnContext

java.lang.Object
ai.tegmentum.wasmtime4j.panama.wasi.nn.PanamaNnContext
All Implemented Interfaces:
ai.tegmentum.wasmtime4j.wasi.nn.NnContext, AutoCloseable

public final class PanamaNnContext extends Object implements ai.tegmentum.wasmtime4j.wasi.nn.NnContext
Panama implementation of the NnContext interface for WASI-NN operations.

This class provides WASI-NN machine learning functionality using Panama FFI bindings to the native Wasmtime WASI-NN implementation.

Since:
1.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext

    ai.tegmentum.wasmtime4j.wasi.nn.NnContext.NnImplementationInfo
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    ai.tegmentum.wasmtime4j.wasi.nn.NnContext.NnImplementationInfo
     
    Set<ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding>
     
    Set<ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget>
     
    boolean
     
    boolean
    isEncodingSupported(ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding)
     
    boolean
    isTargetSupported(ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target)
     
    boolean
     
    ai.tegmentum.wasmtime4j.wasi.nn.NnGraph
    loadGraph(byte[] modelData, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target)
     
    ai.tegmentum.wasmtime4j.wasi.nn.NnGraph
    loadGraph(List<byte[]> modelParts, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target)
     
    ai.tegmentum.wasmtime4j.wasi.nn.NnGraph
     
    ai.tegmentum.wasmtime4j.wasi.nn.NnGraph
    loadGraphFromFile(Path modelPath, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • loadGraph

      public ai.tegmentum.wasmtime4j.wasi.nn.NnGraph loadGraph(byte[] modelData, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException
      Specified by:
      loadGraph in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
      Throws:
      ai.tegmentum.wasmtime4j.wasi.nn.NnException
    • loadGraph

      public ai.tegmentum.wasmtime4j.wasi.nn.NnGraph loadGraph(List<byte[]> modelParts, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException
      Specified by:
      loadGraph in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
      Throws:
      ai.tegmentum.wasmtime4j.wasi.nn.NnException
    • loadGraphFromFile

      public ai.tegmentum.wasmtime4j.wasi.nn.NnGraph loadGraphFromFile(Path modelPath, ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding, ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException
      Specified by:
      loadGraphFromFile in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
      Throws:
      ai.tegmentum.wasmtime4j.wasi.nn.NnException
    • loadGraphByName

      public ai.tegmentum.wasmtime4j.wasi.nn.NnGraph loadGraphByName(String name) throws ai.tegmentum.wasmtime4j.wasi.nn.NnException
      Specified by:
      loadGraphByName in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
      Throws:
      ai.tegmentum.wasmtime4j.wasi.nn.NnException
    • getSupportedEncodings

      public Set<ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding> getSupportedEncodings()
      Specified by:
      getSupportedEncodings in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • getSupportedTargets

      public Set<ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget> getSupportedTargets()
      Specified by:
      getSupportedTargets in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • isEncodingSupported

      public boolean isEncodingSupported(ai.tegmentum.wasmtime4j.wasi.nn.NnGraphEncoding encoding)
      Specified by:
      isEncodingSupported in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • isTargetSupported

      public boolean isTargetSupported(ai.tegmentum.wasmtime4j.wasi.nn.NnExecutionTarget target)
      Specified by:
      isTargetSupported in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • isAvailable

      public boolean isAvailable()
      Specified by:
      isAvailable in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • getImplementationInfo

      public ai.tegmentum.wasmtime4j.wasi.nn.NnContext.NnImplementationInfo getImplementationInfo()
      Specified by:
      getImplementationInfo in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ai.tegmentum.wasmtime4j.wasi.nn.NnContext