|
| 1 | + |
| 2 | += Welcome to MCQ Kokkos |
| 3 | + |
| 4 | +*Quiz on the concept of View* |
| 5 | + |
| 6 | +++++ |
| 7 | +<div id="mcq"> |
| 8 | + <p>1. What is a View Kokkos ?</p> |
| 9 | + <input type="radio" name="q1" value="a"> A simple pointer<br> |
| 10 | + <input type="radio" name="q1" value="b"> A multidimensional array with memory management<br> |
| 11 | + <input type="radio" name="q1" value="c"> A tree data structure<br> |
| 12 | + <input type="radio" name="q1" value="d"> A graphics window<br> |
| 13 | + <button onclick="checkAnswer('b')">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.How does Kokkos manage memory for Views ?</p> |
| 34 | + <input type="radio" name="q1" value="a"> Manually by the programmer<br> |
| 35 | + <input type="radio" name="q1" value="b"> Automatically with a reference counter<br> |
| 36 | + <input type="radio" name="q1" value="c"> Only on CPU<br> |
| 37 | + <input type="radio" name="q1" value="d"> Without any memory management<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 is special about the dimensions of a View Kokkos ?</p> |
| 60 | + <input type="radio" name="q1" value="a"> They are always dynamic<br> |
| 61 | + <input type="radio" name="q1" value="b"> They are always static<br> |
| 62 | + <input type="radio" name="q1" value="c"> They can be defined at compile time or at run time<br> |
| 63 | + <input type="radio" name="q1" value="d"> They are limited to 3 dimensions maximum<br> |
| 64 | + <button onclick="checkAnswer('c')">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 is a Kokkos View copied ?</p> |
| 86 | + <input type="radio" name="q1" value="a"> Default deep copy<br> |
| 87 | + <input type="radio" name="q1" value="b"> Shallow copy by default<br> |
| 88 | + <input type="radio" name="q1" value="c"> Unable to copy a View<br> |
| 89 | + <input type="radio" name="q1" value="d"> Copy only to the same type of memory<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 is the maximum number of dimensions for a Kokkos View ?</p> |
| 114 | + <input type="radio" name="q1" value="a"> 3<br> |
| 115 | + <input type="radio" name="q1" value="b"> 5<br> |
| 116 | + <input type="radio" name="q1" value="c"> 8<br> |
| 117 | + <input type="radio" name="q1" value="d"> Unlimited<br> |
| 118 | + <button onclick="checkAnswer('c')">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. What does the Layout parameter represent in a Kokkos View ?</p> |
| 141 | + <input type="radio" name="q1" value="a"> The size of the View<br> |
| 142 | + <input type="radio" name="q1" value="b"> The organization of data in memory<br> |
| 143 | + <input type="radio" name="q1" value="c"> The type of data stored<br> |
| 144 | + <input type="radio" name="q1" value="d"> The execution space<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 the default layout on CUDA GPU ?</p> |
| 168 | + <input type="radio" name="q1" value="a"> LayoutRight<br> |
| 169 | + <input type="radio" name="q1" value="b"> LayoutLeft<br> |
| 170 | + <input type="radio" name="q1" value="c"> LayoutRandom<br> |
| 171 | + <input type="radio" name="q1" value="d"> No default layout<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. How do you access the elements of a Kokkos View ?</p> |
| 194 | + <input type="radio" name="q1" value="a"> With brackets [ ]<br> |
| 195 | + <input type="radio" name="q1" value="b"> With parentheses ( )<br> |
| 196 | + <input type="radio" name="q1" value="c"> With the .at() method<br> |
| 197 | + <input type="radio" name="q1" value="d"> With the .get() method<br> |
| 198 | + <button onclick="checkAnswer('b')">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