MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / Prefetch

Method Prefetch

mlx/data/stream/Prefetch.cpp:9–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace stream {
8
9Prefetch::Prefetch(
10 const std::shared_ptr<Stream>& stream,
11 int prefetch_size,
12 int num_thread)
13 : stream_(stream),
14 pool_(std::make_shared<core::ThreadPool>(num_thread)),
15 prefetchSize_(prefetch_size) {
16 if (prefetchSize_ < 0) {
17 throw std::runtime_error("Prefetch: prefetch size must be positive");
18 }
19}
20
21Prefetch::~Prefetch() {
22 std::unique_lock lock(mutex_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected