| 133 | } |
| 134 | |
| 135 | bool RefTensorHandle::Import(void* memory, MemorySource source) |
| 136 | { |
| 137 | if (source == MemorySource::Malloc) |
| 138 | { |
| 139 | // Check memory alignment |
| 140 | if(!CanBeImported(memory, source)) |
| 141 | { |
| 142 | m_ImportedMemory = nullptr; |
| 143 | return false; |
| 144 | } |
| 145 | |
| 146 | m_ImportedMemory = memory; |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | return false; |
| 151 | } |
| 152 | |
| 153 | bool RefTensorHandle::CanBeImported(void *memory, MemorySource source) |
| 154 | { |
no outgoing calls
no test coverage detected