-
Notifications
You must be signed in to change notification settings - Fork 33
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
I compile this for android. I want to share my jar. #15
Comments
If you want, you can visit my fork https://github.com/aicodex/JOCL/ |
Thank you for your contribution. A few years ago, I created a version of JOCL for Android using the NDK, but that was rather an experiment. Beyond that, I'm not so familair with Android, particularly the deployment process of native libraries. Are there any further changes necessary (for the makefiles, for example)? I also wonder about one change here: aicodex@1872587 : From where did you get these strings "aarch64", "armv5tel" and "armv7hl"? The case that the architecture starts with "arm" is no longer covered now (i.e. if the string was "armXYZ", then none of the conditions would match) - it's subtle... Regarding the |
I get the string aarch64 just from my phone. |
Admittedly, I didn't understand this in all depth. However, regarding a new release, the most important parts will be the update of the LibUtils, as well as the corresponding native libraries ( Beyond that, I'd still have to read more about the deployment process of native libraries for Android. How do you eventually build the APK file? The question may be naive, but ... is there any point in adding these natives in the JAR that is available in Maven central? (In the initial PR for Android support, at #4 , there was some related discussion, but not so much regarding the deployment) |
You're very considerate. Infact when android studio compile a apk with a jar or arr library just like this: when you install the apk. Android will select the folder that your phone supports.just like this: |
Apologies for being so hesitant. The point is: I cannot test this. And I'd really like to avoid breaking existing processes. The compilation of native libraries, and particularly loading them in Java, has some caveats. (It would really be great if @phlip9 could say whether the compilation works for him with these changes. When it works for two different systems, it's likely to work for more) In any case, I really appreciate your contribution and support. Assuming that putting the .SOs into the jar does not make sense, offering the result as a downloadable .ZIP file on jocl.org would probably make most sense. I'll add some comments in the pull request, though... |
Hello @aicodex I tried to extract the relevant parts of #16 and committed them in a branch at 14cc906 Using the libraries that you provided with the PR, I created a JAR. It contains the native libraries, in the sub-folders that you also used, and I have uploaded it to http://jocl.org/jocl-2.0.1-SNAPSHOT-2017-08-31.jar It would be great if you could test this, or give any other feedback. Two points are particularly relevant for me now:
If this works and makes sense, I'd add the JAR (or ZIP) as a dedicated "Android JOCL" JAR at http://www.jocl.org/downloads/downloads.html (with credits to you, of course) |
OK,I will test it and give you feedback. Recently, the Android developer have a new way to package the source with native library is to package it to arr(just a Android library project package, because many Android library is some UI implement, so they should package not only native library but also xml and permission configuration). |
I add all android platform : arm,arm-v7a,arm64,mips,mips64,x86,x86_64. It just 1.9mb. and I import it to my android app, Us Android Studio . when the app installed, it can auto deploy the .so file to /data/app/xxx.xxx.xxx/lib/arm64 or /data/app/xxx.xxx.xxx/lib/arm and so on… I use two of your samples to test it. and found HistogramAMD.java line 87 maxWorkGroupSize should be "long" in android. And JOCLSample_1_2_KernelArgs.java line 173 clGetDeviceIDs(platform, deviceType, 0, null, numDevicesArray);
the deviceType can't be CL_DEVICE_TYPE_ALL but can be CL_DEVICE_TYPE_CPU/GPU/DEFAULT
The text was updated successfully, but these errors were encountered: