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.
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.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7RQ
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
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.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L