Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

#include in kernel

Hi folks,

I need some tiny bit of help here. In my kernel.cl, I have an# include preprocessor directive:

# include Headers/HashSetKernelFind.h

I can't seem to get the -I option of aoc on the command line to work, which I need because I have to run aoc in another directory on the same level as the "Headers" one. So I do this:

aoc -I ../ kernel.cl

But I just get:

aoc: Running OpenCL parser....

c:/path/to/project/GraphPurger/kernel.cl:1:10: fatal error: 'Headers/HashSetKernelFind.h' file not found# include "Headers/HashSetKernelFind.h"

^

1 error generated.

Error: OpenCL parser FAILED.

Refer to kernel.log for details.

What am I doing wrong? The same works with AMD APP SDK and Intel OpenCL SDK.

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I reproduced this on Windows but it doesn't happen on Linux. You are not doing anything wrong since I'm 99.9999% sure this should have worked on Windows as well.

    For now I would just omit the -I flag and just use this in the kernel file instead# include "../Headers/HashSetKernelFind.h"
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Good to know. Thanks a bunch for the validation.

    I'll report this issue.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually I already gave the OpenCL engineering team a test case for this.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well, too late, I had submitted it already. I was told you were currently working with the OpenCL design team on this matter, so please let me know about any update.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Apparently it's an issue with Clang that is causing this. The fix is to make sure that there are no trailing slashes in the include path. So if you want to include something one level up in the directory structure instead of this:

    -I ../

    You do this instead:

    -I ..

    The limitation is on page 5 of the 14.0 release notes: http://www.altera.com/literature/rn/rn_aocl.pdf
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This seems to be broken in 14.0.1. Everything was working fine in 14.0.0, but then I upgraded, and get this error now:

    aoc -c -v -I .. kernel.cl

    aoc: Environment checks are completed successfully.

    aoc: Selected target board pcie385n_a7

    aoc: Running OpenCL parser....

    aoc: OpenCL parser completed successfully.

    Couldn't open file ..\Headers/Crypto.h for reading

    Error: Can't save source into package file: 'pkg_editor ..\Headers/Crypto.h add .acl.source.1 ..\Headers/Crypto.h' failed

    Nothing else has changed but running the executable "AOCLSetup-14.0.1.205-windows.exe". Obviously I have checked and the file to be included is still there, and readable by me.

    Any ideas?