1 //------------------------------------------------------------------------------ 2 // GB_split_bitmap_template: split a bitmap matrix into a bitmap tile 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 { 11 12 //-------------------------------------------------------------------------- 13 // get C and the tile A 14 //-------------------------------------------------------------------------- 15 16 const GB_CTYPE *restrict Ax = (GB_CTYPE *) A->x ; 17 GB_CTYPE *restrict Cx = (GB_CTYPE *) C->x ; 18 19 int64_t pC ; 20 #pragma omp parallel for num_threads(C_nthreads) schedule(static) \ 21 reduction(+:cnz) 22 for (pC = 0 ; pC < cnzmax ; pC++) 23 { 24 int64_t i = pC % cvlen ; 25 int64_t j = pC / cvlen ; 26 int64_t iA = aistart + i ; 27 int64_t jA = avstart + j ; 28 int64_t pA = iA + jA * avlen ; 29 Cb [pC] = Ab [pA] ; 30 if (Ab [pA]) 31 { 32 // Cx [pC] = Ax [pA] ; 33 GB_COPY (pC, pA) ; 34 cnz++ ; 35 } 36 } 37 38 done = true ; 39 } 40 41 #undef GB_CTYPE 42 43