File: gbtest5.m

package info (click to toggle)
suitesparse-graphblas 7.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 67,112 kB
  • sloc: ansic: 1,072,243; cpp: 8,081; sh: 512; makefile: 503; asm: 369; python: 125; awk: 10
file content (87 lines) | stat: -rw-r--r-- 2,724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function gbtest5
%GBTEST5 test GrB.descriptorinfo

% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0

list_out  = { [ ], 'default', 'replace' } ;
list_in   = { [ ], 'default', 'transpose' } ;
list_mask = { [ ], 'default', 'complement', ...
                   'structural complement', 'structure' } ;
list_axb  = { [ ], 'default', 'gustavson', 'dot', 'hash', 'saxpy' } ;
list_kind = { [ ], 'sparse', 'full', 'grb', 'default' } ;

ntrials = 0;

d = struct %#ok<*NASGU,*NOPRT>

for k1 = 1:length (list_out)
    out = list_out {k1} ;
    for k2 = 1:length (list_in)
        in0 = list_in {k2} ;
        for k3 = 1:length (list_in)
            in1 = list_in {k3} ;
            for k4 = 1:length (list_mask)
                mask = list_mask {k4} ;
                for k5 = 1:length (list_axb)
                    axb = list_axb {k5} ;
                    for k6 = 1:length (list_kind)
                        kind = list_kind {k6} ;

                        for nthreads = [0 2]
                            for chunk = [0 10000]

                                clear d
                                d = struct ;

                                if (~isempty (out))
                                    d.out = out ;
                                end

                                if (~isempty (mask))
                                    d.mask = mask ;
                                end

                                if (~isempty (in0))
                                    d.in0 = in0 ;
                                end

                                if (~isempty (in1))
                                    d.in1 = in1 ;
                                end

                                if (~isempty (axb))
                                    d.axb = axb ;
                                end

                                if (~isempty (kind))
                                    d.kind = kind ;
                                end

                                if (nthreads > 0)
                                    d.nthreads = nthreads ;
                                end

                                if (chunk > 0)
                                    d.chunk = chunk ;
                                end

                                d
                                GrB.descriptorinfo (d) ;
                                ntrials = ntrials + 1 ;
                            end
                        end
                    end
                end
            end
        end
    end
end

fprintf ('testing error handling (errors expected):\n') ;

GrB.descriptorinfo

ntrials
fprintf ('gbtest5: all tests passed\n') ;