Skip to content

Commit ea88c6f

Browse files
committed
Apply clang-format and google-java-format
1 parent 253b155 commit ea88c6f

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

extension/android/executorch_android/src/main/java/org/pytorch/executorch/ExecuTorchRuntime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
package org.pytorch.executorch;
1010

11+
import com.facebook.jni.annotations.DoNotStrip;
1112
import com.facebook.soloader.nativeloader.NativeLoader;
1213
import com.facebook.soloader.nativeloader.SystemDelegate;
13-
import com.facebook.jni.annotations.DoNotStrip;
1414

1515
/** Class for entire ExecuTorch Runtime related functions. */
1616
public class ExecuTorchRuntime {

extension/android/jni/jni_layer_runtime.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <jni.h>
109
#include <fbjni/fbjni.h>
10+
#include <jni.h>
1111

12-
#include <executorch/runtime/kernel/operator_registry.h>
1312
#include <executorch/runtime/backend/interface.h>
13+
#include <executorch/runtime/kernel/operator_registry.h>
1414

1515
namespace executorch_jni {
1616
namespace runtime = ::executorch::ET_RUNTIME_NAMESPACE;
1717

1818
class AndroidRuntimeJni : public facebook::jni::JavaClass<AndroidRuntimeJni> {
1919
public:
20-
constexpr static const char* kJavaDescriptor = "Lorg/pytorch/executorch/ExecuTorchRuntime;";
20+
constexpr static const char* kJavaDescriptor =
21+
"Lorg/pytorch/executorch/ExecuTorchRuntime;";
2122

2223
static void registerNatives() {
2324
javaClassStatic()->registerNatives({
24-
makeNativeMethod("getRegisteredOps", AndroidRuntimeJni::getRegisteredOps),
25-
makeNativeMethod("getRegisteredBackends", AndroidRuntimeJni::getRegisteredBackends),
25+
makeNativeMethod(
26+
"getRegisteredOps", AndroidRuntimeJni::getRegisteredOps),
27+
makeNativeMethod(
28+
"getRegisteredBackends", AndroidRuntimeJni::getRegisteredBackends),
2629
});
2730
}
2831

@@ -33,8 +36,8 @@ class AndroidRuntimeJni : public facebook::jni::JavaClass<AndroidRuntimeJni> {
3336
auto result = facebook::jni::JArrayClass<jstring>::newArray(kernels.size());
3437

3538
for (size_t i = 0; i < kernels.size(); ++i) {
36-
auto op = facebook::jni::make_jstring(kernels[i].name_);
37-
result->setElement(i, op.get());
39+
auto op = facebook::jni::make_jstring(kernels[i].name_);
40+
result->setElement(i, op.get());
3841
}
3942

4043
return result;
@@ -47,15 +50,15 @@ class AndroidRuntimeJni : public facebook::jni::JavaClass<AndroidRuntimeJni> {
4750
auto result = facebook::jni::JArrayClass<jstring>::newArray(num_backends);
4851

4952
for (int i = 0; i < num_backends; ++i) {
50-
auto name_result = runtime::get_backend_name(i);
51-
const char* name = "";
53+
auto name_result = runtime::get_backend_name(i);
54+
const char* name = "";
5255

53-
if (name_result.ok()) {
54-
name = *name_result;
55-
}
56+
if (name_result.ok()) {
57+
name = *name_result;
58+
}
5659

57-
auto backend_str = facebook::jni::make_jstring(name);
58-
result->setElement(i, backend_str.get());
60+
auto backend_str = facebook::jni::make_jstring(name);
61+
result->setElement(i, backend_str.get());
5962
}
6063

6164
return result;

0 commit comments

Comments
 (0)