[SOLVED] CSCI376-Assignment 1 OpenCL Basics

40.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon OpenCL-Basics-3qddws.zip (442 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
šŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Write an OpenCL program that does the following:

  • Allow the user to enter whether he/she wants to use a CPU or a GPU device. Based on the user’s selection, search the system for all CPU or GPU devices. (Note that some systems have multiple CPUs and GPUs).
    • mark)
  • Based on the user’s choice, display the following information for each CPU/GPU device that is available on the system: o Name of the platform(s) that support that device
    • Device type – CPU or GPU

(hint: CL_DEVICE_TYPE_CPU or CL_DEVICE_TYPE_GPU) o Device name

  • Number of compute units

(hint: CL_DEVICE_MAX_COMPUTE_UNITS) o Maximum work group size

(hint: CL_DEVICE_MAX_WORK_GROUP_SIZE) o Maximum work item sizes

(hint: CL_DEVICE_MAX_WORK_ITEM_SIZES) o Global memory size

(hint: CL_DEVICE_GLOBAL_MEM_SIZE)

 

  • Based on the devices available, allow the user to select one device. Check whether the device supports the cl_khr_icd extension (hint: CL_DEVICE_EXTENSIONS). Create a context and a command queue for that device.

 

 

  • Read the program source code from the provided ā€œsource.clā€ file and build the program. Display whether or not the program built successfully and display the program build log (display the build log even if the program built successfully. Note: for some compilers, the build log will be empty if successful).

 

  • Find and display the number of kernels in the program. Create kernels from the program and display all the kernel function names.

1 file Ā· 442.0 KB

  • OpenCL-Basics-3qddws.zip 442.0 KB