| 54 | } |
| 55 | |
| 56 | void RefTensorHandle::Allocate() |
| 57 | { |
| 58 | if (!m_UnmanagedMemory) |
| 59 | { |
| 60 | if (!m_Pool) |
| 61 | { |
| 62 | // unmanaged |
| 63 | m_UnmanagedMemory = ::operator new(m_TensorInfo.GetNumBytes()); |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | m_MemoryManager->Allocate(m_Pool); |
| 68 | } |
| 69 | } |
| 70 | else |
| 71 | { |
| 72 | throw InvalidArgumentException("RefTensorHandle::Allocate Trying to allocate a RefTensorHandle" |
| 73 | "that already has allocated memory."); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | const void* RefTensorHandle::Map(bool /*unused*/) const |
| 78 | { |