1 //------------------------------------------------------------------------------
2 // GrB_Descriptor_wait: wait for a user-defined GrB_Descriptor to complete
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 // In SuiteSparse:GraphBLAS, a user-defined GrB_Descriptor has no pending
11 // operations to wait for. All this method does is verify that the descriptor
12 // is properly initialized, and then it does an OpenMP flush. Note that unlike
13 // other methods, passing in a NULL pointer, or a pointer to a NULL descriptor
14 // is valid, since a NULL descriptor results in default settings.
15
16 #include "GB.h"
17
GrB_Descriptor_wait(GrB_Descriptor * desc)18 GrB_Info GrB_Descriptor_wait // no work, just check if GrB_Descriptor is valid
19 (
20 GrB_Descriptor *desc // required; may not be NULL a pointer to NULL
21 )
22 {
23
24 //--------------------------------------------------------------------------
25 // check inputs
26 //--------------------------------------------------------------------------
27
28 #pragma omp flush
29 GB_WHERE1 ("GrB_Descriptor_wait (&desc)") ;
30 if (desc != NULL && (*desc) != NULL)
31 {
32 GB_RETURN_IF_FAULTY (*desc) ;
33 }
34
35 //--------------------------------------------------------------------------
36 // return result
37 //--------------------------------------------------------------------------
38
39 #pragma omp flush
40 return (GrB_SUCCESS) ;
41 }
42
43