Skip to content

Commit 3bee831

Browse files
cccclaifacebook-github-bot
authored andcommitted
Add et_dump related API to module (pytorch#9284)
Summary: Pull Request resolved: pytorch#9284 It is for reusing the exention/module in the module definition in pybindings https://github.com/pytorch/executorch/blob/1a918c779e16c0ee903a08b30c1c666d1efb2c57/extension/pybindings/pybindings.cpp#L172 Differential Revision: D71135352
1 parent 196e987 commit 3bee831

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extension/module/module.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,16 @@ class Module {
469469
return event_tracer_.get();
470470
}
471471

472+
bool has_etdump_debug_buffer() const {
473+
return static_cast<bool>(debug_buffer_);
474+
}
475+
476+
ET_NODISCARD
477+
runtime::Span<uint8_t> get_etdump_debug_buffer() {
478+
return runtime::Span<uint8_t>(debug_buffer_.get(), debug_buffer_size_);
479+
}
480+
481+
472482
private:
473483
struct MethodHolder {
474484
std::vector<std::vector<uint8_t>> planned_buffers;
@@ -489,6 +499,8 @@ class Module {
489499
std::unique_ptr<runtime::EventTracer> event_tracer_;
490500
std::unique_ptr<runtime::DataLoader> data_map_loader_;
491501
std::unique_ptr<NamedDataMap> data_map_;
502+
std::unique_ptr<uint8_t[]> debug_buffer_;
503+
size_t debug_buffer_size_;
492504

493505
protected:
494506
std::unordered_map<std::string, MethodHolder> methods_;

0 commit comments

Comments
 (0)