| 14 | #define GB_FREE_ALL ; |
| 15 | |
| 16 | GrB_Info GrB_Matrix_wait // finish all work on a matrix |
| 17 | ( |
| 18 | GrB_Matrix A, |
| 19 | GrB_WaitMode waitmode |
| 20 | ) |
| 21 | { |
| 22 | |
| 23 | //-------------------------------------------------------------------------- |
| 24 | // check inputs |
| 25 | //-------------------------------------------------------------------------- |
| 26 | |
| 27 | GB_WHERE (A, "GrB_Matrix_wait (A, waitmode)") ; |
| 28 | GB_RETURN_IF_NULL_OR_FAULTY (A) ; |
| 29 | |
| 30 | //-------------------------------------------------------------------------- |
| 31 | // finish all pending work on the matrix, including creating A->Y |
| 32 | //-------------------------------------------------------------------------- |
| 33 | |
| 34 | if (waitmode != GrB_COMPLETE && |
| 35 | (GB_ANY_PENDING_WORK (A) || GB_NEED_HYPER_HASH (A))) |
| 36 | { |
| 37 | GrB_Info info ; |
| 38 | GB_BURBLE_START ("GrB_Matrix_wait") ; |
| 39 | GB_OK (GB_wait (A, "matrix", Context)) ; |
| 40 | GB_OK (GB_hyper_hash_build (A, Context)) ; |
| 41 | GB_BURBLE_END ; |
| 42 | } |
| 43 | |
| 44 | //-------------------------------------------------------------------------- |
| 45 | // return result |
| 46 | //-------------------------------------------------------------------------- |
| 47 | |
| 48 | #pragma omp flush |
| 49 | return (GrB_SUCCESS) ; |
| 50 | } |
| 51 | |