-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plug-in not found: junion #6
Comments
I was able to resolve, in which I didn't include junionc.jar. Netbeans wasn't finding the plugin. Anyway, this seems like a lovely library. I'll experiment with my OpenCL ray tracer. I'm using jocl library from JOCL . I've been running through issues with out of memory exceptions with full type class approach due to object heap issues, yet the objects (class form) I'm using for opencl in java contain only primitives and my 4GB laptop is kinda sweating a lot with that. And with Chrome eating all the ram. A nightmare. By the way, Valhalla has progressed a lot of late. I noticed they showcased a jdk containing Valhalla, and the memory consumption by primitive objects has been reduced by half! Amazing times ahead. |
It seems junion isn't working. A simple struct that is sent to opencl and modified, returned data seemed jumbled up. As I had thought, the struct is compatible if layout is represented by one type variables.
but not struct with different type variables
|
As far as I understand, you would like for the Java junion struct to have the same memory representation as a struct in C/C++? If that is the case, in junion you have to use Manual alignment, otherwise the junion compiler, by default is free to realign the actual in-memory representation as it sees fit to minimize memory usage. A structure with manual alignment (and representation) is defined by the annotation For debugging purposes you can also print the layout of a struct with: |
Thank you TehLeo. Much appreciated. I figured out the issue. Apparently, OpenCL is interesting. A struct in OpenCL should be aligned in a way that struct size must be multiples of maximum datatype size. If the largest is float4 (16 bytes) and the subsequent datatype is an int, then I need to pad by 12 bytes since (4 bytes (int) + 12 bytes (3 floats) = 16 bytes). The alignment of the structs I created with JUnion before didn't map well to OpenCL due to that reason. Therefore, by just correcting that, all things reflected well between CPU and GPU. Amazing. I'll do more experiment with the library. |
Thank you for reply. I'm glad that helped resolve the problem. 🙂 |
JUnion configuration on netbeans 8.2 is okay after importing junion.jar as library. Unable to run a simple application since netbeans cannot run a simple program setting a struct array. Error shown is:
ant -f C:\\Users\\user\\Documents\\NetBeansProjects\\JUnionTest -Djavac.includes=juniontest/JUnionTest.java -Dnb.internal.action.name=run.single -Drun.class=juniontest.JUnionTest run-single init: Deleting: C:\Users\user\Documents\NetBeansProjects\JUnionTest\build\built-jar.properties deps-jar: Updating property file: C:\Users\user\Documents\NetBeansProjects\JUnionTest\build\built-jar.properties Compiling 1 source file to C:\Users\user\Documents\NetBeansProjects\JUnionTest\build\classes plug-in not found: junion compile-single: run-single: Exception in thread "main" java.lang.NullPointerException at juniontest.JUnionTest.main(JUnionTest.java:23) C:\Users\user\Documents\NetBeansProjects\JUnionTest\nbproject\build-impl.xml:1051: The following error occurred while executing this line: C:\Users\user\Documents\NetBeansProjects\JUnionTest\nbproject\build-impl.xml:805: Java returned: 1 BUILD FAILED (total time: 0 seconds)
The text was updated successfully, but these errors were encountered: