When to use the OpenCL API scalar data types?

I am having trouble understanding when using the OpenCL API data types like cl_float, cl_uchar, etc., which can be found here:

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/scalarDataTypes.html

The examples that I saw related to copying a buffer to a device are as follows:

float data[DATA_SIZE];              // original data set given to device

//Create the input and output arrays in device memory for our calculation
input = clCreateBuffer(context,  CL_MEM_READ_ONLY,  sizeof(float) * count, NULL,

// Write our data set into the input array in device memory
err = clEnqueueWriteBuffer(commands, input, CL_TRUE, 0, sizeof(float) * count, data, 0, NULL, NULL);
if (err != CL_SUCCESS)
{
    printf("Error: Failed to write to source array!\n");
    exit(1);
}

This code was taken directly from the Apple code example available here: https://developer.apple.com/library/mac/samplecode/OpenCL_Hello_World_Example/Listings/ReadMe_txt.html

, . cl_floats? , ? , - ?

, cl_float? , opencl?

+4
1

cl_ -prefixed: OpenCL. , float, cl_float ( float cl_float ), cl_ - . ( @DarkZeros), , , int, . cl_int , .

, , OpenCL C C99 ( , "supersubset":-). , , , OpenCL C (size_t, , cl_size_t).

, , , , float , . float cl_float, .

+4

All Articles