Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (59 sloc) 1.92 KB
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script type="text/javascript" src="static/OriginalSylvester.js"> </script>
<script>
function createArrayMatrix(width, height, valueOne, valueTwo){
arrayMatrix = []
row = []
for(i = 0; i < width; ++i){
if(i % 2 == 0)
row[row.length] = valueOne;
if(i % 2 == 1){
if(valueTwo)
row[row.length] = valueTwo;
else
row[row.length] = valueOne;
}
}
for(i = 0; i < height; ++i){
arrayMatrix[arrayMatrix.length] = row.slice();
}
return arrayMatrix;
}
$(document).ready(function(){
$("#execute").click(function(){
var startDate = new Date();
one = $M(createArrayMatrix(1024, 1024, 1, 2));
other = $M(createArrayMatrix(1024, 1024, 1));
two = one.multiply(other);
alert((new Date() - startDate) / 1000.0);
});
$("#executeSample").click(function(){
var one = $M([[1,2], [1, 2 ]]);
var two= $M([[1,2], [1, 2 ]]);
var result = one.multiply(two)
alert(result.elements);
});
});
</script>
</head>
<body>
<div style="padding: 5px; border: 1px solid black; position:relative; width:500px;">
This page includes the original sylvester library. Hit execute to benchmark a multiply of two 1024x1024 matrices. (You will have to hit continue when it asks if you want to stop the long running script.)<br/>
</div>
<input id="execute" type="button" value="execute"><br/><br/>
Open up firebug or the console to test it out <br/>
example code:
<pre>
<code>
var one = $M([[1,2], [1, 2 ]]);
var two= $M([[1,2], [1, 2 ]]);
var result = one.multiply(two)
alert(result.elements);
</code>
</pre>
<input id="executeSample" type="button" value="execute"><br/><br/>
<span><a href="sylvesterTest.html">gpu sylvester</a>&nbsp;&nbsp;&nbsp;<a href="sylvesterTestOriginal.html">original sylvester</a></span>
</body>
</html>
Something went wrong with that request. Please try again.