File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
include/graphblas/reference Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ namespace grb {
9797 /* * Per-thread capacity for parallel stack updates. */
9898 size_t _buf;
9999
100+ /* * Number of threads for which these coordinates have been initialised. */
101+ #ifdef _H_GRB_REFERENCE_OMP_COORDINATES
102+ const size_t _threads = config::OMP::threads();
103+ #else
104+ const size_t _threads = 1 ;
105+ #endif
106+
100107 /* *
101108 * Increments the number of nonzeroes in the current thread-local stack.
102109 *
@@ -294,6 +301,10 @@ namespace grb {
294301 // blocks are not managed by this class)
295302 }
296303
304+ size_t requiredThreadsForUpdate () const noexcept {
305+ return _threads;
306+ }
307+
297308 /* *
298309 * @returns An empty thread-local stack for new nonzeroes.
299310 */
Original file line number Diff line number Diff line change @@ -1274,6 +1274,9 @@ namespace grb {
12741274
12751275 template < typename D, typename C >
12761276 inline C & getCoordinates ( Vector< D, reference, C > &x ) noexcept {
1277+ #ifdef _H_GRB_REFERENCE_OMP_VECTOR
1278+ assert ( x._coordinates .requiredThreadsForUpdate () == config::OMP::threads () );
1279+ #endif
12771280 return x._coordinates ;
12781281 }
12791282
You can’t perform that action at this time.
0 commit comments