Skip to content

Commit 92fe327

Browse files
committed
Add MCQ 5 6 7
1 parent 67f202c commit 92fe327

File tree

3 files changed

+639
-0
lines changed

3 files changed

+639
-0
lines changed
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
2+
= Welcome to MCQ Kokkos
3+
4+
*Quiz on the concept of advanced reduction*
5+
6+
++++
7+
<div id="mcq">
8+
<p>1.What is the default reducer in Kokkos ?</p>
9+
<input type="radio" name="q1" value="a"> Max<br>
10+
<input type="radio" name="q1" value="b"> Min<br>
11+
<input type="radio" name="q1" value="c"> Sum<br>
12+
<input type="radio" name="q1" value="d"> Prod<br>
13+
<button onclick="checkAnswer('c')">Submit</button>
14+
<p id="result"></p>
15+
</div>
16+
17+
<script>
18+
function checkAnswer(rightAnswer) {
19+
let answer = document.querySelector('input[name="q1"]:checked')?.value;
20+
let result = document.getElementById("result");
21+
if (answer === rightAnswer) {
22+
result.innerHTML = "Correct!";
23+
} else {
24+
result.innerHTML = "Wrong answer, try again.";
25+
}
26+
}
27+
</script>
28+
++++
29+
30+
31+
++++
32+
<div id="mcq">
33+
<p>2.What operation does the Kokkos::BAnd reducer perform ?</p>
34+
<input type="radio" name="q1" value="a"> Binary addition<br>
35+
<input type="radio" name="q1" value="b"> Binary AND<br>
36+
<input type="radio" name="q1" value="c"> Binary OR<br>
37+
<input type="radio" name="q1" value="d"> Binary XOR<br>
38+
<button onclick="checkAnswer('b')">Submit</button>
39+
<p id="result"></p>
40+
</div>
41+
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. What reducer allows us to find both the minimum value and its index ?</p>
60+
<input type="radio" name="q1" value="a"> Min<br>
61+
<input type="radio" name="q1" value="b"> MinLoc<br>
62+
<input type="radio" name="q1" value="c"> MinMax<br>
63+
<input type="radio" name="q1" value="d"> MinMaxLoc<br>
64+
<button onclick="checkAnswer('b')">Submit</button>
65+
<p id="result"></p>
66+
</div>
67+
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. How do you specify a custom reducer in a parallel reduction ?</p>
86+
<input type="radio" name="q1" value="a"> As a first argument<br>
87+
<input type="radio" name="q1" value="b"> As a final argument<br>
88+
<input type="radio" name="q1" value="c"> In the body of the lambda<br>
89+
<input type="radio" name="q1" value="d"> In a separate function<br>
90+
<button onclick="checkAnswer('b')">Submit</button>
91+
<p id="result"></p>
92+
</div>
93+
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. What does the Kokkos::MinMaxLoc reducer do ?</p>
114+
<input type="radio" name="q1" value="a"> Find the minimum and maximum<br>
115+
<input type="radio" name="q1" value="b"> Find the minimum and maximum with their indices<br>
116+
<input type="radio" name="q1" value="c"> Find the minimum or maximum, whichever is closer<br>
117+
<input type="radio" name="q1" value="d"> Find the average between the minimum and the maximum<br>
118+
<button onclick="checkAnswer('b')">Submit</button>
119+
<p id="result"></p>
120+
</div>
121+
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. Do Kokkos reducers work on variable length arrays ?</p>
141+
<input type="radio" name="q1" value="a"> Yes, always<br>
142+
<input type="radio" name="q1" value="b"> No, never<br>
143+
<input type="radio" name="q1" value="c"> Only for certain reducersl<br>
144+
<input type="radio" name="q1" value="d"> Only on CPU<br>
145+
<button onclick="checkAnswer('b')">Submit</button>
146+
<p id="result"></p>
147+
</div>
148+
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. What is special about reductions in scalar variables ?</p>
168+
<input type="radio" name="q1" value="a"> They are faster<br>
169+
<input type="radio" name="q1" value="b"> They are guaranteed to be synchronous<br>
170+
<input type="radio" name="q1" value="c"> They only work on CPU<br>
171+
<input type="radio" name="q1" value="d"> They require a special reducer<br>
172+
<button onclick="checkAnswer('b')">Submit</button>
173+
<p id="result"></p>
174+
</div>
175+
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. Is it possible to make multiple discounts simultaneously in Kokkos ?</p>
194+
<input type="radio" name="q1" value="a"> No, nevers<br>
195+
<input type="radio" name="q1" value="b"> Yes, but only two at a time<br>
196+
<input type="radio" name="q1" value="c"> Yes, with identical data types<br>
197+
<input type="radio" name="q1" value="d"> Yes, even with different data types<br>
198+
<button onclick="checkAnswer('d')">Submit</button>
199+
<p id="result"></p>
200+
</div>
201+
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>
213+
++++

0 commit comments

Comments
 (0)