-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added experiments for cwise, ndarray-ops and numeric
- Loading branch information
1 parent
508ec63
commit 2ea792b
Showing
14 changed files
with
4,679 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var ndarray = require("ndarray") | ||
var cwise = require("cwise") | ||
|
||
var operator = cwise({ | ||
args: ["array", "array"], | ||
body: function(a, b) { | ||
a += b + 0.1 | ||
b -= a * 0.5 | ||
} | ||
}) | ||
|
||
function benchmark(nx, ny, nz, num_iter) { | ||
var A = ndarray.zeros([nx,ny,nz]) | ||
var B = ndarray.zeros([nx,ny,nz]) | ||
|
||
for(var count=0; count<num_iter; ++count) { | ||
operator(A,B) | ||
} | ||
} | ||
|
||
module.exports = benchmark | ||
module.exports.prop_name = "cwise" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var ndarray = require("ndarray") | ||
, ops = require("ndarray-ops") | ||
|
||
function benchmark(nx, ny, nz, num_iter) { | ||
var A = ndarray.zeros([nx,ny,nz]) | ||
var B = ndarray.zeros([nx,ny,nz]) | ||
var C = ndarray.zeros([nx,ny,nz]) | ||
|
||
for(var count=0; count<num_iter; ++count) { | ||
ops.addseq(ops.addeq(A, B), 0.1) | ||
ops.subeq(B, ops.muls(C, A, 0.5)) | ||
} | ||
} | ||
|
||
module.exports = benchmark | ||
module.exports.prop_name = "ndarray-ops" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.