Results 1 to 2 of 2

Thread: Using preprocessor and extern functions in OpenCL kernels

  1. #1

    Using preprocessor and extern functions in OpenCL kernels

    Is it possible for C preprocessor directives to be used in an OpenCL kernel? I want to use macros in my kernel. For example, a simple indexing macro to simulate matrix access in an array:

    Code :
    #define ROWCOLSIZE   10 
    #define D2(x,y)   ((x)*ROWCOLSIZE + (y))

    It says they are supported but I can't seem to get them to work unless they are defined directly IN the kernel source. But this is not efficient, particularly if I have hundreds of directives.

    Do you need a build argument? Otherwise can you use external functions in your kernel?

  2. #2

    Re: Using preprocessor and extern functions in OpenCL kernel

    Ahhhh they have to be in the program source. Sorry I am braindead. Got it...

Similar Threads

  1. OpenCL functions
    By MrSir in forum OpenCL
    Replies: 1
    Last Post: 01-25-2012, 05:07 PM
  2. Replies: 3
    Last Post: 10-08-2011, 12:43 PM

Posting Permissions

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