| 167 | |
| 168 | |
| 169 | InstrumentManager::InstrumentManager(CUcontext ctx, CUdevice dev) |
| 170 | { |
| 171 | preempt_buf_ = std::make_unique<ResizableBuffer>(dev); |
| 172 | preempt_buf_ptr_ = preempt_buf_->Ptr(); |
| 173 | instrument_ctx_ = InstrumentContext::Instance(ctx); |
| 174 | op_stream_ = instrument_ctx_->OpStream(); |
| 175 | } |
| 176 | |
| 177 | /* preempt buffer layout: (see also tools/instrument/inject.cu) |
| 178 | * |<------- uint32 ------->|<--- 32 bits -->|<---- uint64 ----->|<--------- uint32 --------->|<----------- uint32 ---------->|<------ ... ------>| |