Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

5.5. Integer functions

Many fields, such as cryptography and bioinformatics, model data using integers. OpenCL provides a wide range of integer operations, and this section divides them into three categories: addition and subtraction, multiplication, and miscellaneous. In each case, the integer data type refers to all signed and unsigned integers: uchar, char, ushort, short, uint, int, ulong, and long. The uinteger type refers to only unsigned integers: uchar, ushort, uint, and ulong.

5.5.1. Adding and subtracting integers

OpenCL provides the + and - operators for addition and subtraction, but these may not be sufficient for all cases. Table 5.10 lists the OpenCL functions that add and subtract integers.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial