NVIDIA / grcuda

Polyglot CUDA integration for the GraalVM
Other
222 stars 19 forks source link

add missing TruffleBoundary and transferToInterpreter #9

Closed lukasstadler closed 5 years ago

lukasstadler commented 5 years ago

These changes are enough to allow creating a native image with support for grCUDA. Unfortunately, it's not quite obvious how to build and use a polyglot image:

bin/gu rebuild-images libpolyglot -cp <path-to>/grcuda.jar

will enable grCUDA in `bin/node --polyglot.

bin/gu rebuild-images polyglot -cp <path-to>/grcuda.jar

will enable grCUDA in `bin/js --polyglot.

muellren commented 5 years ago

Does not seem to work for me.

gu rebuild-images polyglot -cp mxbuild/dists/jdk1.8/grcuda.jar
js --polyglot
> const DeviceArray = Polyglot.eval('grcuda', 'DeviceArray')
Error: No language for id grcuda found. Supported languages are: [js, llvm, python, ruby]
        at <js> :program(<shell>:1:1:20-57)
gu rebuild-images libpolyglot -cp mxbuild/dists/jdk1.8/grcuda.jar
node --polyglot
> const DeviceArray = Polyglot.eval('grcuda', 'DeviceArray')
Error: No language for id grcuda found. Supported languages are: [js, llvm, python, ruby]
    at Object.eval (native)

I did also copy the grcuda.jar into languages/grcuda.

lukasstadler commented 5 years ago

Could you please try the gu rebuild-images commands with an absolute path for the grcuda.jar file?

muellren commented 5 years ago

Could you please try the gu rebuild-images commands with an absolute path for the grcuda.jar file?

bin/gu rebuild-image -cp <absolute-path-to>/grcuda.jar works.

lukasstadler commented 5 years ago

mx checkstyle fails (no spaces between imports).

I think I'll have to resolve this by removing the offending check from the checkstyle configuration, since it clashes with what the eclipse formatting/organize import does.