An issue in OPENCL programming

Source: Internet
Author: User

These days in the OpenCL Programming Guide, found a headache problem, programming sometimes with cl_int sometimes with int, and so on, began to understand that int is the grammatical structure of C, Cl_int is the grammatical structure of OpenCL, write the kernel with Cl_int, write C with Int. However, it is found that C sometimes has cl_int, and the kernel is basically int. Chaos, how can this?

Difficulties can not help but carefully study, originally AH, cl_int is only the OpenCL API data type, int is still the data type of OpenCL, how to understand it? That is, if you want to pass parameters or return values to the OpenCL API, you need to use Cl_int, and the syntax of INT,OPENCL is the same as the syntax of C in other places. Of course cl_int and int also correspond, equivalent to Cl_int is an alias of Int.

hahaha, solved, so understand it.

An issue in OPENCL programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.