Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions extension/module/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ class Module {
MmapUseMlockIgnoreErrors,
};

struct MethodHolder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you leave it private and just make a friend class for benchmarking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I don't want to access any data in Module (and don't even have a reference to Module, since benchmarking uses program/method), just want to use MethodHolder as a helper structure. I can also just copy and paste it into the benchmark runner code if you prefer this to be private

std::vector<std::vector<uint8_t>> planned_buffers;
std::vector<runtime::Span<uint8_t>> planned_spans;
std::unique_ptr<runtime::HierarchicalAllocator> planned_memory;
std::unique_ptr<runtime::MemoryManager> memory_manager;
std::unique_ptr<runtime::Method> method;
std::vector<runtime::EValue> inputs;
};

/**
* Constructs an instance by loading a program from a file with specified
* memory locking behavior.
Expand Down Expand Up @@ -423,16 +432,6 @@ class Module {
return event_tracer_.get();
}

private:
struct MethodHolder {
std::vector<std::vector<uint8_t>> planned_buffers;
std::vector<runtime::Span<uint8_t>> planned_spans;
std::unique_ptr<runtime::HierarchicalAllocator> planned_memory;
std::unique_ptr<runtime::MemoryManager> memory_manager;
std::unique_ptr<runtime::Method> method;
std::vector<runtime::EValue> inputs;
};

private:
std::string file_path_;
LoadMode load_mode_{LoadMode::MmapUseMlock};
Expand Down
Loading