| 42 | } |
| 43 | |
| 44 | bool copy(void* dst, const void* src, size_t bytes, std::string& error, bool queued = false) { |
| 45 | if (!bytes) return true; |
| 46 | if (!dst || !src) return fail(error, "missing running-state buffer"); |
| 47 | const auto status = conversation_detail::copy_nonblocking(dst, src, bytes, queued); |
| 48 | if (status == cudaSuccess) return true; |
| 49 | error = std::string("conversation snapshot running-state copy: ") + cudaGetErrorString(status); |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | // The session's carve (#216): `qsa_states` keeps global ordinals and holds the owned ones |
| 54 | // [qsa_ord0, qsa_ord0 + qsa_alloc); `gdn_state` holds `gdn_alloc` rows. A whole-model session owns every layer. |