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 8
8
9
9
package org .pytorch .executorch ;
10
10
11
- import static org .junit .Assert .assertTrue ;
12
11
import static org .junit .Assert .assertNotNull ;
13
12
14
13
import androidx .test .ext .junit .runners .AndroidJUnit4 ;
15
14
import org .junit .runner .RunWith ;
16
15
import org .junit .Test ;
17
16
18
- /** Unit tests for {@link Runtime }. */
17
+ /** Unit tests for {@link ExecuTorchRuntime }. */
19
18
@ RunWith (AndroidJUnit4 .class )
20
19
public class RuntimeInstrumentationTest {
21
20
22
21
@ Test
23
22
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 ();
28
25
29
26
assertNotNull (ops );
30
27
assertNotNull (backends );
Original file line number Diff line number Diff line change 10
10
11
11
import com .facebook .soloader .nativeloader .NativeLoader ;
12
12
import com .facebook .soloader .nativeloader .SystemDelegate ;
13
+ import com .facebook .jni .annotations .DoNotStrip ;
13
14
14
15
/** Class for entire ExecuTorch Runtime related functions. */
15
16
public class ExecuTorchRuntime {
@@ -30,4 +31,12 @@ private ExecuTorchRuntime() {}
30
31
public static ExecuTorchRuntime getRuntime () {
31
32
return sInstance ;
32
33
}
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 ();
33
42
}
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;
17
17
18
18
class AndroidRuntimeJni : public facebook ::jni::JavaClass<AndroidRuntimeJni> {
19
19
public:
20
- constexpr static const char * kJavaDescriptor = " Lorg/pytorch/executorch/Runtime ;" ;
20
+ constexpr static const char * kJavaDescriptor = " Lorg/pytorch/executorch/ExecuTorchRuntime ;" ;
21
21
22
22
static void registerNatives () {
23
23
javaClassStatic ()->registerNatives ({
You can’t perform that action at this time.
0 commit comments