Results 1 to 3 of 3

Thread: clEnqueueWriteBuffer question

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    9

    clEnqueueWriteBuffer question

    Regarding the aforementioned clEnqueueWriteBuffer, I have noticed that it can take a pointer to a host memory region with the most current bits. This eludes to the fact that the memory object is updated with current pointer information when clEnqueueWriteBuffer is called. Does this mean that as long as a cl_mem object is declared that I can forgo assigning a memory object until this call is made?
    What I mean by this is, can I have an empty cl_mem object, yet declare the pointer to memory upon the clEnqueueWriteBuffer, or to replace the contents of that object upon the call?
    Thanks,
    ~Chris

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    7

    Re: clEnqueueWriteBuffer question

    You can create a buffer using clCreateBuffer and not specify a host pointer from which you would like to copy data. Later on, you may issue the EnqueueWriteBuffer to write the actual databits to the buffer. You could accomplish that with single command: clCreateBuffer and use "CL_MEM_COPY_HOST_PTR" flag during creation. Does that help at all?

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    9

    Re: clEnqueueWriteBuffer question

    Actually, that exactly answered my question.
    Thanks!

Similar Threads

  1. Replies: 3
    Last Post: 04-05-2013, 02:17 AM
  2. clEnqueueWriteBuffer crash with error -38
    By perlish in forum OpenCL
    Replies: 4
    Last Post: 08-30-2012, 04:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •