forked from szho42/cuda-calculator
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
224 lines (208 loc) · 8.02 KB
/
index.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CUDA Occupancy Calculator</title>
<meta name="description" content="This site helps you calculate the occupancy of your CUDA kernel.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.7.20/c3.min.css"
integrity="sha512-cznfNokevSG7QPA5dZepud8taylLdvgr0lDqw/FEZIhluFsSwyvS81CMnRdrNSKwbsmc43LtRd2/WMQV+Z85AQ=="
crossorigin="anonymous" />
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="container">
<h1>CUDA Occupancy Calculator</h1>
<form>
<div class="mb-3">
<label for="ccVersion">Compute Capability version</label>
<select class="form-control" id="ccVersion" name="version" autofocus>
<option value="1.0">1.0</option>
<option value="1.1">1.1</option>
<option value="1.2">1.2</option>
<option value="1.3">1.3</option>
<option value="2.0">2.0</option>
<option value="2.1">2.1</option>
<option value="3.0">3.0</option>
<option value="3.2">3.2</option>
<option value="3.5">3.5</option>
<option value="3.7">3.7</option>
<option value="5.0">5.0</option>
<option value="5.2">5.2</option>
<option value="5.3">5.3</option>
<option value="6.0">6.0</option>
<option value="6.1">6.1</option>
<option value="6.2">6.2</option>
<option value="7.0">7.0</option>
<option value="7.5">7.5</option>
<option value="8.0">8.0</option>
<option value="8.6">8.6</option>
</select>
</div>
<div class="mb-3">
<label for="cudaVersion">CUDA version</label>
<select class="form-control" id="cudaVersion" name="cudaVersion">
<option value="11.0">11.0</option>
<option value="11.1" selected>11.1</option>
</select>
</div>
<div class="mb-3">
<label for="threadsPerBlock">Threads per block</label>
<input type="number" class="form-control" id="threadsPerBlock" name="threadsPerBlock" value="256" min="1">
</div>
<div class="mb-3">
<label for="registersPerThread">Registers per thread</label>
<input type="number" class="form-control" id="registersPerThread" name="registersPerThread" value="32" min="0">
</div>
<label for="sharedMemoryPerBlock">Shared memory per block</label>
<div class="input-group mb-3">
<input type="number" class="form-control" id="sharedMemoryPerBlock" name="sharedMemoryPerBlock" value="2048"
min="0" aria-describedby="sharedMemoryPerBlockUnit">
<span class="input-group-text" id="sharedMemoryPerBlockUnit">bytes</span>
</div>
<div class="mb-3">
<button type="submit" class="btn btn-primary">Calculate</button>
</div>
</form>
<div id="output" hidden>
<table class="table table-striped table-hover">
<caption>GPU Occupancy Data is displayed here and in the graphs</caption>
<tr>
<th>Active Threads per Multiprocessor</th>
<td id="activeThreadsPerMultiprocessor"></td>
</tr>
<tr>
<th>Active Warps per Multiprocessor</th>
<td id="activeWarpsPerMultiprocessor"></td>
</tr>
<tr>
<th>Active Thread Blocks per Multiprocessor</th>
<td id="activeThreadBlocksPerMultiprocessor"></td>
</tr>
<tr>
<th>Occupancy of each Multiprocessor</th>
<td id="occupancyOfMultiprocessor"></td>
</tr>
</table>
<table class="table table-striped table-hover">
<caption>Physical Limits for GPU Compute Capability</caption>
<tr>
<th>Version</th>
<td id="version"></td>
</tr>
<tr>
<th>Threads per Warp</th>
<td id="threadsPerWarp"></td>
</tr>
<tr>
<th>Warps per Multiprocessor</th>
<td id="warpsPerMultiprocessor"></td>
</tr>
<tr>
<th>Threads per Multiprocessor</th>
<td id="threadsPerMultiprocessor"></td>
</tr>
<tr>
<th>Thread Blocks per Multiprocessor</th>
<td id="threadBlocksPerMultiprocessor"></td>
</tr>
<tr>
<th>Total # of 32-bit registers per Multiprocessor</th>
<td id="registerFileSize"></td>
</tr>
<tr>
<th>Register allocation unit size</th>
<td id="registerAllocationUnitSize"></td>
</tr>
<tr>
<th>Register allocation granularity</th>
<td id="allocationGranularity"></td>
</tr>
<tr>
<th>Max registers per Block</th>
<td id="maxRegistersPerBlock"></td>
</tr>
<tr>
<th>Max registers per thread</th>
<td id="maxRegistersPerThread"></td>
</tr>
<tr>
<th>Shared Memory per Multiprocessor (bytes)</th>
<td id="sharedMemoryPerMultiprocessor"></td>
</tr>
<tr>
<th>Shared Memory Allocation unit size</th>
<td id="sharedMemoryAllocationUnitSize"></td>
</tr>
<tr>
<th>Warp allocation granularity (for register allocation)</th>
<td id="warpAllocationGranularity"></td>
</tr>
<tr>
<th>Max thread block size</th>
<td id="maxThreadBlockSize"></td>
</tr>
</table>
<table class="table table-striped table-hover">
<caption>Allocation Per Thread Block</caption>
<tr>
<th>Warps</th>
<td id="blockWarps"></td>
</tr>
<tr>
<th>Registers</th>
<td id="blockRegisters"></td>
</tr>
<tr>
<th>Shared Memory</th>
<td id="blockSharedMemory"></td>
</tr>
</table>
<div id="alertCudaRuntimeSharedMemory" class="alert alert-warning" role="alert">
Note: CUDA Runtime uses <span id=blockCudaRuntimeSharedMemory></span> bytes of Shared Memory per Thread Block.
</div>
<table class="table table-striped table-hover">
<caption>Maximum Thread Blocks Per Multiprocessor</caption>
<tr>
<th>Limited by Max Warps / Blocks per Multiprocessor</th>
<td id="threadBlocksPerMultiprocessorLimitedByWarpsOrBlocksPerMultiprocessor"></td>
</tr>
<tr>
<th>Limited by Registers per Multiprocessor</th>
<td id="threadBlocksPerMultiprocessorLimitedByRegistersPerMultiprocessor"></td>
</tr>
<tr>
<th>Limited by Shared Memory per Multiprocessor</th>
<td id="threadBlocksPerMultiprocessorLimitedBySharedMemoryPerMultiprocessor"></td>
</tr>
</table>
<figure class="figure container-fluid">
<figcaption class="figure-caption">Impact of Varying Block Size</figcaption>
<div id="graphWarpOccupancyOfThreadsPerBlock"></div>
</figure>
<figure class="figure container-fluid">
<figcaption class="figure-caption">Impact of Varying Register Count Per Thread</figcaption>
<div id="graphWarpOccupancyOfRegistersPerThread"></div>
</figure>
<figure class="figure container-fluid">
<figcaption class="figure-caption">Impact of Varying Shared Memory Usage Per Block</figcaption>
<div id="graphWarpOccupancyOfSharedMemoryPerBlock"></div>
</figure>
</div>
</div>
<a href="https://github.com/karthikeyann/cuda-calculator">
<img id="fork-me" src="img/fork_me_right_gray_6d6d6d.png" alt="Fork me on GitHub">
</a>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
crossorigin="anonymous"></script>
<script src="https://d3js.org/d3.v5.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.7.20/c3.min.js"
integrity="sha512-+IpCthlNahOuERYUSnKFjzjdKXIbJ/7Dd6xvUp+7bEw0Jp2dg6tluyxLs+zq9BMzZgrLv8886T4cBSqnKiVgUw=="
crossorigin="anonymous"></script>
<script src="js/calculator.js"></script>
<script src="js/index.js"></script>
</body>
</html>