Skip to content

Commit 95da83b

Browse files
author
Harsh
committed
fix typo in benchmarkOut JSON methods
1 parent 95eacc6 commit 95da83b

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This saves the [chartist.js](https://gionkunz.github.io/chartist-js/) style JSON
218218
### API
219219

220220
#### Output
221-
The output of any benchmark(multiple or single) is a [`benchmarkOut`](#benchmarkout) Object.
221+
The output of any benchmark(multiple or single) is a [`BenchmarkOut`](#benchmarkout) Object.
222222

223223
#### Options
224224
The following options can be passed on to the `benchmark` or `multipleBenchmark` method.
@@ -279,6 +279,29 @@ The [output](#output) contains a `stats` property which shows the overall stats
279279
- - - `worst_performer`(`gpu` | `cpu`): The worst overall performer.
280280
- - - `diff`: Same as the diff object in `run_time`
281281

282+
- `score`: The score object is a property of the main output object.
283+
- - `gpu`, `cpu`(*Number*): The score is a number representing the overall normalized averge performance of the GPU or CPU. This score can be directly compared to other benchmarks or hardware.
284+
285+
#### BenchmarkOut
286+
This object stores the output of **Benchmark**.
287+
288+
##### Methods
289+
- `getDataField(field, index = 0)`(returns: ***): Gets any one of the output field(property).
290+
- - `field`(*String*): The name of the field.
291+
- - `index`(Number): The index of the benchmark if multiple benchmarks are run.
292+
- `getPlotlyJSON(compareFields)`, `getChartistJSON(compareFields)`(Returns: *Array*): Returns plotly style JSON for charts. (only for multiple benchmarks)
293+
- - `compareFields`: An array of objects having two properties `x` and `y` representing the data to be plotted on their respective axes.
294+
- - - `x`, `y`(*String*): Can be one of:
295+
- - - - `matrix_size`
296+
- - - - `gpu_score`
297+
- - - - `cpu_score`
298+
- - - - `gpu_run_time_mat_mult`: GPU matrix multiplication run time
299+
- - - - `cpu_run_time_mat_mult`: CPU matrix multiplication run time
300+
- - - - `gpu_run_time_mat_conv`: GPU matrix convolution run time
301+
- - - - `cpu_run_time_mat_conv`: CPU matrix convolution run time
302+
- - - - `pipe_run_time`: GPU pipelining run time
303+
304+
282305
#### Benchmarks
283306

284307
##### Matrix Multiplication

src/benches/convolution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ const kernel = [
33
[2, 1, 2],
44
[1, 2, 1]
55
]
6+
67
const kernelX = kernel[0].length,
78
kernelY = kernel.length,
89
paddingX = Math.floor(kernelX / 2),
910
paddingY = Math.floor(kernelY / 2);
1011

11-
1212
/**
1313
* @method paddificate
1414
* @description Pads a JavaScript array.

src/run.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const run = options => {
1818
options.output = [options.matrix_size, options.matrix_size];
1919

2020
const getTexture = getgetTextureKernel(options.gpu, options.matrix_size, options.matrix_size);
21-
2221
const mat = benchIt(() => generateMatrices(options.matrix_size)),
2322
padded = benchIt(() => paddificate(mat.ret[0], paddingX, paddingY));
2423

@@ -109,11 +108,9 @@ const run = options => {
109108
mat_pad: padded.time,
110109

111110
build_time,
112-
113111
run_time,
114112

115113
stats,
116-
117114
score: getScore(run_time, options.matrix_size),
118115

119116
options

src/util/benchmark-out.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class BenchmarkOut {
7878
getPlotlyJSON(compareFields = [
7979
{
8080
x: 'matrix_size',
81-
y: 'gpu_run_time-mat_mult'
81+
y: 'gpu_run_time_mat_mult'
8282
},
8383
{
8484
x: 'matrix_size',
@@ -110,7 +110,7 @@ class BenchmarkOut {
110110
getChartistJSON(compareFields = [
111111
{
112112
x: 'matrix_size',
113-
y: 'gpu_run_time-mat_mult'
113+
y: 'gpu_run_time_mat_mult'
114114
},
115115
{
116116
x: 'matrix_size',

0 commit comments

Comments
 (0)