Skip to content

Commit 942cb8e

Browse files
committed
WIP Binary Operator support support
1 parent 3b3992c commit 942cb8e

7 files changed

Lines changed: 1270 additions & 95 deletions

File tree

demo/MD5-hash/index.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="description" content="gpu.js - playground. Run and benchmark demos for gpu.js - is a single-file JavaScript library for GPGPU in the browser. gpu.js will automatically compile specially written JavaScript functions into shader language and run them on the GPU using the WebGL API. In the case where WebGL is not available, the functions will still run in regular JavaScript." />
8+
9+
<meta property="og:title" content="gpu.js - playground : GPU Accelerated JavaScript" />
10+
<meta property="og:type" content="website" />
11+
<meta property="og:url" content="http://gpu.rocks/" />
12+
<meta property="og:image" content="http://gpu.rocks/img/ogimage.png" />
13+
14+
<title>gpu.js - playground : GPU Accelerated JavaScript</title>
15+
<link rel="icon" href="img/jelly.png">
16+
17+
<!-- jquery + bootstrap -->
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.js"></script>
19+
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet">
20+
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.js"></script>
21+
22+
<!-- code mirror -->
23+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/codemirror.css">
24+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/codemirror.js"></script>
25+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/mode/javascript/javascript.js"></script>
26+
27+
<!-- seed random : https://github.com/davidbau/seedrandom -->
28+
<script src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.0/lib/xor4096.min.js"></script>
29+
30+
<!-- chartist -->
31+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chartist/0.9.7/chartist.min.css">
32+
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartist/0.9.7/chartist.js"></script>
33+
34+
<!-- gpu.js scripts -->
35+
<script src="../../bin/gpu.js"></script>
36+
<script src="md5-demo.js"></script>
37+
<link rel="stylesheet" href="md5-demo.css">
38+
</head>
39+
<body>
40+
<a href="https://github.com/gpujs/gpu.js" class="github-corner"><svg width="80" height="80" viewBox="0 0 250 250" style="fill: rgba(21, 21, 19, 0.53); color:#fff; position: absolute; top: 0; border: 0; right: 0;"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
41+
<div class="container">
42+
<div class="page-header">
43+
<h1>GPU.js - MD5 : <small style="display:inline-block">GPU Accelerated JavaScript</small></h1>
44+
</div>
45+
</div>
46+
<div class="container">
47+
<blockquote>
48+
This page here, is a quick MD5 demo<br/>
49+
<br/>
50+
[SECURITY WARNING] : This playground here does an "evil" eval on the input funcitons. So obviously do not carlessly copy and paste things here.
51+
<br/><br/>
52+
<a href="https://gpu.rocks">Our main site is found at https://gpu.rocks</a>
53+
<br/><br/>
54+
Enjoy =)
55+
<br/><br/>
56+
~ GPU.JS team
57+
</blockquote>
58+
</div>
59+
60+
<div class="container chartContainer">
61+
<button id="bench_btn" type="button" class="btn btn-primary btn-lg btn-block bench_btn">Run the benchmark!</button>
62+
<h4>Average Time taken</h4>
63+
<div id="chart_time" class="chart_time bench_chart"></div>
64+
<h4>GPU Performance improvement</h4>
65+
<div id="chart_gain" class="chart_gain bench_chart"></div>
66+
</div>
67+
<br/>
68+
</body>
69+
</html>

demo/MD5-hash/md5-demo.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.paramContainer {
2+
margin-top: 20px;
3+
}
4+
5+
.sampleSet {
6+
background: rgba(0,0,0,0.2);
7+
}
8+
9+
.sampleSet .sampleSetInner {
10+
padding-top:10px;
11+
}
12+
13+
.sampleSet .sampleSetInner input,
14+
.sampleSet .sampleSetInner textarea {
15+
min-width: 100%;
16+
max-width: 100%;
17+
width:100%;
18+
}
19+
20+
.sampleSet .sampleSetInner textarea {
21+
min-height:150px;
22+
}
23+
24+
.sampleSet .sample_output {
25+
min-height:40px;
26+
}
27+
28+
.kernelGroupInner textarea,
29+
.kernel_function {
30+
width:100%;
31+
}
32+
33+
.kernel_sample, .param_sample {
34+
min-height:40px;
35+
}
36+
37+
.chartContainer {
38+
padding-top:20px;
39+
}
40+
41+
.bench_chart {
42+
margin-top:20px;
43+
height: 400px;
44+
}

0 commit comments

Comments
 (0)