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
  • PrintPrint

3.7. Summary

It’s crucial to know how to code and enqueue kernels, but kernels are useless without data to process. The goal of this chapter has been to show how OpenCL packages and partitions data to be processed by devices.

OpenCL provides a memory object (cl_mem) data structure as a standard mechanism for transferring data between a host and a device. The process of transferring memory objects is simple: create a memory object from existing data, and call clSetKernelArg to make the object into a kernel argument. When the kernel executes, the kernel will be able to access its data as a regular function parameter. Then, as the host sends further commands, the device may transfer data to the host or copy the data to another buffer object.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint