@@ -39,9 +39,9 @@ struct CompileSpec {
39
39
*/
40
40
using DelegateHandle = void ;
41
41
42
- class PyTorchBackendInterface {
42
+ class BackendInterface {
43
43
public:
44
- virtual ~PyTorchBackendInterface () = 0 ;
44
+ virtual ~BackendInterface () = 0 ;
45
45
46
46
/* *
47
47
* Returns true if the backend is available to process delegation calls.
@@ -52,19 +52,19 @@ class PyTorchBackendInterface {
52
52
* Responsible to further process (compile/transform/optimize) the compiled
53
53
* unit that was produced, ahead-of-time, as well as perform any backend
54
54
* initialization to ready it for execution. This method is called every time
55
- * the PyTorch program is initialized. Consequently, this is the place to
55
+ * the ExecuTorch program is initialized. Consequently, this is the place to
56
56
* perform any backend initialization as well as transformations,
57
57
* optimizations, and even compilation that depend on the target device. As
58
58
* such, it is strongly encouraged to push as much processing as possible to
59
59
* the ahead-of-time processing.
60
60
*
61
- * @param[in] processed An opaque (to PyTorch) compiled unit from the
62
- * preprocessor. Can contain anything the backend needs to execute the
63
- * equivalent semantics of the passed-in Module and its method. Often
64
- * passed unmodified to `execute()` as a `DelegateHandle`, unless it needs
65
- * further processing at init time to be fully executable. If the data is
66
- * not needed after init(), calling processed->Free() can reclaim its
67
- * memory.
61
+ * @param[in] processed An opaque (to ExecuTorch) backend-specific compiled
62
+ * unit from the preprocessor. Can contain anything the backend needs to
63
+ * execute the equivalent semantics of the passed-in Module and its
64
+ * method. Often passed unmodified to `execute()` as a `DelegateHandle`,
65
+ * unless it needs further processing at init time to be fully executable.
66
+ * If the data is not needed after init(), calling processed->Free() can
67
+ * reclaim its memory.
68
68
* @param[in] compile_specs The exact same compiler specification that
69
69
* was used ahead-of-time to produce `processed`.
70
70
*
@@ -115,11 +115,10 @@ class PyTorchBackendInterface {
115
115
* The mapping is populated using register_backend method.
116
116
*
117
117
* @param[in] name Name of the user-defined backend delegate.
118
- * @retval Pointer to the appropriate object that implements
119
- * PyTorchBackendInterface. Nullptr if it can't find anything
120
- * with the given name.
118
+ * @retval Pointer to the appropriate object that implements BackendInterface.
119
+ * Nullptr if it can't find anything with the given name.
121
120
*/
122
- PyTorchBackendInterface * get_backend_class (const char * name);
121
+ BackendInterface * get_backend_class (const char * name);
123
122
124
123
/* *
125
124
* A named instance of a backend.
@@ -128,12 +127,12 @@ struct Backend {
128
127
// / The name of the backend. Must match the string used in the PTE file.
129
128
const char * name;
130
129
// / The instance of the backend to use when loading and executing programs.
131
- PyTorchBackendInterface * backend;
130
+ BackendInterface * backend;
132
131
};
133
132
134
133
/* *
135
- * Registers the Backend object (i.e. string name and PyTorchBackendInterface
136
- * pair) so that it could be called via the name during the runtime.
134
+ * Registers the Backend object (i.e. string name and BackendInterface pair) so
135
+ * that it could be called via the name during the runtime.
137
136
*
138
137
* @param[in] backend Backend object
139
138
* @retval Error code representing whether registration was successful.
@@ -151,8 +150,8 @@ using ::executorch::runtime::Backend;
151
150
using ::executorch::runtime::CompileSpec;
152
151
using ::executorch::runtime::DelegateHandle;
153
152
using ::executorch::runtime::get_backend_class;
154
- using ::executorch::runtime::PyTorchBackendInterface;
155
153
using ::executorch::runtime::register_backend;
156
154
using ::executorch::runtime::SizedBuffer;
155
+ using PyTorchBackendInterface = ::executorch::runtime::BackendInterface;
157
156
} // namespace executor
158
157
} // namespace torch
0 commit comments