Results 1 to 4 of 4

Thread: how to create and init gpu memory buff to be all 0s

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    2

    how to create and init gpu memory buff to be all 0s

    Hi all, to create a GPU buffer and init it to be all 0s, what I am doing right now is:
    clCreateBuffer
    then
    clEnqueueWriteBuffer()
    copy an array of 0s to the buff

    I am wondering if there is anyway to create a GPU buffer and init it to be all 0s without calling clEnqueueWriteBuffer() ?

    Thanks!

  2. #2

    Re: how to create and init gpu memory buff to be all 0s

    Just write a simple kernel that sets the zeros.

  3. #3
    Senior Member
    Join Date
    Sep 2002
    Location
    Santa Clara
    Posts
    105

    Re: how to create and init gpu memory buff to be all 0s

    You can also use clEnqueueFillBuffer to fill the buffer with a pattern which in your case will be 0s.

  4. #4

    Re: how to create and init gpu memory buff to be all 0s

    AFAICT, this is OpenCL 1.2 only, right? I'm praying for the day NVIDIA will release an SDK with OpenCL 1.2 support.

Similar Threads

  1. why componet init function allocates memory for all
    By maheshatmm in forum OpenMAX IL
    Replies: 0
    Last Post: 09-28-2007, 02:04 AM
  2. Replies: 0
    Last Post: 01-01-1970, 12:00 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
  •