Given the content of dataA and dataB: DataA: 1 4 9 8 2 5 11 5 7 1 2 2 1871975 DataB: 7 0 4 8 4 5 7 1 2 6 4 3 2 656 8294 And the following kernel: kernel void kernelA(_global int* dataA, global int2* dataB, global int4* dataC) { } For the work-item with global ID=2, what will the content of the following be? V • v1 • v2 int gid= get_global_id(0); int4 v vload4 (gid, dataA + 3); int4 v1 = (int4) (dataB[gid + 1], dataB[gid]); int4 v2 (int4) (v.s22, v1.s30); int4 m v1 > V; dataC[gid] select (v1, v2, m); .m • dataC[gid] Given the following information: Kernel name: importantKernel. The kernel accepts a single integer, an input array of char4s and an output array of int8s. There should be 1024 work-items. There should be 4 work-groups. Global IDs are to start from 13. 7/8 Provide OpenCL code for the following: The signature of the kernel. Setting up buffers and kernel arguments. Setting up and enqueueing the kernel. You are free to choose the variable names. The content of arguments passed to the kernel is not important.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
Given the content of dataA and dataB:
DataA: 1 4 9 8 2 5 11 5 7 1 2 2 1 8 7 1975
DataB: 7 0 4 8 4 5 7 1 2 6 4 3 2 656 8294
And the following kernel:
kernel void kernelA(_global int* dataA,
___global int2* datab,
global int4* dataC)
{
int gid= get_global_id(0);
int4 v = vload4 (gid, dataA + 3);
int4 v1 = (int4) (dataB[gid + 1], dataB[gid]);
int4 v2 = (int4) (v.s22, v1.s30);
int4 m v1 > V;
datac [gid] select(v1, v2, m);
}
For the work-item with global ID = 2, what will the content of the following be?
. V
• v1
• v2
. m
• dataC[gid]
Given the following information:
• Kernel name: importantKernel.
• The kernel accepts a single integer, an input array of char4s and an output array of int8s.
There should be 1024 work-items.
• There should be 4 work-groups.
• Global IDs are to start from 13.
7/8
Provide OpenCL code for the following:
• The signature of the kernel.
Setting up buffers and kernel arguments.
• Setting up and enqueueing the kernel.
You are free to choose the variable names. The content of arguments passed to the kernel is not important.
Transcribed Image Text:Given the content of dataA and dataB: DataA: 1 4 9 8 2 5 11 5 7 1 2 2 1 8 7 1975 DataB: 7 0 4 8 4 5 7 1 2 6 4 3 2 656 8294 And the following kernel: kernel void kernelA(_global int* dataA, ___global int2* datab, global int4* dataC) { int gid= get_global_id(0); int4 v = vload4 (gid, dataA + 3); int4 v1 = (int4) (dataB[gid + 1], dataB[gid]); int4 v2 = (int4) (v.s22, v1.s30); int4 m v1 > V; datac [gid] select(v1, v2, m); } For the work-item with global ID = 2, what will the content of the following be? . V • v1 • v2 . m • dataC[gid] Given the following information: • Kernel name: importantKernel. • The kernel accepts a single integer, an input array of char4s and an output array of int8s. There should be 1024 work-items. • There should be 4 work-groups. • Global IDs are to start from 13. 7/8 Provide OpenCL code for the following: • The signature of the kernel. Setting up buffers and kernel arguments. • Setting up and enqueueing the kernel. You are free to choose the variable names. The content of arguments passed to the kernel is not important.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of Threads
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
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