| 171 | } |
| 172 | |
| 173 | CudaCurrentDeviceGuard::CudaCurrentDeviceGuard(int32_t dev_id) { |
| 174 | CHECK(!pthread_fork::IsForkedSubProcess()) << pthread_fork::kOfCudaNotSupportInForkedSubProcess; |
| 175 | OF_CUDA_CHECK(cudaGetDevice(&saved_dev_id_)); |
| 176 | OF_CUDA_CHECK(cudaSetDevice(dev_id)); |
| 177 | } |
| 178 | |
| 179 | CudaCurrentDeviceGuard::CudaCurrentDeviceGuard() { OF_CUDA_CHECK(cudaGetDevice(&saved_dev_id_)); } |
| 180 |
nothing calls this directly
no test coverage detected