1 # Created by Octave 3.6.1, Sun Apr 01 21:17:46 2012 UTC <root@t61>
13 # name: <cell-element>
17 function benchmark_dtmm (m, n, nvec)
19 Dense transposed matrix-matrix and matrix-vector multiplication benchmark.
20 This is to test the "compound operators" feature introduced in Octave.
23 m = row dimension of matrices
24 n = col dimension of matrices
25 nvec = number of vector op repeats
28 time_tmm = Time for A'*B (A,B m-by-n matrices)
29 time_smm = Time for A'*A
30 time_mtm = Time for A*B' (A,B n-by-m matrices)
31 time_msm = Time for A*A'
32 time_tmv = Time for A'*v nvec-times (A m-by-n matrix)
33 ratio_tmv = Ratio to precomputed transpose time
34 time_mtv = Time for v*A' nvec-times (A m-by-n matrix)
35 ratio_mtv = Ratio to precomputed transpose time
40 # name: <cell-element>
44 function benchmark_dtmm (m, n, nvec)
46 Dense transposed matrix-mat
50 # name: <cell-element>
57 # name: <cell-element>
61 function benchmark_index (n, rep)
63 Test speed of array indexing.
67 rep = number of repeats
70 time_slice1 = time for a(i:j)
71 time_slice1s = time for a(i:k:j)
72 time_slice1v = time for a(idx)
73 time_slice2c = time for a(:,i:j)
74 time_slice2r = time for a(i:j,:)
75 time_slice2cv = time for a(:,idx)
76 time_slice2rv = time for a(idx,:)
77 time_slicenc = time for a(:,:,i:j,k)
78 time_slicend = time for a(:,:,k,i:j)
79 time_slicens = time for a(i,j,k,:)
80 time_spreadr = time for a(ones(1, k), :), a row vector
81 time_spreadc = time for a(:, ones(1, k)), a column vector
86 # name: <cell-element>
90 function benchmark_index (n, rep)
92 Test speed of array indexing.
96 # name: <cell-element>
103 # name: <cell-element>
107 function benchmark_intmath (n, ratio)
109 Test speed of integer math & conversions.
113 ratio = ratio of intmath for generating integers
116 time_uint8_conv = time to convert real vector to uint8
117 time_uint8_add = time to add two uint8 vectors
118 time_uint8_sub = time to subtract two uint8 vectors
119 time_uint8_mul = time to multiply two uint8 vectors
120 time_uint8_div = time to divide two uint8 vectors
121 time_int8_conv = time to convert real vector to int8
122 time_int8_add = time to add two int8 vectors
123 time_int8_sub = time to subtract two int8 vectors
124 time_int8_mul = time to multiply two int8 vectors
125 time_int8_div = time to divide two int8 vectors
126 time_uint16_conv = time to convert real vector to uint16
127 time_uint16_add = time to add two uint16 vectors
128 time_uint16_sub = time to subtract two uint16 vectors
129 time_uint16_mul = time to multiply two uint16 vectors
130 time_uint16_div = time to divide two uint16 vectors
131 time_int16_conv = time to convert real vector to int16
132 time_int16_add = time to add two int16 vectors
133 time_int16_sub = time to subtract two int16 vectors
134 time_int16_mul = time to multiply two int16 vectors
135 time_int16_div = time to divide two int16 vectors
136 time_uint32_conv = time to convert real vector to uint32
137 time_uint32_add = time to add two uint32 vectors
138 time_uint32_sub = time to subtract two uint32 vectors
139 time_uint32_mul = time to multiply two uint32 vectors
140 time_uint32_div = time to divide two uint32 vectors
141 time_int32_conv = time to convert real vector to int32
142 time_int32_add = time to add two int32 vectors
143 time_int32_sub = time to subtract two int32 vectors
144 time_int32_mul = time to multiply two int32 vectors
145 time_int32_div = time to divide two int32 vectors
150 # name: <cell-element>
154 function benchmark_intmath (n, ratio)
156 Test speed of integer math
160 # name: <cell-element>
167 # name: <cell-element>
171 function benchmark_permute (n)
173 Test speed of array permuting.
176 n = dimension size (n^5 is number of elements)
180 time_21345 = time for [2,1,3,4,5] permutation
181 time_13425 = time for [1,3,4,2,5] permutation
182 time_34125 = time for [3,4,1,2,5] permutation
183 time_45123 = time for [4,5,1,2,3] permutation
188 # name: <cell-element>
192 function benchmark_permute (n)
194 Test speed of array permuting.
198 # name: <cell-element>
205 # name: <cell-element>
209 function benchmark_stmm (n, nvec)
211 Sparse transposed matrix-vector multiplication benchmark.
212 This is to test the "compound operators" feature introduced in Octave.
215 n = dimension of matrix
216 nvec = number of vector op repeats
219 time_tmm = Time for A'*B (B n^2-by-nvec matrix)
220 time_tmv = Time for A'*v nvec-times (v vector)
221 time_mtm = Time for B*A' (B nvec-by-n^2 matrix)
222 time_mtv = Time for v*A' nvec-times (v vector)
227 # name: <cell-element>
231 function benchmark_stmm (n, nvec)
233 Sparse transposed matrix-vecto
237 # name: <cell-element>
244 # name: <cell-element>
248 function results = benchutil_average (benchmark, nruns, arg1, arg2, ...)
249 Average the benchmark results over a certain number of runs.
253 # name: <cell-element>
257 function results = benchutil_average (benchmark, nruns, arg1, arg2, .
261 # name: <cell-element>
265 benchutil_default_arg
268 # name: <cell-element>
272 benchmark_default_arg (name, value)
273 set argument to a default value. This function is provided for
274 compatibility with Matlab, which misses Octave's default arguments
280 # name: <cell-element>
284 benchmark_default_arg (name, value)
285 set argument to a default value.
289 # name: <cell-element>
296 # name: <cell-element>
300 function benchutil_initialize (mfname)
301 initializes a benchmark. The argument passed must be the filename of the
307 # name: <cell-element>
311 function benchutil_initialize (mfname)
312 initializes a benchmark.
316 # name: <cell-element>
323 # name: <cell-element>
327 function benchutil_is_octave ()
328 returns true if this is Octave. If not, we're probably run on Matlab.
333 # name: <cell-element>
337 function benchutil_is_octave ()
338 returns true if this is Octave.
342 # name: <cell-element>
349 # name: <cell-element>
353 function [bench_desc, arg_desc, result_desc] = benchutil_parse_desc (mpath)
354 parse the inline comment description from a benchmark
359 # name: <cell-element>
363 function [bench_desc, arg_desc, result_desc] = benchutil_parse_desc (mpath)
368 # name: <cell-element>
375 # name: <cell-element>
379 function OLD_FLAG = benchutil_verbose (NEW_FLAG)
380 sets or queries the benchmark verbosity flag
385 # name: <cell-element>
389 function OLD_FLAG = benchutil_verbose (NEW_FLAG)
390 sets or queries the benchmark