| 11 | #include "GB_stringify.h" |
| 12 | |
| 13 | void GB_debugify_ewise |
| 14 | ( |
| 15 | // C matrix: |
| 16 | bool C_iso, // if true, operator is ignored |
| 17 | int C_sparsity, // sparse, hyper, bitmap, or full |
| 18 | GrB_Type ctype, // C=((ctype) T) is the final typecast |
| 19 | // M matrix: |
| 20 | GrB_Matrix M, |
| 21 | bool Mask_struct, |
| 22 | bool Mask_comp, |
| 23 | // operator: |
| 24 | GrB_BinaryOp binaryop, // may be NULL (used by GB_wait) |
| 25 | bool flipxy, |
| 26 | // A and B matrices: |
| 27 | GrB_Matrix A, |
| 28 | GrB_Matrix B |
| 29 | ) |
| 30 | { |
| 31 | |
| 32 | uint64_t scode ; |
| 33 | |
| 34 | GrB_Type atype = A->type ; |
| 35 | GrB_Type btype = B->type ; |
| 36 | |
| 37 | // enumify the ewise problem |
| 38 | GB_enumify_ewise (&scode, C_iso, C_sparsity, ctype, |
| 39 | M, Mask_struct, Mask_comp, binaryop, flipxy, A, B) ; |
| 40 | |
| 41 | // namify the ewise problem |
| 42 | char ewise_name [256 + 8*GxB_MAX_NAME_LEN] ; |
| 43 | GB_namify_problem (ewise_name, scode, |
| 44 | (binaryop == NULL) ? "nop" : binaryop->name, |
| 45 | NULL, |
| 46 | (binaryop == NULL) ? NULL : binaryop->xtype->name, |
| 47 | (binaryop == NULL) ? NULL : binaryop->ytype->name, |
| 48 | (binaryop == NULL) ? NULL : binaryop->ztype->name, |
| 49 | atype->name, |
| 50 | btype->name, |
| 51 | ctype->name) ; |
| 52 | |
| 53 | // construct the filename and create the file |
| 54 | char filename [512 + 8*GxB_MAX_NAME_LEN] ; |
| 55 | sprintf (filename, "/tmp/GB_ewise_%s.h", ewise_name); |
| 56 | FILE *fp = fopen (filename, "w") ; |
| 57 | |
| 58 | // macrofy the ewise problem |
| 59 | GB_macrofy_ewise (fp, scode, binaryop, ctype, atype, btype) ; |
| 60 | fclose (fp) ; |
| 61 | } |
| 62 |
no test coverage detected