-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
108 lines (106 loc) · 3.15 KB
/
index.html
File metadata and controls
108 lines (106 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Three.js CUDA Kernel Visualization</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="content">
<h1 id="viewType">Grid View</h1>
<div id="threadTotal">Thread total =</div>
<div class="input-section">
<div class="blocks-in-grid">
<p>Input the dimensions of the blocks</p>
<label for="blocksInGridx">x</label>
<input
type="number"
id="blocksInGridx"
name="blocksInGrid"
min="1"
max="10"
value="3"
/>
<label for="blocksInGridy">y</label>
<input
type="number"
id="blocksInGridy"
name="blocksInGridy"
min="1"
max="10"
value="3"
/>
<label for="blocksInGridz">z</label>
<input
type="number"
id="blocksInGridz"
name="blocksInGridz"
min="1"
max="10"
value="3"
/>
</div>
<div class="threads-in-block">
<p>Input the dimensions of the threads</p>
<label for="threadsInBlockx">x</label>
<input
type="number"
id="threadsInBlockx"
name="threadsInBlock"
min="1"
max="100"
value="5"
/>
<label for="threadsInBlocky">y</label>
<input
type="number"
id="threadsInBlocky"
name="threadsInBlocky"
min="1"
max="100"
value="5"
/>
<label for="threadsInBlockz">z</label>
<input
type="number"
id="threadsInBlockz"
name="threadsInBlockz"
min="1"
max="100"
value="5"
/>
</div>
<div class="toggle-view">
<button id="switchGrid" onclick="toggleScene('grid')">
Grid View
</button>
<button id="switchBlock" onclick="toggleScene('block')">
Block View
</button>
</div>
<button id="updateButton" onclick="rerender()">Render</button>
</div>
<div class="footer">
<div class="info">
<p>Hover over a block to see its index.</p>
<p>Click on a block to isolate.</p>
<p>Use arrow keys to rotate</p>
</div>
<div id="blockIndex">Block index:</div>
</div>
</div>
<div class="code-representation">
<pre>
<code>
// CUDA Kernel dimensions
const dim3 gridDim = {blocksInGridx, blocksInGridy, blocksInGridz};
const dim3 blockDim = {threadsInBlockx, threadsInBlocky, threadsInBlockz};
<<<gridDim, blockDim>>>kernelFunction();
</code>
</pre>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script defer src="app.js"></script>
</body>
</html>