1 //------------------------------------------------------------------------------
2 // GrB_init: initialize GraphBLAS
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 // GrB_init (or GxB_init) must called before any other GraphBLAS operation.
11 // GrB_finalize must be called as the last GraphBLAS operation.
12
13 #include "GB.h"
14
GrB_init(GrB_Mode mode)15 GrB_Info GrB_init // start up GraphBLAS
16 (
17 GrB_Mode mode // blocking or non-blocking mode
18 )
19 {
20
21 //--------------------------------------------------------------------------
22 // check inputs
23 //--------------------------------------------------------------------------
24
25 GB_CONTEXT ("GrB_init (mode)") ;
26
27 //--------------------------------------------------------------------------
28 // initialize GraphBLAS
29 //--------------------------------------------------------------------------
30
31 // default: use the ANSI C11 malloc memory manager, which is thread-safe
32
33 return (GB_init
34 (mode, // blocking or non-blocking mode
35 malloc, calloc, realloc, free, // ANSI C memory management functions
36 true, // memory functions are thread-safe
37 false, // do not use CUDA
38 Context)) ;
39 }
40
41