Given the following snippet of kernel code: int i = 0; while(any(x>2)) { } x>>=1; If x is of type int4 and originally contained (1, 3, 5, 7), what will the final value of i be? Select one: a. 0 b. 3 C. 4 d. 2 e. 1 Clear my choice

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.3: Data Types
Problem 9E: (Practice) Although the total number of bytes varies from computer to computer, memory sizes of...
icon
Related questions
Question
Given the following snippet of kernel code:
int i = 0;
while(any (x>2))
{
}
X>>=1;
i++;
If x is of type int4 and originally contained (1, 3, 5, 7), what will the final value of i be?
Select one:
a. 0
b. 3
c. 4
d. 2
e. 1
Clear my choice
Which of the following statements related to OpenCL image processing is/are TRUE?
1. Image objects can be accessed the same way as buffer objects
2. An image object can only have read or write access
3. Sampler objects can be initialised in the host and passed as a kernel argument
Select one:
a. 1 only
b. 1 and 3
c. 2 only
d. 2 and 3
e. 1 and 2
Clear my choice
Given the following kernel:
}
_kernel void s(_global uchar4* arr)
{
uchar8 mask = (uchar8) (2, 3, 5, 5, 7, 1, 6, 4);
uchar8 vec = shuffle2(arr[1], arr[0], mask);
If arr contains ('b', 'z', 'w', 'e', 'i', 'k', 'n', 't'), what will the contents of vec be?
Select one:
a. None of the choices are correct
b. ('w', 'e', 'k', 'k', 'i', 'k', 'n'; 't')
c. ('n'; 't', 'z', 'z', 'e', 'k', 'w', 'b')
d. ('z; 'w, , , 'n', 'b', 'k', 'e')
e. ('w', 'e', 'k', 'k 't', 'z; 'n'; 'i')
Clear my choice
Transcribed Image Text:Given the following snippet of kernel code: int i = 0; while(any (x>2)) { } X>>=1; i++; If x is of type int4 and originally contained (1, 3, 5, 7), what will the final value of i be? Select one: a. 0 b. 3 c. 4 d. 2 e. 1 Clear my choice Which of the following statements related to OpenCL image processing is/are TRUE? 1. Image objects can be accessed the same way as buffer objects 2. An image object can only have read or write access 3. Sampler objects can be initialised in the host and passed as a kernel argument Select one: a. 1 only b. 1 and 3 c. 2 only d. 2 and 3 e. 1 and 2 Clear my choice Given the following kernel: } _kernel void s(_global uchar4* arr) { uchar8 mask = (uchar8) (2, 3, 5, 5, 7, 1, 6, 4); uchar8 vec = shuffle2(arr[1], arr[0], mask); If arr contains ('b', 'z', 'w', 'e', 'i', 'k', 'n', 't'), what will the contents of vec be? Select one: a. None of the choices are correct b. ('w', 'e', 'k', 'k', 'i', 'k', 'n'; 't') c. ('n'; 't', 'z', 'z', 'e', 'k', 'w', 'b') d. ('z; 'w, , , 'n', 'b', 'k', 'e') e. ('w', 'e', 'k', 'k 't', 'z; 'n'; 'i') Clear my choice
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L