Results 1 to 5 of 5

Thread: Include a header into kernel

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    5

    Include a header into kernel

    I want to use functions from <wincrypt.h> header in my kernel so I should include it to my kernel.
    From the openCL documentation I found out that I should use clBuildProgram with -I option to specify include directory so I'm trying to use it:
    ret = clBuildProgram(program, 1, &device_id, "-I C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Include\\", NULL, NULL);
    But I'm getting error 43: CL_INVALID_BUILD_OPTIONS.
    What am I doing wrong?

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    5

    Re: Include a header into kernel

    It looks like the problem is in the spaces in the directory path.
    When I specify "C:\\ProgramFiles" the error code is 0 and everything's fine but when the path is "C:\\Program Files" I still get this error. Is there any way to solve it?

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    1

    Re: Include a header into kernel

    You can escape whitespace with backslash, e.g. "Program\ Files".

  4. #4
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: Include a header into kernel

    You do realise that you can't call host-side external libraries from inside kernels.

  5. #5

    Re: Include a header into kernel

    ... Maybe (s)he wants to also add some of the relevant source to the .cl file as helper functions?...

    Under XCode, when I want to include a header in my kernel I just use an "include" line as always, but specifying the whole path name, i.e.:

    #include "/Developer/myprojs/thisproj/thisfile.h"

Similar Threads

  1. header file in kernel file
    By agmegharaj in forum OpenCL
    Replies: 1
    Last Post: 08-30-2011, 02:11 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
  •