| 138 | } |
| 139 | |
| 140 | float* device_write_only() |
| 141 | { |
| 142 | #ifndef DLIB_USE_CUDA |
| 143 | DLIB_CASSERT(false, "CUDA NOT ENABLED"); |
| 144 | #else |
| 145 | DLIB_CASSERT(cuda::use_cuda(), "CUDA disabled"); |
| 146 | #endif |
| 147 | wait_for_transfer_to_finish(); |
| 148 | host_current = false; |
| 149 | device_current = true; |
| 150 | device_in_use = true; |
| 151 | return data_device.get(); |
| 152 | } |
| 153 | |
| 154 | bool host_ready ( |
| 155 | ) const { return host_current; } |