Results 1 to 2 of 2

Thread: __kernel definitions

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    1

    __kernel definitions

    Hi all,

    I'm trying to use a C++ source-to-source translator to optimize my OpenCL code with respect to the inputs and other parameters such as grid and work sizes. I have been successful in doing this for the host cpp file. However, currently I cannot optimize the kernel (.cl) file. Particularly I'm interested in studying the sensitivity of loop unrolling in the kernel routines. I can perhaps attempt to do it - but I would have to let my C++ source-to-source translator know where the keywords __kernel or __global etc. are defined. Does anyone know where these are defined?

    Since the kernel functions are not C++ constructs, I guess I cannot accomplish this. Could someone confirm that this cannot be done or suggest an alternative?

    Thanks,
    Poornima

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: __kernel definitions

    I would have to let my C++ source-to-source translator know where the keywords __kernel or __global etc. are defined. Does anyone know where these are defined?
    Some implementations in fact #define these in a file somewhere. However, a proper implementation of OpenCL will not #define them anywhere: they will be deeply embedded into the lexical analyzer.

    Your best bet is probably creating a header file of your own with a bunch of macros for these keywords and builtin functions.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. static int inside a __kernel
    By FredericX in forum OpenCL
    Replies: 5
    Last Post: 09-14-2010, 10:51 AM
  2. how to use math.h functions in __kernel
    By sayush in forum OpenCL
    Replies: 2
    Last Post: 12-02-2009, 05:05 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
  •