Results 1 to 2 of 2

Thread: What should arg_size be when passing NULL to clSetKernelArg?

  1. #1

    What should arg_size be when passing NULL to clSetKernelArg?

    The standard allows NULL to be passed as the arg_value parameter to clSetKernelArg when you want a global pointer argument of a kernel to be NULL. However, it doesn't specify what value should be passed as arg_size, does it matter? Should it be 0 or sizeof(void *) or sizeof(cl_mem)? They all seem like reasonable things to pass.

    Thanks,
    Brian

  2. #2

    Re: What should arg_size be when passing NULL to clSetKernelArg?

    I would guess sizeof(cl_mem), as this is the value passed for all other, i.e. non-NULL, global pointers. See no reason to change it.

Similar Threads

  1. Replies: 3
    Last Post: 01-22-2012, 06:29 PM
  2. Passing NULL pointer to the kernel ?
    By viewon01 in forum OpenCL
    Replies: 2
    Last Post: 07-26-2010, 06:21 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
  •