Results 1 to 4 of 4

Thread: kernel arguments restrction

Hybrid View

  1. #1

    kernel arguments restrction

    Hi forum,

    In the manual it is mentioned that

    "Arguments to __kernel functions in a program cannot be declared with the built-in scalar types bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t". I need the pitch value to be passed to the kernel of type size_t.

    Is there any other way to get around this issue?

    Thanks

  2. #2
    I usually just use the cl_ulong type in kernel code to represent a size_t.

    Make sure you cast the value to cl_ulong before passing it to the kernel in the off-chance that size_t is greater than 64-bits.

  3. #3
    Thanks for the hint.

    I am replacing every instant of the size_t with ulong and using ulong type in the kernel argument as well. But i am getting a new error as follows:

    Code :
    Error in setting kernel arguments for the pitch value: CL_INVALID_ARG_SIZE

    I am setting the kernel argument as follows:

    Code :
     errNum = clSetKernelArg(updateVelocityKernel,7,sizeof(ulong),(void*)&tPitch);

    Any hint where to look into to debug this issue?


    Thanks

  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    115
    CL_INVALID_ARG_SIZE indicates that the size declared with clSetKernelArg() (i.e. sizeof(cl_ulong)) does not match the size of the corresponding argument in the declaration of your kernel.

Posting Permissions

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