Results 1 to 4 of 4

Thread: kernel argument without memory space specifier

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Location
    Slovakia
    Posts
    3

    kernel argument without memory space specifier

    Hello,

    I'd like to ask, where a kernel argument is stored, when it doesn't have _global, _public or other memory specifier?

    Here is a sample code from one presentation:

    Code :
    char* source = "__kernel void MyKernel(__global int* buffer, int N) {\n"
                   "    if (get_global_id(0) < N) buffer[get_global_id(0)] = 7;\n
                   "}\n ";

    Parameter N does not have memory space specifier. Where is it stored?

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: kernel argument without memory space specifier

    I believe the default is private.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Location
    Slovakia
    Posts
    3

    Re: kernel argument without memory space specifier

    That makes sense...

    but how does GPU handle private memory objects? Are they copied to GPU with every thread instance, resulting in extensive brandwidth usage? (f.e. in this case, provided we have a large matrix) Would't it be better to tag N as "_constant"?

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: kernel argument without memory space specifier

    I don't think that is defined in the spec. I would play it safe and define such things as constants to avoid the ambiguity.

Similar Threads

  1. Setting the kernel argument for the local memory
    By shahsaurabh1990 in forum OpenCL
    Replies: 1
    Last Post: 02-01-2013, 12:35 AM
  2. Replies: 7
    Last Post: 03-09-2010, 11:34 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
  •