File tree Expand file tree Collapse file tree 4 files changed +13
-51
lines changed
androidTest/java/org/pytorch/executorch
main/java/org/pytorch/executorch Expand file tree Collapse file tree 4 files changed +13
-51
lines changed Original file line number Diff line number Diff line change 88
99package org .pytorch .executorch ;
1010
11- import static org .junit .Assert .assertTrue ;
1211import static org .junit .Assert .assertNotNull ;
1312
1413import androidx .test .ext .junit .runners .AndroidJUnit4 ;
1514import org .junit .runner .RunWith ;
1615import org .junit .Test ;
1716
18- /** Unit tests for {@link Runtime }. */
17+ /** Unit tests for {@link ExecuTorchRuntime }. */
1918@ RunWith (AndroidJUnit4 .class )
2019public class RuntimeInstrumentationTest {
2120
2221 @ Test
2322 public void testRuntimeApi () {
24- assertTrue (Runtime .isInitialized ());
25-
26- String [] ops = Runtime .getRegisteredOps ();
27- String [] backends = Runtime .getRegisteredBackends ();
23+ String [] ops = ExecuTorchRuntime .getRegisteredOps ();
24+ String [] backends = ExecuTorchRuntime .getRegisteredBackends ();
2825
2926 assertNotNull (ops );
3027 assertNotNull (backends );
Original file line number Diff line number Diff line change 1010
1111import com .facebook .soloader .nativeloader .NativeLoader ;
1212import com .facebook .soloader .nativeloader .SystemDelegate ;
13+ import com .facebook .jni .annotations .DoNotStrip ;
1314
1415/** Class for entire ExecuTorch Runtime related functions. */
1516public class ExecuTorchRuntime {
@@ -30,4 +31,12 @@ private ExecuTorchRuntime() {}
3031 public static ExecuTorchRuntime getRuntime () {
3132 return sInstance ;
3233 }
34+
35+ /** Get all registered ops. */
36+ @ DoNotStrip
37+ public static native String [] getRegisteredOps ();
38+
39+ /** Get all registered backends. */
40+ @ DoNotStrip
41+ public static native String [] getRegisteredBackends ();
3342}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ namespace runtime = ::executorch::ET_RUNTIME_NAMESPACE;
1717
1818class AndroidRuntimeJni : public facebook ::jni::JavaClass<AndroidRuntimeJni> {
1919 public:
20- constexpr static const char * kJavaDescriptor = " Lorg/pytorch/executorch/Runtime ;" ;
20+ constexpr static const char * kJavaDescriptor = " Lorg/pytorch/executorch/ExecuTorchRuntime ;" ;
2121
2222 static void registerNatives () {
2323 javaClassStatic ()->registerNatives ({
You can’t perform that action at this time.
0 commit comments