@@ -292,18 +292,22 @@ struct DeferredGetItem : public Deferred {
292292 // now we can create the PTensor op using the above Values
293293 auto res = builder.create <::imex::ptensor::SubviewOp>(
294294 loc, outTyp, av, offsV, sizesV, stridesV);
295- dm.addVal (this ->guid (), res,
296- [this , dtype](Transceiver *transceiver, uint64_t rank,
297- void *allocated, void *aligned, intptr_t offset,
298- const intptr_t *sizes, const intptr_t *strides,
299- int64_t *gs_allocated, int64_t *gs_aligned,
300- uint64_t *lo_allocated, uint64_t *lo_aligned,
301- uint64_t balanced) {
302- this ->set_value (std::move (
303- mk_tnsr (transceiver, dtype, rank, allocated, aligned,
304- offset, sizes, strides, gs_allocated, gs_aligned,
305- lo_allocated, lo_aligned, balanced)));
306- });
295+
296+ auto future_a = Registry::get (_a);
297+
298+ dm.addVal (
299+ this ->guid (), res,
300+ [this , dtype, future_a](
301+ Transceiver *transceiver, uint64_t rank, void *allocated,
302+ void *aligned, intptr_t offset, const intptr_t *sizes,
303+ const intptr_t *strides, int64_t *gs_allocated, int64_t *gs_aligned,
304+ uint64_t *lo_allocated, uint64_t *lo_aligned, uint64_t balanced) {
305+ auto t = mk_tnsr (transceiver, dtype, rank, allocated, aligned, offset,
306+ sizes, strides, gs_allocated, gs_aligned,
307+ lo_allocated, lo_aligned, balanced);
308+ t->set_base (future_a.get ());
309+ this ->set_value (std::move (t));
310+ });
307311 return false ;
308312 }
309313
0 commit comments