Task 3 – Kernel Execution (10 marks) Write an OpenCL program that uses a kernel (you will have to write the kernel yours

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Task 3 – Kernel Execution (10 marks) Write an OpenCL program that uses a kernel (you will have to write the kernel yours

Post by answerhappygod »

Task 3 Kernel Execution 10 Marks Write An Opencl Program That Uses A Kernel You Will Have To Write The Kernel Yours 1
Task 3 Kernel Execution 10 Marks Write An Opencl Program That Uses A Kernel You Will Have To Write The Kernel Yours 1 (139.51 KiB) Viewed 34 times
Task 3 – Kernel Execution (10 marks) Write an OpenCL program that uses a kernel (you will have to write the kernel yourself) to fill in the contents of an array of 1024 numbers in parallel. The program is to prompt the user to enter a number between 1 and 89 (inclusive). The program is to check whether the user entered a valid number, if not the program will quit. If a valid number was entered, enqueue a kernel (using the enqueueNDRangeKernel function) that accepts the number and an array, and fills in the contents of the array using the number (and the work-items' global IDs) as follows: If the user enters 1, the resulting contents of the array should be: 1, 2, 3, 4, 5,... until 1024 If the user enters 2, the resulting contents of the array should be: 1, 3, 5, 7, 9,... until 2047 If the user enters 3, the resulting contents of the array should be: 1, 4, 7, 10, 13,... until 3070 . . If the user enters 89, the resulting contents of the array should be: 1, 90, 179, 268, 357,... until 91048 After kernel execution, display the resulting contents on screen.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply