| 151 | } |
| 152 | |
| 153 | void gpu_data:: |
| 154 | async_copy_to_device() const |
| 155 | { |
| 156 | if (!cuda::use_cuda()) |
| 157 | return; |
| 158 | |
| 159 | if (!device_current) |
| 160 | { |
| 161 | if (device_in_use) |
| 162 | { |
| 163 | // Wait for any possible CUDA kernels that might be using our memory block to |
| 164 | // complete before we overwrite the memory. |
| 165 | synchronize_stream(0); |
| 166 | device_in_use = false; |
| 167 | } |
| 168 | CHECK_CUDA(cudaMemcpyAsync(data_device.get(), data_host.get(), data_size*sizeof(float), cudaMemcpyHostToDevice, (cudaStream_t)cuda_stream.get())); |
| 169 | have_active_transfer = true; |
| 170 | device_current = true; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | void gpu_data:: |
| 175 | set_size( |
nothing calls this directly
no test coverage detected