| 219 | } |
| 220 | |
| 221 | Error encode_fill(StreamImpl* s, void* p, int value, size_t n) { |
| 222 | size_t off = 0; |
| 223 | const Alloc* a = find(p, &off); |
| 224 | if (!a) return fail(kErrorInvalidValue); |
| 225 | check_purged(a, "fill"); |
| 226 | end_encoder(s); |
| 227 | MTL::BlitCommandEncoder* b = open_cb(s)->blitCommandEncoder(); |
| 228 | b->fillBuffer(a->buf, NS::Range::Make(off, n), (uint8_t) value); |
| 229 | b->endEncoding(); |
| 230 | ++rt().stats.blits; |
| 231 | return kSuccess; |
| 232 | } |
| 233 | |
| 234 | Error encode_dispatch(StreamImpl* s, const Op& o) { |
| 235 | MTL::ComputeCommandEncoder* e = encoder(s); |
no test coverage detected