1function [fname, unsigned, bits] = codegen_type (type) 2%CODEGEN_TYPE determine function suffix, signed or not 3% and # bits a C type 4 5% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 6% SPDX-License-Identifier: Apache-2.0 7 8unsigned = (type (1) == 'u') ; 9switch (type) 10 case 'bool' 11 fname = 'bool' ; 12 bits = 8 ; 13 case 'int8_t' 14 fname = 'int8' ; 15 bits = 8 ; 16 case 'uint8_t' 17 fname = 'uint8' ; 18 bits = 8 ; 19 case 'int16_t' 20 fname = 'int16' ; 21 bits = 16 ; 22 case 'uint16_t' 23 fname = 'uint16' ; 24 bits = 16 ; 25 case 'int32_t' 26 fname = 'int32' ; 27 bits = 32 ; 28 case 'uint32_t' 29 fname = 'uint32' ; 30 bits = 32 ; 31 case 'int64_t' 32 fname = 'int64' ; 33 bits = 64 ; 34 case 'uint64_t' 35 fname = 'uint64' ; 36 bits = 64 ; 37 case 'float' 38 fname = 'fp32' ; 39 bits = 32 ; 40 case 'double' 41 fname = 'fp64' ; 42 bits = 64 ; 43 case { 'float complex', 'GxB_FC32_t' } 44 fname = 'fc32' ; 45 bits = 64 ; 46 case { 'double complex', 'GxB_FC64_t' } 47 fname = 'fc64' ; 48 bits = 128 ; 49 case 'GB_void' 50 fname = 'any' ; 51 bits = nan ; 52end 53 54