include - directive

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

include - directive

Siassei
Hello,

I has some include and will compile the kernel-function. I do that with
// Language: Scala
val file = new File("opencl/main.cl")
val dir = new File("opencl/")
program = context.createProgram(new FileInputStream(file))
val cfg = program.prepare
cfg.withOption("-I "+ dir.getAbsolutePath)

program = cfg.build // boom --> error

error message:
Cann't build Program
com.jogamp.opencl.CLException$CLBuildProgramFailureException:
Exception in thread "main" com.jogamp.opencl.CLException$CLInvalidProgramExecutableException: unable to create Kernel with name: computeImage
CLDevice [id: 139942249771808 name: GeForce 9800 GT type: GPU profile: FULL_PROFILE] build log:
:38: error: 'constant.cl' file not found
#include "constant.cl"
         ^
:39: error: 'vector.cl' file not found
error: CL_INVALID_PROGRAM_EXECUTABLE (man page: http://www.khronos.org/opencl/sdk/1.1/docs/man/xhtml/errors.html)
#include "vector.cl"
         ^
:40: error: 'geometrie.cl' file not found
#include "geometrie.cl"
... and so on

It's possible to link opencl-files with jocl?
All files are in the opencl directory.
Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Siassei
The path to the opencl directory was
"/abc/ade sdgfe/opencl"

with
"/abc/ade_sdgfe/opencl"
works the opencl compiler. Is this a problem with the jocl implementation or with the nvidia sdk?
Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Michael Bien
What does the underscore mean in your case? Path seperator or whitespace?

I prefer using simple String concatenation to create programs since it ensures best portability. I haven't used the include mechanism yet. But it should work... its completely jocl independent, all IO is done by the OpenCL implementation.

-michael
On 08/06/2010 06:36 PM, Siassei [via jogamp] wrote:
The path to the opencl directory was
"/abc/ade sdgfe/opencl"

with
"/abc/ade_sdgfe/opencl"
works the opencl compiler. Is this a problem with the jocl implementation or with the nvidia sdk?


View message @ http://jogamp.762907.n3.nabble.com/include-directive-tp1027281p1030923.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.

Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Siassei
> But it should work... its completely jocl independent, all IO is done by the OpenCL implementation.
Ok. With withespace the compiler doesn't found the include files.
Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Michael Bien
  whitespace is usually not a path seperator, thats why i asked. Usually
it is : or ; dependent on the OS.
On 08/06/2010 09:09 PM, Siassei [via jogamp] wrote:
> > But it should work... its completely jocl independent, all IO is
> done by the OpenCL implementation.
> Ok. With withespace the compiler doesn't found the include files.

Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Siassei
Directory-Name with whitespace
e.g. Windows XP - 6 german
C:\Dokumente und Einstellungen\...
or
/home/myName/dev/Viewer OpenCL\...

OpenCL can not found any file in a directory, that path has a withespace.
Reply | Threaded
Open this post in threaded view
|

Re: include - directive

Michael Bien
you will have to escape the whitespace character otherwise the OpenCL impl might interpret it as multiple compiler arguments instead of one argument.
http://en.wikipedia.org/wiki/String_literal#Escape_character

Siassei wrote
Directory-Name with whitespace
e.g. Windows XP - 6 german
C:\Dokumente und Einstellungen\...
or
/home/myName/dev/Viewer OpenCL\...

OpenCL can not found any file in a directory, that path has a withespace.