\brief Construct from buffer and size without copying memory \param[in] data a memory buffer \param[in] size buffer size \note The passed memory must be kept alive through some other means
| 70 | /// |
| 71 | /// \note The passed memory must be kept alive through some other means |
| 72 | Buffer(const uint8_t* data, int64_t size) |
| 73 | : is_mutable_(false), |
| 74 | is_cpu_(true), |
| 75 | data_(data), |
| 76 | size_(size), |
| 77 | capacity_(size), |
| 78 | device_type_(DeviceAllocationType::kCPU) { |
| 79 | SetMemoryManager(default_cpu_memory_manager()); |
| 80 | } |
| 81 | |
| 82 | Buffer(const uint8_t* data, int64_t size, std::shared_ptr<MemoryManager> mm, |
| 83 | std::shared_ptr<Buffer> parent = NULLPTR, |