Create all needed streams one each GPU
| 182 | |
| 183 | // Create all needed streams one each GPU |
| 184 | static void create_gpu_streams( |
| 185 | std::vector<std::vector<cudaStream_t>>* streams, |
| 186 | const int gpus, |
| 187 | int STREAMS_PER_GPU) |
| 188 | { |
| 189 | streams->resize(gpus); |
| 190 | for (int i = 0; i < gpus; ++i) { |
| 191 | CUDA_CHECK(cudaSetDevice(i)); |
| 192 | (*streams)[i].resize(STREAMS_PER_GPU); |
| 193 | for (int j = 0; j < STREAMS_PER_GPU; ++j) { |
| 194 | cudaStreamCreateWithFlags(&((*streams)[i][j]), cudaStreamNonBlocking); |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | // Synchronize all streams on all GPUs |
| 200 | static void sync_all_streams( |
no outgoing calls
no test coverage detected