MCPcopy Create free account
hub / github.com/Niko1221/Strata / encode_dispatch

Function encode_dispatch

engine/metal/src/gpu/runtime.cpp:234–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234Error encode_dispatch(StreamImpl* s, const Op& o) {
235 MTL::ComputeCommandEncoder* e = encoder(s);
236 e->setComputePipelineState(o.pipe);
237 if (o.big_args.empty()) e->setBytes(o.args, o.arg_bytes, 0);
238 else e->setBytes(o.big_args.data(), o.big_args.size(), 0);
239 if (o.tg_bytes) e->setThreadgroupMemoryLength(o.tg_bytes, 0);
240 e->dispatchThreadgroups(MTL::Size(o.groups.x, o.groups.y, o.groups.z), MTL::Size(o.threads.x, o.threads.y, o.threads.z));
241 ++rt().stats.dispatches;
242 if (++s->pending >= kFlushEvery) flush(s);
243 return kSuccess;
244}
245
246Error record_event(EventImpl* e, StreamImpl* s) {
247 flush(s); // CUDA submits on launch: a recorded event must become complete without a further call

Callers 2

run_opFunction · 0.85
dispatchFunction · 0.85

Calls 6

encoderFunction · 0.85
SizeInterface · 0.85
flushFunction · 0.70
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected