Page 1 of 1

Write a program that uses OpenCL to do the following: Allow the user to enter whether they want to use a CPU or GPU devi

Posted: Wed Apr 27, 2022 3:47 pm
by answerhappygod
Write A Program That Uses Opencl To Do The Following Allow The User To Enter Whether They Want To Use A Cpu Or Gpu Devi 1
Write A Program That Uses Opencl To Do The Following Allow The User To Enter Whether They Want To Use A Cpu Or Gpu Devi 1 (109.11 KiB) Viewed 34 times
Write a program that uses OpenCL to do the following: Allow the user to enter whether they want to use a CPU or 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). (1 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 that supports that device o Device type - CPU or GPU (CL_DEVICE_TYPE - either CL_DEVICE_TYPE_CPU or CL DEVICE_TYPE_GPU) O Device name (CL_DEVICE_NAME) o Number of compute units (CL_DEVICE_MAX_COMPUTE_UNITS) o Maximum work group size (CL_DEVICE_MAX_WORK_GROUP_SIZE) o Maximum number of work item dimensions (CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS) o Maximum work item sizes (CL_DEVICE_MAX_WORK_ITEM_SIZES) o Global memory size (CL_DEVICE_GLOBAL_MEM_SIZE) o Local memory size (CL_DEVICE_LOCAL_MEM_SIZE) (2 marks) • Based on the devices available, allow the user to select one device. Create a context using that device, and a command queue. (1 mark)