\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
| 60 | /// |
| 61 | /// \note The passed memory must be kept alive through some other means |
| 62 | Buffer(const uint8_t* data, int64_t size) |
| 63 | : is_mutable_(false), |
| 64 | is_cpu_(true), |
| 65 | data_(data), |
| 66 | size_(size), |
| 67 | capacity_(size), |
| 68 | device_type_(DeviceAllocationType::kCPU) { |
| 69 | SetMemoryManager(default_cpu_memory_manager()); |
| 70 | } |
| 71 | |
| 72 | Buffer(const uint8_t* data, int64_t size, std::shared_ptr<MemoryManager> mm, |
| 73 | std::shared_ptr<Buffer> parent = NULLPTR, |