|
1 | 1 |
|
2 | | -= Welcome to MCQ Kokkos |
| 2 | += Welcome to MCQ Kokkos |
3 | 3 |
|
4 | 4 | *General question about Kokkos* |
5 | 5 |
|
6 | 6 | ++++ |
7 | | -<div id="mcq"> |
8 | | - <p>1. What is Kokkos ?</p> |
9 | | - <input type="radio" name="q1" value="a"> A programming language<br> |
10 | | - <input type="radio" name="q1" value="b"> A C++ programming model for performance portability<br> |
11 | | - <input type="radio" name="q1" value="c"> An operating system<br> |
12 | | - <input type="radio" name="q1" value="d"> A compiler<br> |
13 | | - <button onclick="checkAnswer('b')">Submit</button> |
14 | | - <p id="result"></p> |
15 | | -</div> |
16 | | -
|
17 | 7 | <script> |
18 | | -function checkAnswer(rightAnswer) { |
19 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
20 | | - let result = document.getElementById("result"); |
| 8 | +function checkAnswer(questionName, rightAnswer, resultId) { |
| 9 | + let answer = document.querySelector(`input[name="${questionName}"]:checked`)?.value; |
| 10 | + let result = document.getElementById(resultId); |
21 | 11 | if (answer === rightAnswer) { |
22 | 12 | result.innerHTML = "Correct!"; |
23 | 13 | } else { |
24 | 14 | result.innerHTML = "Wrong answer, try again."; |
25 | 15 | } |
26 | 16 | } |
27 | 17 | </script> |
28 | | -++++ |
29 | 18 |
|
30 | | - |
31 | | -++++ |
32 | | -<div id="mcq"> |
33 | | - <p>2. What is the main objective of Kokkos ?</p> |
34 | | - <input type="radio" name="q1" value="a"> Optimize performance on a single type of hardware<br> |
35 | | - <input type="radio" name="q1" value="b"> Replace CUDA and OpenMP<br> |
36 | | - <input type="radio" name="q1" value="c"> Ensure performance portability across different HPC architectures<br> |
37 | | - <input type="radio" name="q1" value="d"> A compiler<br> |
38 | | - <button onclick="checkAnswer('c')">Submit</button> |
39 | | - <p id="result"></p> |
| 19 | +<div id="question1"> |
| 20 | + <p>1. What is Kokkos ?</p> |
| 21 | + <input type="radio" name="q1" value="a"> A programming language<br> |
| 22 | + <input type="radio" name="q1" value="b"> A C++ programming model for performance portability<br> |
| 23 | + <input type="radio" name="q1" value="c"> An operating system<br> |
| 24 | + <input type="radio" name="q1" value="d"> A compiler<br> |
| 25 | + <button onclick="checkAnswer('q1', 'b', 'result1')">Submit</button> |
| 26 | + <p id="result1"></p> |
40 | 27 | </div> |
41 | 28 |
|
42 | | -<script> |
43 | | -function checkAnswer(rightAnswer) { |
44 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
45 | | - let result = document.getElementById("result"); |
46 | | - if (answer === rightAnswer) { |
47 | | - result.innerHTML = "Correct!"; |
48 | | - } else { |
49 | | - result.innerHTML = "Wrong answer, try again."; |
50 | | - } |
51 | | -} |
52 | | -</script> |
53 | | -++++ |
54 | | - |
55 | | - |
56 | | - |
57 | | -++++ |
58 | | -<div id="mcq"> |
59 | | - <p>3. Which backends does Kokkos support ?</p> |
60 | | - <input type="radio" name="q1" value="a"> CUDA only<br> |
61 | | - <input type="radio" name="q1" value="b"> OpenMP only<br> |
62 | | - <input type="radio" name="q1" value="c"> CUDA, OpenMP, and HPX<br> |
63 | | - <input type="radio" name="q1" value="d"> Only CPUs<br> |
64 | | - <button onclick="checkAnswer('c')">Submit</button> |
65 | | - <p id="result"></p> |
| 29 | +<div id="question2"> |
| 30 | + <p>2. What is the main objective of Kokkos ?</p> |
| 31 | + <input type="radio" name="q2" value="a"> Optimize performance on a single type of hardware<br> |
| 32 | + <input type="radio" name="q2" value="b"> Replace CUDA and OpenMP<br> |
| 33 | + <input type="radio" name="q2" value="c"> Ensure performance portability across different HPC architectures<br> |
| 34 | + <input type="radio" name="q2" value="d"> A compiler<br> |
| 35 | + <button onclick="checkAnswer('q2', 'c', 'result2')">Submit</button> |
| 36 | + <p id="result2"></p> |
66 | 37 | </div> |
67 | 38 |
|
68 | | -<script> |
69 | | -function checkAnswer(rightAnswer) { |
70 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
71 | | - let result = document.getElementById("result"); |
72 | | - if (answer === rightAnswer) { |
73 | | - result.innerHTML = "Correct!"; |
74 | | - } else { |
75 | | - result.innerHTML = "Wrong answer, try again."; |
76 | | - } |
77 | | -} |
78 | | -</script> |
79 | | -++++ |
80 | | - |
81 | | - |
82 | | - |
83 | | -++++ |
84 | | -<div id="mcq"> |
85 | | - <p>4. What does a “View” represent in Kokkos ?</p> |
86 | | - <input type="radio" name="q1" value="a"> A graphics window<br> |
87 | | - <input type="radio" name="q1" value="b"> A simple pointer<br> |
88 | | - <input type="radio" name="q1" value="c"> A multidimensional array with memory management<br> |
89 | | - <input type="radio" name="q1" value="d"> A tree data structure<br> |
90 | | - <button onclick="checkAnswer('c')">Submit</button> |
91 | | - <p id="result"></p> |
| 39 | +<div id="question3"> |
| 40 | + <p>3. Which backends does Kokkos support ?</p> |
| 41 | + <input type="radio" name="q3" value="a"> CUDA only<br> |
| 42 | + <input type="radio" name="q3" value="b"> OpenMP only<br> |
| 43 | + <input type="radio" name="q3" value="c"> CUDA, OpenMP, and HPX<br> |
| 44 | + <input type="radio" name="q3" value="d"> Only CPUs<br> |
| 45 | + <button onclick="checkAnswer('q3', 'c', 'result3')">Submit</button> |
| 46 | + <p id="result3"></p> |
92 | 47 | </div> |
93 | 48 |
|
94 | | -<script> |
95 | | -function checkAnswer(rightAnswer) { |
96 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
97 | | - let result = document.getElementById("result"); |
98 | | - if (answer === rightAnswer) { |
99 | | - result.innerHTML = "Correct!"; |
100 | | - } else { |
101 | | - result.innerHTML = "Wrong answer, try again."; |
102 | | - } |
103 | | -} |
104 | | -</script> |
105 | | -++++ |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | -++++ |
112 | | -<div id="mcq"> |
113 | | - <p>5. How does Kokkos manage memory for Views ?</p> |
114 | | - <input type="radio" name="q1" value="a"> Manually by the programmer<br> |
115 | | - <input type="radio" name="q1" value="b"> Automatically with a reference counter<br> |
116 | | - <input type="radio" name="q1" value="c"> Only on CPU<br> |
117 | | - <input type="radio" name="q1" value="d"> Without any memory management<br> |
118 | | - <button onclick="checkAnswer('b')">Submit</button> |
119 | | - <p id="result"></p> |
| 49 | +<div id="question4"> |
| 50 | + <p>4. What does a “View” represent in Kokkos ?</p> |
| 51 | + <input type="radio" name="q4" value="a"> A graphics window<br> |
| 52 | + <input type="radio" name="q4" value="b"> A simple pointer<br> |
| 53 | + <input type="radio" name="q4" value="c"> A multidimensional array with memory management<br> |
| 54 | + <input type="radio" name="q4" value="d"> A tree data structure<br> |
| 55 | + <button onclick="checkAnswer('q4', 'c', 'result4')">Submit</button> |
| 56 | + <p id="result4"></p> |
120 | 57 | </div> |
121 | 58 |
|
122 | | -<script> |
123 | | -function checkAnswer(rightAnswer) { |
124 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
125 | | - let result = document.getElementById("result"); |
126 | | - if (answer === rightAnswer) { |
127 | | - result.innerHTML = "Correct!"; |
128 | | - } else { |
129 | | - result.innerHTML = "Wrong answer, try again."; |
130 | | - } |
131 | | -} |
132 | | -</script> |
133 | | -++++ |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | -++++ |
139 | | -<div id="mcq"> |
140 | | - <p>6. What is special about the dimensions of a View Kokkos ?</p> |
141 | | - <input type="radio" name="q1" value="a"> They are always dynamic<br> |
142 | | - <input type="radio" name="q1" value="b"> They are always static<br> |
143 | | - <input type="radio" name="q1" value="c"> They can be defined at compile time or at run time<br> |
144 | | - <input type="radio" name="q1" value="d"> They are limited to 3 dimensions maximum<br> |
145 | | - <button onclick="checkAnswer('c')">Submit</button> |
146 | | - <p id="result"></p> |
| 59 | +<div id="question5"> |
| 60 | + <p>5. How does Kokkos manage memory for Views ?</p> |
| 61 | + <input type="radio" name="q5" value="a"> Manually by the programmer<br> |
| 62 | + <input type="radio" name="q5" value="b"> Automatically with a reference counter<br> |
| 63 | + <input type="radio" name="q5" value="c"> Only on CPU<br> |
| 64 | + <input type="radio" name="q5" value="d"> Without any memory management<br> |
| 65 | + <button onclick="checkAnswer('q5', 'b', 'result5')">Submit</button> |
| 66 | + <p id="result5"></p> |
147 | 67 | </div> |
148 | 68 |
|
149 | | -<script> |
150 | | -function checkAnswer(rightAnswer) { |
151 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
152 | | - let result = document.getElementById("result"); |
153 | | - if (answer === rightAnswer) { |
154 | | - result.innerHTML = "Correct!"; |
155 | | - } else { |
156 | | - result.innerHTML = "Wrong answer, try again."; |
157 | | - } |
158 | | -} |
159 | | -</script> |
160 | | -++++ |
161 | | - |
162 | | - |
163 | | - |
164 | | - |
165 | | -++++ |
166 | | -<div id="mcq"> |
167 | | - <p>7. How is a Kokkos View copied ?</p> |
168 | | - <input type="radio" name="q1" value="a"> Default deep copy<br> |
169 | | - <input type="radio" name="q1" value="b"> Shallow copy by default<br> |
170 | | - <input type="radio" name="q1" value="c"> Unable to copy a View<br> |
171 | | - <input type="radio" name="q1" value="d"> Copy only to the same type of memory<br> |
172 | | - <button onclick="checkAnswer('b')">Submit</button> |
173 | | - <p id="result"></p> |
| 69 | +<div id="question6"> |
| 70 | + <p>6. What is special about the dimensions of a View Kokkos ?</p> |
| 71 | + <input type="radio" name="q6" value="a"> They are always dynamic<br> |
| 72 | + <input type="radio" name="q6" value="b"> They are always static<br> |
| 73 | + <input type="radio" name="q6" value="c"> They can be defined at compile time or at run time<br> |
| 74 | + <input type="radio" name="q6" value="d"> They are limited to 3 dimensions maximum<br> |
| 75 | + <button onclick="checkAnswer('q6', 'c', 'result6')">Submit</button> |
| 76 | + <p id="result6"></p> |
174 | 77 | </div> |
175 | 78 |
|
176 | | -<script> |
177 | | -function checkAnswer(rightAnswer) { |
178 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
179 | | - let result = document.getElementById("result"); |
180 | | - if (answer === rightAnswer) { |
181 | | - result.innerHTML = "Correct!"; |
182 | | - } else { |
183 | | - result.innerHTML = "Wrong answer, try again."; |
184 | | - } |
185 | | -} |
186 | | -</script> |
187 | | -++++ |
188 | | - |
189 | | - |
190 | | - |
191 | | -++++ |
192 | | -<div id="mcq"> |
193 | | - <p>8. What tool does Kokkos provide for profiling and debugging ?</p> |
194 | | - <input type="radio" name="q1" value="a"> KokkosDebug<br> |
195 | | - <input type="radio" name="q1" value="b"> KokkosProfile<br> |
196 | | - <input type="radio" name="q1" value="c"> KokkosP<br> |
197 | | - <input type="radio" name="q1" value="d"> KokkosAnalyzer<br> |
198 | | - <button onclick="checkAnswer('c')">Submit</button> |
199 | | - <p id="result"></p> |
| 79 | +<div id="question7"> |
| 80 | + <p>7. How is a Kokkos View copied ?</p> |
| 81 | + <input type="radio" name="q7" value="a"> Default deep copy<br> |
| 82 | + <input type="radio" name="q7" value="b"> Shallow copy by default<br> |
| 83 | + <input type="radio" name="q7" value="c"> Unable to copy a View<br> |
| 84 | + <input type="radio" name="q7" value="d"> Copy only to the same type of memory<br> |
| 85 | + <button onclick="checkAnswer('q7', 'b', 'result7')">Submit</button> |
| 86 | + <p id="result7"></p> |
200 | 87 | </div> |
201 | 88 |
|
202 | | -<script> |
203 | | -function checkAnswer(rightAnswer) { |
204 | | - let answer = document.querySelector('input[name="q1"]:checked')?.value; |
205 | | - let result = document.getElementById("result"); |
206 | | - if (answer === rightAnswer) { |
207 | | - result.innerHTML = "Correct!"; |
208 | | - } else { |
209 | | - result.innerHTML = "Wrong answer, try again."; |
210 | | - } |
211 | | -} |
212 | | -</script> |
| 89 | +<div id="question8"> |
| 90 | + <p>8. What tool does Kokkos provide for profiling and debugging ?</p> |
| 91 | + <input type="radio" name="q8" value="a"> KokkosDebug<br> |
| 92 | + <input type="radio" name="q8" value="b"> KokkosProfile<br> |
| 93 | + <input type="radio" name="q8" value="c"> KokkosP<br> |
| 94 | + <input type="radio" name="q8" value="d"> KokkosAnalyzer<br> |
| 95 | + <button onclick="checkAnswer('q8', 'c', 'result8')">Submit</button> |
| 96 | + <p id="result8"></p> |
| 97 | +</div> |
213 | 98 | ++++ |
0 commit comments