From 63242f92961cd4ae6cb2b0b5fc53dbab694e0faf Mon Sep 17 00:00:00 2001 From: Christian Trimble Date: Sun, 15 Mar 2015 22:41:48 -0700 Subject: [PATCH 01/34] added travis configuration file. --- .travis.yml | 15 +++++++++++++++ README.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..35850e9b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: java + +jdk: +- oraclejdk8 + +env: +- MAVEN_OPTS=-Xmx512m CL_LOG_ERRORS=stdout + +before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq fglrx=2:8.960-0ubuntu1 opencl-headers + +notifications: + email: + - xiantrimble@gmail.com diff --git a/README.md b/README.md index e63100d6..a74a48e8 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ It was previously hosted on [ochafik/nativelibs4java](http://github.com/ochafik/ # Quick links [![Join the chat at https://gitter.im/ochafik/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ochafik/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/ctrimble/JavaCL.svg?branch=feature_travis-build)](https://travis-ci.org/ctrimble/JavaCL) * [CHANGELOG](https://github.com/ochafik/JavaCL/blob/master/CHANGELOG) * [FAQ](http://code.google.com/p/javacl/wiki/FAQ) From 0772ffb35efd63ba3f8caebf581f6791ef430349 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 00:02:53 +0000 Subject: [PATCH 02/34] Markdown CHANGELOG with refs to old closed issues in nativelibs4java repo --- CHANGELOG => CHANGELOG.md | 177 ++++++++++++++++++++++++-------------- 1 file changed, 112 insertions(+), 65 deletions(-) rename CHANGELOG => CHANGELOG.md (58%) diff --git a/CHANGELOG b/CHANGELOG.md similarity index 58% rename from CHANGELOG rename to CHANGELOG.md index 28b78b66..36784845 100644 --- a/CHANGELOG +++ b/CHANGELOG.md @@ -1,48 +1,69 @@ -Current development version (1.0-SNAPSHOT) +## Current development version (1.0-SNAPSHOT) ... -Version 1.0.0-RC4 (20150308) +## Version 1.0.0-RC4 (20150308) - Dropped Blas artifact from main deployment (requires addional repo since ujmp is not in Maven Central) - Dropped support for JNA variant of JavaCL. Migration is highly encouraged to get more features and bugfixes: https://code.google.com/p/javacl/wiki/MigratingFromJNAToBridJ - Updated to BridJ 0.7 (brings fixes and lots of performance enhancements) - Optimized allocation of native memory throughout the library (reusing thread-local pointer pools) - Optimized (CLDevice, CLPlatform).hasExtension -- Added basic handling of structs in JavaCL Generator (issue #421, issue #422, issue #423) +- Added basic handling of structs in JavaCL Generator ([issue nativelibs4java#421] + (https://github.com/nativelibs4java/nativelibs4java/issues/421), [issue nativelibs4java#422] + (https://github.com/nativelibs4java/nativelibs4java/issues/422), [issue nativelibs4java#423] + (https://github.com/nativelibs4java/nativelibs4java/issues/423)) - Added CLBuffer.copyTo, .copyBytesTo, .copyElementsTo -- Added CLBuffer.fillBuffer to support OpenCL 1.2 clEnqueueFillBuffer (issue #232) +- Added CLBuffer.fillBuffer to support OpenCL 1.2 clEnqueueFillBuffer ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) - Added CLDevice.getParent() - Added CLDevice.getPrintfBufferSize(), .isPreferredInteropUserSync(), .isLinkerAvailable() -- Added CLImage.copyTo (issue #508) -- Added CLImage.fillImage (issue #232) -- Added CLPlatform.unloadPlatformCompiler() with automatic switch between OpenCL 1.1 clUnloadCompiler and OpenCL 1.2 clUnloadPlatformCompiler (issue #232) -- Added CLQueue.enqueueBarrier & .enqueueMarker to support clEnqueueBarrierWithWaitList & clEnqueueMarkerWithWaitList (switching between OpenCL 1.1 and OpenCL 1.2 variants automatically) (issue #232) -- Added CLQueue.enqueueMigrateMemObjects (issue #232) +- Added CLImage.copyTo ([issue nativelibs4java#508] + (https://github.com/nativelibs4java/nativelibs4java/issues/508)) +- Added CLImage.fillImage ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) +- Added CLPlatform.unloadPlatformCompiler() with automatic switch between OpenCL 1.1 clUnloadCompiler and OpenCL 1.2 clUnloadPlatformCompiler ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) +- Added CLQueue.enqueueBarrier & .enqueueMarker to support clEnqueueBarrierWithWaitList & clEnqueueMarkerWithWaitList (switching between OpenCL 1.1 and OpenCL 1.2 variants automatically) ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) +- Added CLQueue.enqueueMigrateMemObjects ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) - Added JAVACL_LOG_CALLS=1 / -Djavacl.logCalls=true to log every native call (similar to BRIDJ_LOG_CALLS except it prints the parameter and return values) -- Added many missing CLDevice 1.2 info getters (issue #232), -- Added MapFlags.WriteInvalidateRegion (CL_MAP_WRITE_INVALIDATE_REGION from OpenCL 1.2) (issue #232) +- Added many missing CLDevice 1.2 info getters ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)), +- Added MapFlags.WriteInvalidateRegion (CL_MAP_WRITE_INVALIDATE_REGION from OpenCL 1.2) ([issue nativelibs4java#232] + (https://github.com/nativelibs4java/nativelibs4java/issues/232)) - Fixed crash in CLPlatform.getBinaries() -- Fixed excessive logs for deprecated features and missing OpenCL 1.1 and 1.2 functions (especially if version < deprecatedVersion) -- Fixed issue #387: don't call clReleaseDevice (OpenCL 1.2) unless explicitly needed -- Fixed issue #397: crash on Radeon due to bug in driver (attempts to get the source from a program created with clCreateProgramWithBinary yields a segfault) -- Fixed issue #397: major bug in CLProgram -- Fixed issue #420: horrible random native crash (double release, found with new -Dbridj.debug.pointer.releases=true). -- Fixed issue #453: don't try to load cached binaries for programs created from binaries! -- Fixed issue #455: when reading binaries, skip devices that are not allowed -- Fixed issue #479: avoid some NPEs in CLProgram.getProgramBuildInfo -- Fixed typo: CLDevice.getOpenCLVersion -> getOpenCLCVersion - -Version 1.0.0-RC3 (20130107) +- Fixed excessive logs for deprecated features and missing OpenCL 1.1 and 1.2 functions (especially if version < deprecatedVersion) +- Fixed [issue nativelibs4java#387] + (https://github.com/nativelibs4java/nativelibs4java/issues/387): don't call clReleaseDevice (OpenCL 1.2) unless explicitly needed +- Fixed [issue nativelibs4java#397] + (https://github.com/nativelibs4java/nativelibs4java/issues/397): crash on Radeon due to bug in driver (attempts to get the source from a program created with clCreateProgramWithBinary yields a segfault) +- Fixed [issue nativelibs4java#397] + (https://github.com/nativelibs4java/nativelibs4java/issues/397): major bug in CLProgram +- Fixed [issue nativelibs4java#420] + (https://github.com/nativelibs4java/nativelibs4java/issues/420): horrible random native crash (double release, found with new -Dbridj.debug.pointer.releases=true). +- Fixed [issue nativelibs4java#453] + (https://github.com/nativelibs4java/nativelibs4java/issues/453): don't try to load cached binaries for programs created from binaries! +- Fixed [issue nativelibs4java#455] + (https://github.com/nativelibs4java/nativelibs4java/issues/455): when reading binaries, skip devices that are not allowed +- Fixed [issue nativelibs4java#479] + (https://github.com/nativelibs4java/nativelibs4java/issues/479): avoid some NPEs in CLProgram.getProgramBuildInfo +- Fixed typo: CLDevice.getOpenCLVersion -> getOpenCLCVersion + +## Version 1.0.0-RC3 (20130107) - Fixed nasty regression in getBestDevice ! - Fixed ati byte order hack - Fixed byte order hack for ATI platforms - Fixes / optimized event callbacks (but broke API: CLEvent.EventCallback now only takes the completion status as argument, not the event anymore) - Fixed library probe -- Fixed handling of image2d_t and image3d_t in Maven plugin (contrib. from Remi Emonet, request #308 and issue #307) -- Fixed OpenGL interop on Windows (issue #312) -- Fixed error about mismatching byte order for byte buffers, and replaced mentions to getKernelsDefaultByteOrder() by getByteOrder() (issue #336) +- Fixed handling of image2d_t and image3d_t in Maven plugin (contrib. from Remi Emonet, request #308 and [issue nativelibs4java#307] + (https://github.com/nativelibs4java/nativelibs4java/issues/307)) +- Fixed OpenGL interop on Windows ([issue nativelibs4java#312] + (https://github.com/nativelibs4java/nativelibs4java/issues/312)) +- Fixed error about mismatching byte order for byte buffers, and replaced mentions to getKernelsDefaultByteOrder() by getByteOrder() ([issue nativelibs4java#336] + (https://github.com/nativelibs4java/nativelibs4java/issues/336)) - Fixed AMD App 2.7 Linux library loading code for - Fixed AMD download link in demos. - Added CLEvent.FIRE_AND_FORGET to avoid returning events from all the methods that accept a vararg eventsToWaitFor. @@ -55,26 +76,32 @@ Version 1.0.0-RC3 (20130107) - Deprecated CLKernel.enqueueNDRange with int[] parameters - Return CLUserEvent from CLContext.createUserEvent(); -Version 1.0.0-RC2 (20120415, commit 6bc061dfce06b941086a29f696195e82fbaffbdc) +## Version 1.0.0-RC2 (20120415, commit 6bc061dfce06b941086a29f696195e82fbaffbdc) - Release artifacts are available in Maven Central - Added support for sub-images reading/writing from/to CLImage2D (slower than with full images) -- Fixed endianness issues with CLBuffer (issue #80) -- Fixed migration of cached binaries to newer versions of OS (e.g. upgrading from Snow Leopard to Lion) (issue #81) -- Fixed handling compiler options containing spaces (issue #274) -- Fixed tutorial artifact pom repositories (issue #279) +- Fixed endianness issues with CLBuffer ([issue nativelibs4java#80] + (https://github.com/nativelibs4java/nativelibs4java/issues/80)) +- Fixed migration of cached binaries to newer versions of OS (e.g. upgrading from Snow Leopard to Lion) ([issue nativelibs4java#81] + (https://github.com/nativelibs4java/nativelibs4java/issues/81)) +- Fixed handling compiler options containing spaces ([issue nativelibs4java#274] + (https://github.com/nativelibs4java/nativelibs4java/issues/274)) +- Fixed tutorial artifact pom repositories ([issue nativelibs4java#279] + (https://github.com/nativelibs4java/nativelibs4java/issues/279)) - Fixed many Javadoc typos -- Fixed support of Intel's OpenCL Windows runtime (issue #297) +- Fixed support of Intel's OpenCL Windows runtime ([issue nativelibs4java#297] + (https://github.com/nativelibs4java/nativelibs4java/issues/297)) - Enhanced LocalSize API (added static factory methods for all primitive types) - Deprecated CLContext.getKernelsDefaultByteOrder() and CLDevice.getKernelsDefaultByteOrder() -- Added more informative exceptions when passing null pointers to CLBuffer.writeBytes (issue #257) +- Added more informative exceptions when passing null pointers to CLBuffer.writeBytes ([issue nativelibs4java#257] + (https://github.com/nativelibs4java/nativelibs4java/issues/257)) - Updated to OpenCL 1.2 headers - Added -cl-nv-verbose, -cl-nv-maxrregcount, -cl-nv-opt-level + proper log even without error when nv-verbose is set - Enhanced handling of endianness : warn when creating contexts with devices that have mismatching endianness, throw when creating buffer out of Buffer / Pointer with bad endianness - Changed signature of CLPlatform.listDevices (now takes a single CLDevice.Type, including All, instead of an EnumSet thereof) - Moved sources to github (https://github.com/ochafik/nativelibs4java/tree/master/libraries/OpenCL) -Version 1.0.0-RC1 (r2130, 20110621) +## Version 1.0.0-RC1 (r2130, 20110621) - BridJ version now becomes the default : the JNA version is still maintained and available with all Maven artifact ids suffixed with "-jna" (BridJ-based JavaCL's main artifact is now "javacl", while the JNA-based version is "javacl-jna") - added simple Fourier-analysis classes (package com.nativelibs4java.opencl.util.fft), with double and float variants, usable with primitive arrays or OpenCL buffers : @@ -90,21 +117,24 @@ Version 1.0.0-RC1 (r2130, 20110621) - added CLBuffer.copyTo(CLQueue, CLMem destination, CLEvent...) and CLBuffer.emptyClone(Usage) - added NIOUtils.indirectBuffer(size, bufferClass) - added CLContext.toString -- deprecated CLXXXBuffer in favor of CLBuffer (CLIntBuffer becomes CLBuffer, etc...) +- deprecated CLXXXBuffer in favor of CLBuffer<XXX> (CLIntBuffer becomes CLBuffer, etc...) - changed CLContext.createBuffer(Usage, length, class) to createBuffer(Usage, class, length) to match the JavaCL/BridJ API (and provoke migration issues : people should now use a primitive class rather than an NIO buffer class !!! -- complete rewrite of CLBuffer genericity to unify with the BridJ port : CLBuffer is now CLBuffer, and CLBuffer.read/write/map are no longer strongly typed (it is implicitely typed with Buffer subclasses for compatibility with existing code). The BridJ port will be favoured, and its read/write/map methods use typed Pointer. +- complete rewrite of CLBuffer genericity to unify with the BridJ port : CLBuffer<DoubleBuffer> is now CLBuffer, and CLBuffer.read/write/map are no longer strongly typed (it is implicitely typed with Buffer subclasses for compatibility with existing code). The BridJ port will be favoured, and its read/write/map methods use typed Pointer. - complete rewrite of UJMP Matrix implementation, using principles borrowed from ScalaCL -- fixed issue #66 (create temp files in ~/.javacl subdirectories instead of /tmp) +- fixed [issue nativelibs4java#66] + (https://github.com/nativelibs4java/nativelibs4java/issues/66) (create temp files in ~/.javacl subdirectories instead of /tmp) - fixed OpenGL sharing on MacOS X - fixed CLProgram.getBinaries() in some cases - fixed CLBuffer.read on indirect buffers - fixed NPE that happens with null varargs CLEvent[] array - fixed length = 1 case in reduction utility -- fixed ATI detection ("ATI Stream" now replaced by "AMD Accelerated Parallel Processing", cf. Csaba's comment in issue #39) -- fixed issue #55 : applied Kazo Csaba's patch to fix the bounds of CLBuffer.map's returned buffer +- fixed ATI detection ("ATI Stream" now replaced by "AMD Accelerated Parallel Processing", cf. Csaba's comment in [issue nativelibs4java#39] + (https://github.com/nativelibs4java/nativelibs4java/issues/39)) +- fixed [issue nativelibs4java#55] + (https://github.com/nativelibs4java/nativelibs4java/issues/55) : applied Kazo Csaba's patch to fix the bounds of CLBuffer.map's returned buffer - fixed inheritance of CLBuildException (now derives from CLException) -Version 1.0-beta-6 (r1637, 20100204) +## Version 1.0-beta-6 (r1637, 20100204) - Fixed support of ATI Stream 2.3 (CPU) - New interactive image kernel demo : lets you edit and test image kernels in a snap (bundled with a few samples) @@ -120,22 +150,29 @@ Version 1.0-beta-6 (r1637, 20100204) - Added LibCL : growing collection of OpenCL functions that can be included from any JavaCL kernel - CLKernel.enqueueNDRange has a new overload without localWorkSizes argument (it's then adjusted to a good value by the OpenCL implementation). - ScalaCLv2 was rewritten to fit nicely into Scala's collections framework. -- Added CLContext.createProgram(Map) to create from saved binaries (contribution from Kazo Csaba, issue #30) +- Added CLContext.createProgram(Map<CLDevice, byte[]>) to create from saved binaries (contribution from Kazo Csaba, [issue nativelibs4java#30] + (https://github.com/nativelibs4java/nativelibs4java/issues/30)) - Added CLProgram.addBuildOption(String) - Fixed CLBuffer.copyTo -- Demos now use the latest jogamp JOGL binaries (see the updated build instructions : http://code.google.com/p/javacl/wiki/Build) - -Version 1.0-beta-5 (r1067, 20100717) +- Demos now use the latest jogamp JOGL binaries (see the updated build instructions : [http://code.google.com/p/javacl/wiki/Build) +](http://code.google.com/p/javacl/wiki/Build) +) +## Version 1.0-beta-5 (r1067, 20100717) - Now using a nice configuration dialog when launching ParticlesDemo : has optional OpenCL settings with "Fastest", "Normal" and "Safest" presets + detailed platform and device choice (with optional OpenGL sharing choice). - Added optional context properties map argument to JavaCL.createContext (can be nulled out) -- Fixed issue #18: CLImage.write calls enqueueImageRead ! -- Documented workaround for Linux crashes (issue #20) : http://code.google.com/p/javacl/wiki/TroubleShootingJavaCLOnLinux -- Fixed issue #21: NIOUtils.put() doesn't accept ByteBuffer -- Fixed issue #25: CLEvent.waitFor bug causes segfault +- Fixed [issue nativelibs4java#18] + (https://github.com/nativelibs4java/nativelibs4java/issues/18): CLImage.write calls enqueueImageRead ! +- Documented workaround for Linux crashes ([issue nativelibs4java#20] + (https://github.com/nativelibs4java/nativelibs4java/issues/20)) : [http://code.google.com/p/javacl/wiki/TroubleShootingJavaCLOnLinux +](http://code.google.com/p/javacl/wiki/TroubleShootingJavaCLOnLinux +)- Fixed [issue nativelibs4java#21] + (https://github.com/nativelibs4java/nativelibs4java/issues/21): NIOUtils.put() doesn't accept ByteBuffer +- Fixed [issue nativelibs4java#25] + (https://github.com/nativelibs4java/nativelibs4java/issues/25): CLEvent.waitFor bug causes segfault - OpenCL 1.1 support : - CLContext.createUserEvent() - CLUserEvent.setStatus(int), setCompleted() @@ -152,13 +189,14 @@ out) - Faster enums - Check for cl_amd_fp64 in CLDevice.isDoubleSupported() - Fixed CLProgram.getBinaries() -- Fixed issue #22 (maven pom issue) +- Fixed [issue nativelibs4java#22] + (https://github.com/nativelibs4java/nativelibs4java/issues/22) (maven pom issue) -Version 1.0-beta-4 (r760, 20100121) +## Version 1.0-beta-4 (r760, 20100121) -- Changed semantics of offset & length arguments in typed CLxxxBuffer.read / write / map methods : now expressed in elements, not in bytes (e.g. 4 bytes per element for CLIntBuffer) +- Changed semantics of offset & length arguments in typed CLxxxBuffer.read / write / map methods : now expressed in elements, not in bytes (e.g. 4 bytes per element for CLIntBuffer) - Added OpenGL interoperability methods to CLContext and CLQueue (can create a CLByteBuffer from an OpenGL buffer object, a CLImage2D/3D from an OpenGL 2D/3D texture or a renderbuffer). -- Added OpenGL-compatible context creation methods to JavaCL & CLPlatform classes +- Added OpenGL-compatible context creation methods to JavaCL & CLPlatform classes - Added basic reduction support in ReductionUtils (cumulative additions, multiplications, min, max...) - Created javacl-demos package, with Particles, Hardware Report and Mandelbrot demos... - Finished migration from NativeLong to NativeSize (changes only the low-level bindings) @@ -169,29 +207,38 @@ Version 1.0-beta-4 (r760, 20100121) - Created a kernel wrapper autogenerator (Maven plugin based on JNAerator) : translates all constants on the Java side and presents kernels as methods with the correct Java argument types. It assumes OpenCL kernels (*.c, *.cl) are in src/main/opencl - Added wrappers around clGetKernelWorkGroupInfo - Fixed respect of endianness of devices that have different endianness than platform -- Fixed issue #10: "getMaxWorkItemSizes() fails on win7 64 GTX260" +- Fixed [issue nativelibs4java#10] + (https://github.com/nativelibs4java/nativelibs4java/issues/10): "getMaxWorkItemSizes() fails on win7 64 GTX260" -Version 1.0-beta-3 (r , 20091030) +## Version 1.0-beta-3 (r , 20091030) -- Fixed Issue #8 : NativeLong's can not represent size_t on windows x64 system (all user code that uses the low-level bindings needs to be updated : NativeLong -> NativeSize) +- Fixed [Issue nativelibs4java#8] + (https://github.com/nativelibs4java/nativelibs4java/issues/8) : NativeLong's can not represent size_t on windows x64 system (all user code that uses the low-level bindings needs to be updated : NativeLong -&gt; NativeSize) - Added CLContext/CLDevice.isDoubleSupported, isHalfSupported, isByteAddressableStoreSupported - Added If function to ScalaCL (operates on statements or on expressions) - Added CLAbstractEntity.release() -- Fixed Issue #4 : CLContext.createContext(CLDevice... devices) created context on only one device -- Regenerated the low level bindings with latest JNAerator : now using NativeSize class instead of NativeLong for size_t (fixes Issue #8) -- Fixed Issue #5 : fixed formatting of CLPlatform.toString() -- Fixed Issue #6 : use max X workgroup dimension for better benchmark speed -- Fixed Issue #7 : CLMem class bug in Usage.WriteOnly and Usage.ReadWrite -- Fixed Issue #11 : call clRetainMemObject when sharing a cl_mem between CLBuffer instances. +- Fixed [Issue nativelibs4java#4] + (https://github.com/nativelibs4java/nativelibs4java/issues/4) : CLContext.createContext(CLDevice... devices) created context on only one device +- Regenerated the low level bindings with latest JNAerator : now using NativeSize class instead of NativeLong for size_t (fixes [Issue nativelibs4java#8] + (https://github.com/nativelibs4java/nativelibs4java/issues/8)) +- Fixed [Issue nativelibs4java#5] + (https://github.com/nativelibs4java/nativelibs4java/issues/5) : fixed formatting of CLPlatform.toString() +- Fixed [Issue nativelibs4java#6] + (https://github.com/nativelibs4java/nativelibs4java/issues/6) : use max X workgroup dimension for better benchmark speed +- Fixed [Issue nativelibs4java#7] + (https://github.com/nativelibs4java/nativelibs4java/issues/7) : CLMem class bug in Usage.WriteOnly and Usage.ReadWrite +- Fixed [Issue nativelibs4java#11] + (https://github.com/nativelibs4java/nativelibs4java/issues/11) : call clRetainMemObject when sharing a cl_mem between CLBuffer instances. - Choose 'best' device in benchmark test -Version 1.0-beta-2 +## Version 1.0-beta-2 - JAR is now self-sufficient (includes JNA + JNAerator's runtime classes) - Added CLKernel.setLocalArg(argIndex, localArgByteLength) - Allow localWorkSizes to be null in enqueueNDRange - Added support for barriers and markers in CLQueue -- Fixed issue #2 : enqueueNDRange does not work for nDim > 1 +- Fixed [issue nativelibs4java#2] + (https://github.com/nativelibs4java/nativelibs4java/issues/2) : enqueueNDRange does not work for nDim > 1 - Added CLDevice.getMaxWorkItemSizes() - CLDevice.toString() now only prints the name - Moved method createContext from CLContext to CLPlatform @@ -211,7 +258,7 @@ Version 1.0-beta-2 - Added hashCode and equals method to most classes - Added ability to create out of order queues and change queue properties after creation -Version 1.0-beta-1 +## Version 1.0-beta-1 - New CLPlatform class (~ OpenCL implementation) which now hosts the list*Devices(...) methods - Entry point of library is now OpenCL4Java.listPlatforms() @@ -219,8 +266,8 @@ Version 1.0-beta-1 - Better separation between blocking and non blocking calls - New CLSampler class supported as argument of CLKernel - Many info getters with typesafe enums / enum sets in classes CLDevice, CLPlatform, CLKernel... -- Much more complete JavaDoc : http://nativelibs4java.sourceforge.net/sites/OpenCL4Java/apidocs/ -- Example & benchmark classes became JUnit tests and moved here : http://code.google.com/p/nativelibs4java/source/browse/#svn/trunk/lib... +- Much more complete JavaDoc : [http://nativelibs4java.sourceforge.net/sites/OpenCL4Java/apidocs/](http://nativelibs4java.sourceforge.net/sites/OpenCL4Java/apidocs/) +- Example & benchmark classes became JUnit tests and moved here : [http://code.google.com/p/nativelibs4java/source/browse/#svn/trunk/lib...](http://code.google.com/p/nativelibs4java/source/browse/#svn/trunk/lib...) While this release is rather OpenCL4Java-focused, ScalaCL also got its bunch of enhancements : - Added scalar variables IntVar, FloatVar, ShortVar... From 07927222dbfedacabc828bdb180e1e554dfecd1f Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 00:06:30 +0000 Subject: [PATCH 03/34] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e63100d6..1fdc366d 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ It was previously hosted on [ochafik/nativelibs4java](http://github.com/ochafik/ # Quick links -[![Join the chat at https://gitter.im/ochafik/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ochafik/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/nativelibs4java/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nativelibs4java/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -* [CHANGELOG](https://github.com/ochafik/JavaCL/blob/master/CHANGELOG) +* [CHANGELOG](./CHANGELOG.md) * [FAQ](http://code.google.com/p/javacl/wiki/FAQ) * [JavaDoc](http://nativelibs4java.sourceforge.net/javacl/api/stable/) * [Credits and License](http://code.google.com/p/bridj/wiki/CreditsAndLicense) # Building ``` - git clone http://github.com/ochafik/JavaCL.git + git clone http://github.com/nativelibs4java/JavaCL.git mvn clean install ``` From ded23272b27f596a72f284c7fabcec5b5b83ce7c Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 00:52:55 +0000 Subject: [PATCH 04/34] Initial Travis CI config --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..ed9d259c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: java +jdk: + - oraclejdk8 + - oraclejdk7 + - openjdk7 + - openjdk6 +before_install: + - sudo apt-get update -qq + - sudo apt-get install -y pocl pocl-opencl-icd + + From 2b9e54e791e09cd4476e38f28beeefa04bb41680 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 01:15:45 +0000 Subject: [PATCH 05/34] Travis CI: dumb down --- .travis.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed9d259c..f997950f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: java jdk: - oraclejdk8 - - oraclejdk7 - - openjdk7 - openjdk6 -before_install: - - sudo apt-get update -qq - - sudo apt-get install -y pocl pocl-opencl-icd - - +# before_install: +# - sudo apt-get update -qq +# - sudo apt-get install -y pocl pocl-opencl-icd +# - "export DISPLAY=:99.0" +# - "sh -e /etc/init.d/xvfb start" From 11ab365d406525736fc57f18172da8aae2d91648 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 21:05:21 +0000 Subject: [PATCH 06/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26b30b02..298252a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Join the chat at https://gitter.im/nativelibs4java/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nativelibs4java/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/nativelibs4java/JavaCL.svg?branch=feature_travis-build)](https://travis-ci.org/nativelibs4java/JavaCL) +[![Maven Central](https://img.shields.io/maven-central/v/com.nativelibs4java/javacl.svg)]() [![Build Status](https://travis-ci.org/nativelibs4java/JavaCL.svg?branch=feature_travis-build)](https://travis-ci.org/nativelibs4java/JavaCL) [![Join the chat at https://gitter.im/nativelibs4java/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nativelibs4java/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [JavaCL](http://javacl.googlecode.com) provides OpenCL bindings for Java. It wraps low-level bindings in a clean object-oriented API, which adds a few goodies. From 8af602f8a5e3fbc20bb488627b0fe82e55cfa668 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 22:47:44 +0000 Subject: [PATCH 07/34] Added CLDevice.getPartitionMaxSubDevices(), fixed (?) getPartitionProperties(), skip tests that can't succeed --- .../com/nativelibs4java/opencl/CLDevice.java | 20 ++++++++-- .../nativelibs4java/opencl/DeviceTest.java | 39 ++++++++++++++----- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 46954d8b..167b993f 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -727,15 +727,27 @@ public static long getValue(EnumSet set) { return EnumValues.getValue(set); } - public static EnumSet getEnumSet(long v) { - return EnumValues.getEnumSet(v, PartitionType.class); + public static PartitionType getEnum(long v) { + return EnumValues.getEnum(v, PartitionType.class); } } - /** TODO */ @InfoName("CL_DEVICE_PARTITION_PROPERTIES") public EnumSet getPartitionProperties() { - return PartitionType.getEnumSet(infos.getIntOrLong(getEntity(), CL_DEVICE_PARTITION_PROPERTIES)); + EnumSet ret = EnumSet.noneOf(PartitionType.class); + Pointer ptr = infos.getPointer(getEntity(), CL_DEVICE_PARTITION_PROPERTIES);; + if (ptr != null) { + Pointer props = ptr.as(SizeT.class); + for (long i = 0, n = props.getValidElements(); i < n; i++) { + ret.add(PartitionType.getEnum(props.getSizeTAtIndex(i))); + } + } + return ret; + } + + @InfoName("CL_DEVICE_PARTITION_MAX_SUB_DEVICES") + public int getPartitionMaxSubDevices() { + return infos.getInt(getEntity(), CL_DEVICE_PARTITION_MAX_SUB_DEVICES); } /** TODO */ diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 7bdd5f1e..27ac3d54 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -14,34 +14,49 @@ import org.junit.*; -import com.nativelibs4java.test.MiscTestUtils; import com.nativelibs4java.util.NIOUtils; import org.bridj.*; import java.nio.ByteOrder; import static org.bridj.Pointer.*; import java.nio.ByteOrder; -import java.util.List; +import java.util.*; +import org.junit.runner.RunWith; import org.junit.runners.Parameterized; /** * * @author ochafik */ -public class DeviceTest extends AbstractCommon { +@RunWith(Parameterized.class) +public class DeviceTest { + private final CLDevice device; + public DeviceTest(CLDevice device) { - super(device); + this.device = device; + + System.out.println(device); + System.out.println("\tmax sub-devices: " + device.getPartitionMaxSubDevices()); + System.out.println("\tpartition properties: " + device.getPartitionProperties()); } @Parameterized.Parameters public static List getDeviceParameters() { - return AbstractCommon.getDeviceParameters(); + List ret = new ArrayList(); + for (CLPlatform platform : JavaCL.listPlatforms()) { + for (CLDevice device : platform.listAllDevices(true)) { + ret.add(new Object[] { device }); + } + } + return ret; } - @Ignore + @Test public void testSplitEqually() { + if (!device.getPartitionProperties().contains(CLDevice.PartitionType.Equally)) return; + int computeUnits = device.getMaxComputeUnits(); System.out.println("computeUnits = " + computeUnits); - int subComputeUnits = 1;//computeUnits / 2; + int subComputeUnits = computeUnits / 2; CLDevice[] subDevices = device.createSubDevicesEqually(subComputeUnits); for (CLDevice subDevice : subDevices) { @@ -49,9 +64,11 @@ public void testSplitEqually() { checkParent(device, subDevice); } } - @Ignore + @Test public void testSplitByCounts() { + if (!device.getPartitionProperties().contains(CLDevice.PartitionType.ByCounts)) return; + long[] counts = new long[] { 2, 4, 8 }; CLDevice[] subDevices = device.createSubDevicesByCounts(counts); assertEquals(counts.length, subDevices.length); @@ -63,9 +80,11 @@ public void testSplitByCounts() { i++; } } - @Ignore + @Test public void testSplitByAffinity() { + if (!device.getPartitionProperties().contains(CLDevice.PartitionType.ByAffinityDomain)) return; + CLDevice[] subDevices = device.createSubDevicesByAffinity(CLDevice.AffinityDomain.NextPartitionable); assertTrue(subDevices.length > 1); for (CLDevice subDevice : subDevices) { @@ -76,7 +95,7 @@ public void testSplitByAffinity() { private void checkParent(CLDevice parent, CLDevice child) { assertSame(device, child.getParent()); // Force a get info CL_DEVICE_PARENT_DEVICE. - assertSame(device, new CLDevice(platform, null, child.getEntity(), false).getParent()); + assertSame(device, new CLDevice(device.getPlatform(), null, child.getEntity(), false).getParent()); } } From bb4505e785d38b603ccc4b36517e10fc16b724a3 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 22:49:35 +0000 Subject: [PATCH 08/34] Drop useless MiscTestUtils --- .../opencl/AbstractCommon.java | 9 +-- .../opencl/BinaryKernelTest.java | 3 +- .../nativelibs4java/opencl/BufferTest.java | 1 - .../opencl/ByteOrderHackTest.java | 1 - .../com/nativelibs4java/opencl/EventTest.java | 1 - .../opencl/InfoGettersTest.java | 44 ++++++++++++- .../nativelibs4java/opencl/KernelTest.java | 2 +- .../opencl/OpenCL4JavaBasicTest.java | 1 - .../opencl/OpenCL4JavaBenchmarkTest.java | 1 - .../nativelibs4java/opencl/OverheadTest.java | 3 +- .../nativelibs4java/test/MiscTestUtils.java | 64 ------------------- 11 files changed, 45 insertions(+), 85 deletions(-) delete mode 100644 Core/src/test/java/com/nativelibs4java/test/MiscTestUtils.java diff --git a/Core/src/test/java/com/nativelibs4java/opencl/AbstractCommon.java b/Core/src/test/java/com/nativelibs4java/opencl/AbstractCommon.java index c2ec33c9..4957d898 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/AbstractCommon.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/AbstractCommon.java @@ -8,7 +8,6 @@ import org.junit.Before; import org.junit.BeforeClass; -import com.nativelibs4java.test.MiscTestUtils; import java.util.ArrayList; import java.util.List; import org.junit.After; @@ -27,12 +26,6 @@ public abstract class AbstractCommon { CLQueue queue; CLDevice device; CLImageFormat[] formatsRead2D, formatsRead3D, formatsWrite2D, formatsWrite3D, formatsReadWrite2D, formatsReadWrite3D; - /* - @BeforeClass - public static void setup() { - MiscTestUtils.protectJNI(); - } - */ static boolean listedPlatforms; @@ -68,4 +61,4 @@ public void cleanup() { platform.release(); } */ -} \ No newline at end of file +} diff --git a/Core/src/test/java/com/nativelibs4java/opencl/BinaryKernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/BinaryKernelTest.java index c67a4265..d8d9a74b 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/BinaryKernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/BinaryKernelTest.java @@ -8,7 +8,6 @@ import org.bridj.Pointer; import static org.bridj.Pointer.*; -import com.nativelibs4java.test.MiscTestUtils; import java.util.List; import org.junit.Ignore; import org.junit.runners.Parameterized; @@ -81,4 +80,4 @@ public void cachingTest() { sp2.setCached(true); // set to false and it works sp2.createKernel("sub"); } -} \ No newline at end of file +} diff --git a/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java b/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java index 47da5a47..09961145 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java @@ -15,7 +15,6 @@ import org.junit.BeforeClass; import org.junit.Test; -import com.nativelibs4java.test.MiscTestUtils; import com.nativelibs4java.util.NIOUtils; import org.bridj.*; import java.nio.ByteOrder; diff --git a/Core/src/test/java/com/nativelibs4java/opencl/ByteOrderHackTest.java b/Core/src/test/java/com/nativelibs4java/opencl/ByteOrderHackTest.java index d356b71f..46cdc3b1 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/ByteOrderHackTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/ByteOrderHackTest.java @@ -8,7 +8,6 @@ import org.bridj.Pointer; import static org.bridj.Pointer.*; -import com.nativelibs4java.test.MiscTestUtils; import java.util.List; import org.junit.runners.Parameterized; diff --git a/Core/src/test/java/com/nativelibs4java/opencl/EventTest.java b/Core/src/test/java/com/nativelibs4java/opencl/EventTest.java index acfe8a20..911ad8e1 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/EventTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/EventTest.java @@ -8,7 +8,6 @@ import org.bridj.Pointer; import static org.bridj.Pointer.*; -import com.nativelibs4java.test.MiscTestUtils; import java.util.List; import org.junit.runners.Parameterized; diff --git a/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java b/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java index 1adff649..5062f9d9 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java @@ -4,7 +4,6 @@ */ package com.nativelibs4java.opencl; -import static com.nativelibs4java.test.MiscTestUtils.testGetters; import static org.junit.Assert.assertFalse; import java.util.logging.Level; @@ -13,8 +12,6 @@ import org.junit.Before; import org.junit.BeforeClass; -import com.nativelibs4java.test.MiscTestUtils; - /** * * @author ochafik @@ -124,4 +121,45 @@ public void CLEventGetters() { public void CLSamplerGetters() { testGetters(createSampler()); } + + public static void testGetters(Object instance) { + if (instance == null) + return; + Logger log = Logger.getLogger(instance.getClass().getName()); + for (Method m : instance.getClass().getDeclaredMethods()) { + if (Modifier.isStatic(m.getModifiers())) + continue; + if (!Modifier.isPublic(m.getModifiers())) + continue; + if (m.getParameterTypes().length != 0) + continue; + + String name = m.getName(); + if (name.contains("ProfilingCommand")) + continue; + + boolean isToString = name.equals("toString"); + if (name.startsWith("get") && name.length() > 3 || + name.startsWith("has") && name.length() > 3 || + name.startsWith("is") && name.length() > 2 || + isToString && !Modifier.isPublic(m.getDeclaringClass().getModifiers())) + { + String msg = "Failed to call " + m; + try { + m.invoke(instance); + } catch (IllegalAccessException ex) { + if (!isToString) + log.log(Level.WARNING, msg, ex); + } catch (InvocationTargetException ex) { + Throwable cause = ex.getCause(); + if (!(cause instanceof UnsupportedOperationException)) { + log.log(Level.SEVERE, msg, ex.getCause()); + assertFalse(msg, true); + } + } catch (Exception ex) { + log.log(Level.SEVERE, msg, ex); + } + } + } + } } diff --git a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java index 5d0c3956..e0baa68a 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java @@ -43,7 +43,7 @@ public Object testArrayArg(String type, Object array, Class targetType) { CLBuffer out = context.createByteBuffer(Usage.Output, size * length); StringBuilder b = new StringBuilder( "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" + - "kernel void f(" + type + length + " arg, global " + type + "* out, long length) {\n"); + "kernel void f(constant " + type + length + " arg, global " + type + "* out, long length) {\n"); for (long i = 0; i < length; i++) { b.append("out[" + i + "] = arg.s" + (i < 10 ? i + "" : ((char)((int)'a' + (i - 10))) + "") + ";\n"); } diff --git a/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBasicTest.java b/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBasicTest.java index 64a13a8d..4af2e925 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBasicTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBasicTest.java @@ -12,7 +12,6 @@ import org.junit.BeforeClass; import org.junit.Test; -import com.nativelibs4java.test.MiscTestUtils; import com.nativelibs4java.util.NIOUtils; public class OpenCL4JavaBasicTest { diff --git a/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBenchmarkTest.java b/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBenchmarkTest.java index 866bef2c..d2ff6ce0 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBenchmarkTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/OpenCL4JavaBenchmarkTest.java @@ -18,7 +18,6 @@ import com.nativelibs4java.opencl.CLTestUtils.Action2; import com.nativelibs4java.opencl.CLTestUtils.ExecResult; -import com.nativelibs4java.test.MiscTestUtils; //import com.nativelibs4java.scalacl.*; /// @see http://ati.amd.com/technology/streamcomputing/intro_opencl.html#simple diff --git a/Core/src/test/java/com/nativelibs4java/opencl/OverheadTest.java b/Core/src/test/java/com/nativelibs4java/opencl/OverheadTest.java index 2d382090..65f1fdf5 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/OverheadTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/OverheadTest.java @@ -13,7 +13,6 @@ import org.bridj.Pointer; import org.bridj.Platform; import static org.bridj.Pointer.*; -import com.nativelibs4java.test.MiscTestUtils; import java.util.logging.Level; import java.util.logging.Logger; @@ -157,4 +156,4 @@ public void run() { assertTrue("CLKernel.setArg was supposed not to be more than " + maxSlower + "x slower than hand-optimized version, was " + slowerSetArg + "x slower.", slowerSetArg <= maxSlower); assertTrue("CLKernel.setArgs was supposed not to be more than " + maxSlower + "x slower than hand-optimized version, was " + slowerSetArgs + "x slower.", slowerSetArgs <= maxSlower); } -} \ No newline at end of file +} diff --git a/Core/src/test/java/com/nativelibs4java/test/MiscTestUtils.java b/Core/src/test/java/com/nativelibs4java/test/MiscTestUtils.java deleted file mode 100644 index 470e7f12..00000000 --- a/Core/src/test/java/com/nativelibs4java/test/MiscTestUtils.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package com.nativelibs4java.test; - -import static org.junit.Assert.assertFalse; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author ochafik - */ -public class MiscTestUtils { - public static void protectJNI() { - //Native.setProtected(true); - } - public static void testGetters(Object instance) { - if (instance == null) - return; - Logger log = Logger.getLogger(instance.getClass().getName()); - for (Method m : instance.getClass().getDeclaredMethods()) { - if (Modifier.isStatic(m.getModifiers())) - continue; - if (!Modifier.isPublic(m.getModifiers())) - continue; - if (m.getParameterTypes().length != 0) - continue; - - String name = m.getName(); - if (name.contains("ProfilingCommand")) - continue; - - boolean isToString = name.equals("toString"); - if (name.startsWith("get") && name.length() > 3 || - name.startsWith("has") && name.length() > 3 || - name.startsWith("is") && name.length() > 2 || - isToString && !Modifier.isPublic(m.getDeclaringClass().getModifiers())) - { - String msg = "Failed to call " + m; - try { - m.invoke(instance); - } catch (IllegalAccessException ex) { - if (!isToString) - log.log(Level.WARNING, msg, ex); - } catch (InvocationTargetException ex) { - Throwable cause = ex.getCause(); - if (!(cause instanceof UnsupportedOperationException)) { - log.log(Level.SEVERE, msg, ex.getCause()); - assertFalse(msg, true); - } - } catch (Exception ex) { - log.log(Level.SEVERE, msg, ex); - } - } - } - } -} From c4b090f6d74f83b10d44c05e117bebfbeebbf84e Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 23:22:15 +0000 Subject: [PATCH 09/34] fix test compilation --- .../test/java/com/nativelibs4java/opencl/InfoGettersTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java b/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java index 5062f9d9..66fc54a8 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/InfoGettersTest.java @@ -6,6 +6,10 @@ import static org.junit.Assert.assertFalse; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + import java.util.logging.Level; import java.util.logging.Logger; From eabf51860186d0113b51860e4fb4dbfb0d829793 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 19 Mar 2015 23:22:33 +0000 Subject: [PATCH 10/34] Added CLDevice.getPartitionAffinityDomains() --- .../com/nativelibs4java/opencl/CLDevice.java | 17 +++++++++++++++++ .../com/nativelibs4java/opencl/DeviceTest.java | 1 + 2 files changed, 18 insertions(+) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 167b993f..f43da9a7 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -745,6 +745,23 @@ public EnumSet getPartitionProperties() { return ret; } + /** + * Returns the set of supported affinity domains for partitioning the device + * using {@link #createSubDevicesByAffinity(AffinityDomain)} + */ + @InfoName("CL_DEVICE_PARTITION_AFFINITY_DOMAIN") + public EnumSet getPartitionAffinityDomains() { + EnumSet ret = EnumSet.noneOf(AffinityDomain.class); + Pointer ptr = infos.getPointer(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN);; + if (ptr != null) { + Pointer props = ptr.as(SizeT.class); + for (long i = 0, n = props.getValidElements(); i < n; i++) { + ret.add(AffinityDomain.getEnum(props.getSizeTAtIndex(i))); + } + } + return ret; + } + @InfoName("CL_DEVICE_PARTITION_MAX_SUB_DEVICES") public int getPartitionMaxSubDevices() { return infos.getInt(getEntity(), CL_DEVICE_PARTITION_MAX_SUB_DEVICES); diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 27ac3d54..22d990b0 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -37,6 +37,7 @@ public DeviceTest(CLDevice device) { System.out.println(device); System.out.println("\tmax sub-devices: " + device.getPartitionMaxSubDevices()); System.out.println("\tpartition properties: " + device.getPartitionProperties()); + System.out.println("\tpartition domains: " + device.getPartitionAffinityDomains()); } @Parameterized.Parameters From dc90deb1a345005a549c5b591863035770273c6a Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 00:54:46 +0000 Subject: [PATCH 11/34] pom fest: update scm + deps --- Core/pom.xml | 4 ++-- JavaCL/pom.xml | 2 +- MavenPlugin/pom.xml | 2 +- Tutorials/DFT/pom.xml | 18 ------------------ pom.xml | 28 ++++++++++++++++++++++++---- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Core/pom.xml b/Core/pom.xml index af80287d..b97fe3b7 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -36,13 +36,13 @@ For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL org.jogamp.gluegen gluegen-rt-main - 2.0.2-rc12 + 2.3.0 test org.jogamp.jogl jogl-all-main - 2.0.2-rc12 + 2.3.0 test diff --git a/JavaCL/pom.xml b/JavaCL/pom.xml index 7a0b7da5..d4e2cb1f 100644 --- a/JavaCL/pom.xml +++ b/JavaCL/pom.xml @@ -72,7 +72,7 @@ For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL org.apache.felix maven-bundle-plugin - 2.3.7 + 2.5.3 true diff --git a/MavenPlugin/pom.xml b/MavenPlugin/pom.xml index 782651c7..ac5ea2ea 100644 --- a/MavenPlugin/pom.xml +++ b/MavenPlugin/pom.xml @@ -26,7 +26,7 @@ org.apache.maven maven-plugin-api - 3.0.3 + 3.3.1 diff --git a/Tutorials/DFT/pom.xml b/Tutorials/DFT/pom.xml index e7c9c6bd..e1bcaef2 100644 --- a/Tutorials/DFT/pom.xml +++ b/Tutorials/DFT/pom.xml @@ -24,10 +24,6 @@ commons-math 2.2 - - org.scala-lang - scala-library - @@ -36,26 +32,12 @@ com.nativelibs4java maven-javacl-plugin - - net.alchim31.maven - scala-maven-plugin - org.apache.maven.plugins maven-shade-plugin - - - - - net.alchim31.maven - scala-maven-plugin - - - - diff --git a/pom.xml b/pom.xml index 5fa32e52..10c35048 100644 --- a/pom.xml +++ b/pom.xml @@ -12,10 +12,30 @@ com.nativelibs4java nativelibs4java-parent - 1.9 - .. + 1.9-SNAPSHOT + ../nativelibs4java/libraries - + + + + junit + junit + 4.12 + test + + + + + 0.7.1-SNAPSHOT + 0.13-SNAPSHOT + + + + scm:git:git@github.com:nativelibs4java/JavaCL.git + scm:git:git@github.com:nativelibs4java/JavaCL.git + http://github.com/nativelibs4java/JavaCL + + LibCL InteractiveImageDemo @@ -109,7 +129,7 @@ com.nativelibs4java jnaerator - ${jnaerator.version} + ${jnaerator.version} From caeb6077c3ce8cbef27d5c3d93c8fcaddc6275cd Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 01:03:47 +0000 Subject: [PATCH 12/34] Added CLDevice.getPartitionType() --- .../com/nativelibs4java/opencl/CLDevice.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index f43da9a7..41073115 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -734,12 +734,25 @@ public static PartitionType getEnum(long v) { @InfoName("CL_DEVICE_PARTITION_PROPERTIES") public EnumSet getPartitionProperties() { + return getPartitionTypeInfo(CL_DEVICE_PARTITION_PROPERTIES); + } + + @InfoName("CL_DEVICE_PARTITION_TYPE") + public EnumSet getPartitionType() { + return getPartitionTypeInfo(CL_DEVICE_PARTITION_TYPE); + } + + private EnumSet getPartitionTypeInfo(int info) { EnumSet ret = EnumSet.noneOf(PartitionType.class); - Pointer ptr = infos.getPointer(getEntity(), CL_DEVICE_PARTITION_PROPERTIES);; + Pointer ptr = infos.getPointer(getEntity(), info); if (ptr != null) { Pointer props = ptr.as(SizeT.class); for (long i = 0, n = props.getValidElements(); i < n; i++) { - ret.add(PartitionType.getEnum(props.getSizeTAtIndex(i))); + long value = props.getSizeTAtIndex(i); + if (value == 0) { + break; + } + ret.add(PartitionType.getEnum(value)); } } return ret; @@ -756,7 +769,11 @@ public EnumSet getPartitionAffinityDomains() { if (ptr != null) { Pointer props = ptr.as(SizeT.class); for (long i = 0, n = props.getValidElements(); i < n; i++) { - ret.add(AffinityDomain.getEnum(props.getSizeTAtIndex(i))); + long value = props.getSizeTAtIndex(i); + if (value == 0) { + break; + } + ret.add(AffinityDomain.getEnum(value)); } } return ret; From 49e2ee351e448419321ee432010b48cb27fe151b Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 01:07:04 +0000 Subject: [PATCH 13/34] Revert to jogl 2.0.2-rc12 for now (latest = 2.3.0) --- Core/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/pom.xml b/Core/pom.xml index b97fe3b7..af80287d 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -36,13 +36,13 @@ For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL org.jogamp.gluegen gluegen-rt-main - 2.3.0 + 2.0.2-rc12 test org.jogamp.jogl jogl-all-main - 2.3.0 + 2.0.2-rc12 test From 5bcfdac78b52c7fb2bcc10d3309cf5bd39ace706 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 01:14:36 +0000 Subject: [PATCH 14/34] fix previous typo (infos.getPointer instead of infos.getMemory) that doesn't show up with macbook air fission-averse devices --- .../main/velocity/com/nativelibs4java/opencl/CLDevice.java | 4 ++-- Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 41073115..256b9030 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -744,7 +744,7 @@ public EnumSet getPartitionType() { private EnumSet getPartitionTypeInfo(int info) { EnumSet ret = EnumSet.noneOf(PartitionType.class); - Pointer ptr = infos.getPointer(getEntity(), info); + Pointer ptr = infos.getMemory(getEntity(), info); if (ptr != null) { Pointer props = ptr.as(SizeT.class); for (long i = 0, n = props.getValidElements(); i < n; i++) { @@ -765,7 +765,7 @@ private EnumSet getPartitionTypeInfo(int info) { @InfoName("CL_DEVICE_PARTITION_AFFINITY_DOMAIN") public EnumSet getPartitionAffinityDomains() { EnumSet ret = EnumSet.noneOf(AffinityDomain.class); - Pointer ptr = infos.getPointer(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN);; + Pointer ptr = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN); if (ptr != null) { Pointer props = ptr.as(SizeT.class); for (long i = 0, n = props.getValidElements(); i < n; i++) { diff --git a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java index e0baa68a..5d0c3956 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java @@ -43,7 +43,7 @@ public Object testArrayArg(String type, Object array, Class targetType) { CLBuffer out = context.createByteBuffer(Usage.Output, size * length); StringBuilder b = new StringBuilder( "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" + - "kernel void f(constant " + type + length + " arg, global " + type + "* out, long length) {\n"); + "kernel void f(" + type + length + " arg, global " + type + "* out, long length) {\n"); for (long i = 0; i < length; i++) { b.append("out[" + i + "] = arg.s" + (i < 10 ? i + "" : ((char)((int)'a' + (i - 10))) + "") + ";\n"); } From 30ab47f3c7d12ac5c9dbbf13da3a0106513f2549 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 01:28:19 +0000 Subject: [PATCH 15/34] fix parent pom version --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 10c35048..6fb27d47 100644 --- a/pom.xml +++ b/pom.xml @@ -12,8 +12,7 @@ com.nativelibs4java nativelibs4java-parent - 1.9-SNAPSHOT - ../nativelibs4java/libraries + 1.10-SNAPSHOT From 3cedcfcb3412f0d718e83c16dc26cd66cf343b84 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 10:22:21 +0000 Subject: [PATCH 16/34] CL_DEVICE_PARTITION_AFFINITY_DOMAIN is a bit field, not a properties list --- .../com/nativelibs4java/opencl/CLDevice.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 256b9030..1ad41a13 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -764,19 +764,7 @@ private EnumSet getPartitionTypeInfo(int info) { */ @InfoName("CL_DEVICE_PARTITION_AFFINITY_DOMAIN") public EnumSet getPartitionAffinityDomains() { - EnumSet ret = EnumSet.noneOf(AffinityDomain.class); - Pointer ptr = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN); - if (ptr != null) { - Pointer props = ptr.as(SizeT.class); - for (long i = 0, n = props.getValidElements(); i < n; i++) { - long value = props.getSizeTAtIndex(i); - if (value == 0) { - break; - } - ret.add(AffinityDomain.getEnum(value)); - } - } - return ret; + return AffinityDomain.getEnumSet(infos.getIntOrLong(getEntity(), CL_DEVICE_PARTITION_AFFINITY_DOMAIN)); } @InfoName("CL_DEVICE_PARTITION_MAX_SUB_DEVICES") @@ -1169,6 +1157,9 @@ public enum AffinityDomain implements com.nativelibs4java.util.ValuedEnum { public static AffinityDomain getEnum(long v) { return EnumValues.getEnum(v, AffinityDomain.class); } + public static EnumSet getEnumSet(long v) { + return EnumValues.getEnumSet(v, AffinityDomain.class); + } } /** From 24ac74c0ac5c57c3f703b35d6f287c14cd510501 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 10:37:06 +0000 Subject: [PATCH 17/34] fix DeviceTest.checkParent --- Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 22d990b0..6011c00e 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -94,9 +94,9 @@ public void testSplitByAffinity() { } private void checkParent(CLDevice parent, CLDevice child) { - assertSame(device, child.getParent()); + assertSame(parent, child.getParent()); // Force a get info CL_DEVICE_PARENT_DEVICE. - assertSame(device, new CLDevice(device.getPlatform(), null, child.getEntity(), false).getParent()); + assertEquals(parent, new CLDevice(device.getPlatform(), null, child.getEntity(), false).getParent()); } } From f9b1e5ed22c3d54884745d7b1c4f083d1cf0b4a8 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 10:41:41 +0000 Subject: [PATCH 18/34] Sort counts of split-by-count subdivides in DeviceTest --- .../test/java/com/nativelibs4java/opencl/DeviceTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 6011c00e..52a02a0d 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -74,12 +74,14 @@ public void testSplitByCounts() { CLDevice[] subDevices = device.createSubDevicesByCounts(counts); assertEquals(counts.length, subDevices.length); int i = 0; + long[] actualCounts = new long[counts.length]; for (CLDevice subDevice : subDevices) { - long count = counts[i]; - assertEquals(count, subDevice.getMaxComputeUnits()); + actualCounts[i] = subDevice.getMaxComputeUnits(); checkParent(device, subDevice); i++; } + Arrays.sort(actualCounts); + assertArrayEquals(counts, actualCounts); } @Test From 56cf9586dd8666b0b81aed21faa50585a65e07ab Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 20 Mar 2015 10:55:42 +0000 Subject: [PATCH 19/34] avoid nope in CLDevice.getPartitionAffinityDomain() --- .../velocity/com/nativelibs4java/opencl/CLDevice.java | 2 +- .../java/com/nativelibs4java/opencl/DeviceTest.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 1ad41a13..2e8d06ce 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -790,7 +790,7 @@ public long getReferenceCount() { */ public AffinityDomain getPartitionAffinityDomain() { Pointer memory = infos.getMemory(getEntity(), CL_DEVICE_PARTITION_TYPE); - long type = memory.getSizeT(); + long type = memory == null ? 0 : memory.getSizeT(); if (type != CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) { return null; } diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 52a02a0d..0e568446 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -88,10 +88,13 @@ public void testSplitByCounts() { public void testSplitByAffinity() { if (!device.getPartitionProperties().contains(CLDevice.PartitionType.ByAffinityDomain)) return; - CLDevice[] subDevices = device.createSubDevicesByAffinity(CLDevice.AffinityDomain.NextPartitionable); - assertTrue(subDevices.length > 1); - for (CLDevice subDevice : subDevices) { - checkParent(device, subDevice); + for (CLDevice.AffinityDomain domain : device.getPartitionAffinityDomains()) { + CLDevice[] subDevices = device.createSubDevicesByAffinity(domain); + assertTrue(subDevices.length > 1); + for (CLDevice subDevice : subDevices) { + checkParent(device, subDevice); + assertEquals(domain, subDevice.getPartitionAffinityDomain()); + } } } From c12410aa006d27620267005df08f7b8a54690798 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sat, 21 Mar 2015 10:12:21 +0000 Subject: [PATCH 20/34] Add arg size to kernel arg exceptions --- .../com/nativelibs4java/opencl/CLException.java | 14 +++++++++++--- .../com/nativelibs4java/opencl/CLKernel.java | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java index 39d68ea7..a5920da0 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java @@ -1,14 +1,19 @@ #parse("main/Header.vm") package com.nativelibs4java.opencl; + +import static com.nativelibs4java.opencl.JavaCL.log; import static com.nativelibs4java.opencl.library.OpenCLLibrary.*; import static com.nativelibs4java.opencl.library.IOpenCLLibrary.*; + import com.nativelibs4java.opencl.library.OpenCLLibrary; import com.ochafik.util.string.StringUtils; + +import org.bridj.*; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.*; import java.lang.reflect.*; -import static com.nativelibs4java.opencl.JavaCL.log; import java.util.logging.Level; import java.util.logging.Logger; @@ -52,8 +57,11 @@ public String getMessage() { return message + logSuffix; } - void setKernelArg(CLKernel kernel, int argIndex) { - message += " (kernel name = " + kernel.getFunctionName() + ", num args = " + kernel.getNumArgs() + ", arg index = " + argIndex; + void setKernelArg(CLKernel kernel, int argIndex, long size, Pointer ptr) { + message += " (kernel name = " + kernel.getFunctionName(); + message += ", num args = " + kernel.getNumArgs(); + message += ", arg index = " + argIndex; + message += ", arg size = " + size; CLProgram program = kernel.getProgram(); if (program != null) message += ", source = <<<\n\t" + program.getSource().replaceAll("\n", "\n\t"); diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java index cfc14f61..7515e22e 100755 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java @@ -219,7 +219,7 @@ private void setKernelArg(int i, long size, Pointer ptr) { try { error(CL.clSetKernelArg(getEntity(), i, size, getPeer(ptr))); } catch (CLTypedException ex) { - ex.setKernelArg(this, i); + ex.setKernelArg(this, i, size, ptr); throw ex; } } From 4886021f4da65f77d4d66be713722cfbfed708c9 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sat, 21 Mar 2015 10:13:09 +0000 Subject: [PATCH 21/34] Make JAVACL_LOG_CALLS logs warnings to force them out --- Core/src/main/velocity/com/nativelibs4java/opencl/JavaCL.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/JavaCL.java b/Core/src/main/velocity/com/nativelibs4java/opencl/JavaCL.java index 5b5aa07f..e993179b 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/JavaCL.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/JavaCL.java @@ -219,9 +219,9 @@ else if (Platform.isMacOSX()) private static IOpenCLLibrary wrapWithLogs(final IOpenCLLibrary cl) { return (IOpenCLLibrary) Proxy.newProxyInstance(JavaCL.class.getClassLoader(), new Class[] { IOpenCLLibrary.class }, new InvocationHandler() { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - log(Level.INFO, method.getName() + "(" + StringUtils.implode(args, ", ") + ")"); + log(Level.WARNING, method.getName() + "(" + StringUtils.implode(args, ", ") + ")"); Object ret = method.invoke(cl, args); - log(Level.INFO, "\t" + method.getName() + " -> " + ret); + log(Level.WARNING, "\t" + method.getName() + " -> " + ret); return ret; } }); From b03fda575b4fa71fd2c6f7dfaa1c1897fb7f00d6 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 17:27:58 +0000 Subject: [PATCH 22/34] nit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 298252a8..ed4ddc74 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ It was previously hosted on [ochafik/nativelibs4java](http://github.com/ochafik/ * [Credits and License](http://code.google.com/p/bridj/wiki/CreditsAndLicense) # Building + ``` git clone http://github.com/nativelibs4java/JavaCL.git mvn clean install From 57bdb954a8dc3cfc09b8f15f76da31d9cb406914 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 17:57:12 +0000 Subject: [PATCH 23/34] Attempt to mitigate travis ci's mysterious "cannot find symbol: class Retention" errors --- .../com/nativelibs4java/opencl/CLException.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java index a5920da0..4c4c53a8 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java @@ -32,11 +32,6 @@ public int getCode() { return code; } - @Retention(RetentionPolicy.RUNTIME) - public @interface ErrorCode { - int value(); - } - public static class CLVersionException extends CLException { public CLVersionException(String message) { super(message, 0); @@ -272,3 +267,8 @@ public static void error(int err) { throw toThrow; } } + +@Retention(RetentionPolicy.RUNTIME) +@interface ErrorCode { + int value(); +} From f5b99639ffa200c8a0c930e4d8ab79d238f0119a Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 18:32:29 +0000 Subject: [PATCH 24/34] travis ci: retention is driving me crazy --- .../com/nativelibs4java/opencl/CLException.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java index 4c4c53a8..44dcf91f 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLException.java @@ -10,8 +10,6 @@ import org.bridj.*; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; import java.util.*; import java.lang.reflect.*; import java.util.logging.Level; @@ -32,6 +30,11 @@ public int getCode() { return code; } + @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) + @interface ErrorCode { + int value(); + } + public static class CLVersionException extends CLException { public CLVersionException(String message) { super(message, 0); @@ -268,7 +271,3 @@ public static void error(int err) { } } -@Retention(RetentionPolicy.RUNTIME) -@interface ErrorCode { - int value(); -} From 95281fbb84eb2651fb94a4e61c930b2d2a06c4ee Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 20:14:13 +0000 Subject: [PATCH 25/34] Fix BufferTest expectation that buffer is nulled out (not true with AMD driver) --- .../com/nativelibs4java/opencl/CLBuffer.java | 7 ++++--- .../nativelibs4java/opencl/BufferTest.java | 21 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLBuffer.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLBuffer.java index a7fdd43d..d30051f7 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLBuffer.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLBuffer.java @@ -569,10 +569,11 @@ public CLEvent copyBytesTo(CLQueue queue, CLBuffer destination, long sourceByteO #documentEventsToWaitForAndReturn() */ public CLEvent copyElementsTo(CLQueue queue, CLBuffer destination, long sourceElementOffset, long destinationElementOffset, long elementCount, CLEvent... eventsToWaitFor) { + long elementSize = getElementSize(); return copyBytesTo(queue, destination, - sourceElementOffset * getElementSize(), - destinationElementOffset * getElementSize(), - elementCount * getElementSize(), + sourceElementOffset * elementSize, + destinationElementOffset * elementSize, + elementCount * elementSize, eventsToWaitFor); } diff --git a/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java b/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java index 09961145..79337db1 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/BufferTest.java @@ -166,14 +166,19 @@ public void testFill() { } catch (Throwable th) {} } @Test - public void testCopyTo() { - CLBuffer b = context.createIntBuffer(CLMem.Usage.InputOutput, pointerToInts(1, 2, 3, 4)); - CLBuffer out = context.createIntBuffer(CLMem.Usage.InputOutput, 4); - CLEvent e = b.copyElementsTo(queue, out, 2, 1, 2); - assertArrayEquals(new int[] { 0, 3, 4, 0 }, out.read(queue, e).getInts()); - - e = b.copyTo(queue, out); - assertArrayEquals(new int[] { 1, 2, 3, 4 }, out.read(queue, e).getInts()); + public void testCopyTo_full() { + CLBuffer b = context.createIntBuffer(CLMem.Usage.InputOutput, pointerToInts(1, 2, 3, 4, 5, 6)); + CLBuffer out = context.createIntBuffer(CLMem.Usage.InputOutput, 6); + + CLEvent e = b.copyTo(queue, out); + assertArrayEquals(new int[] { 1, 2, 3, 4, 5, 6 }, out.read(queue, e).getInts()); } + @Test + public void testCopyTo_partial() { + CLBuffer b = context.createIntBuffer(CLMem.Usage.InputOutput, pointerToInts(1, 2, 3, 4, 5, 6)); + CLBuffer out = context.createIntBuffer(CLMem.Usage.InputOutput, 6); + CLEvent e = b.copyElementsTo(queue, out, 2, 1, 2); + assertArrayEquals(new int[] { 3, 4 }, out.read(queue, e).next().validElements(2).getInts()); + } } From efaa6148a61b9aa2b8bc1d25951b3232c7e7dc94 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 22:38:52 +0000 Subject: [PATCH 26/34] Generalize CLKernel.setArg (velocity voodoo) + fix size of vector types of arity 3 (must be treated as size 4 as per section 6.1.5 of spec) --- .../com/nativelibs4java/opencl/CLKernel.java | 70 +++++++------------ .../opencl/ReusablePointer.java | 12 +++- .../nativelibs4java/opencl/KernelTest.java | 2 +- 3 files changed, 36 insertions(+), 48 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java index 7515e22e..81fe07ba 100755 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLKernel.java @@ -231,55 +231,37 @@ public void setArg(int i, Pointer ptr) { setKernelArg(i, ptr.getValidBytes(), ptr); } +#foreach ($prim in $primitives) /** + * Sets a vector type value as the arg at index {@code i}. + * + * For instance to pass a {@code ${prim.Name}3}, one must pass a {@code ${prim.Name}[]} of size {@code 3}. + * #documentCallsFunction("clSetKernelArg") + * @param i index of the argument in the kernel's parameters list + * @param arg array of ${prim.Name}s (of length 2, 3, 4, 8 or 16, which must match the arity of the OpenCL vector type used by the kernel). */ - public void setArg(int i, float[] arg) { - setKernelArg(i, arg.length * 4, arg.length <= MAX_TMP_ITEMS ? localPointer.setFloats(arg) : pointerToFloats(arg)); + public void setArg(int i, ${prim.Name}[] arg) { + int length = normalizeVectorTypeArity(arg.length); + setKernelArg(i, length * ${prim.Size}, length <= MAX_TMP_ITEMS ? localPointer.set${prim.CapName}s(arg) : pointerTo${prim.CapName}s(arg)); } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, int[] arg) { - setKernelArg(i, arg.length * 4, arg.length <= MAX_TMP_ITEMS ? localPointer.setInts(arg) : pointerToInts(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, double[] arg) { - setKernelArg(i, arg.length * 8, arg.length <= MAX_TMP_ITEMS ? localPointer.setDoubles(arg) : pointerToDoubles(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, long[] arg) { - setKernelArg(i, arg.length * 8, arg.length <= MAX_TMP_ITEMS ? localPointer.setLongs(arg) : pointerToLongs(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, short[] arg) { - setKernelArg(i, arg.length * 2, arg.length <= MAX_TMP_ITEMS ? localPointer.setShorts(arg) : pointerToShorts(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, byte[] arg) { - setKernelArg(i, arg.length, arg.length <= MAX_TMP_ITEMS ? localPointer.setBytes(arg) : pointerToBytes(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, boolean[] arg) { - setKernelArg(i, arg.length, arg.length <= MAX_TMP_ITEMS ? localPointer.setBooleans(arg) : pointerToBooleans(arg)); - } - /** -#documentCallsFunction("clSetKernelArg") - */ - public void setArg(int i, char[] arg) { - setKernelArg(i, arg.length * 2, arg.length <= MAX_TMP_ITEMS ? localPointer.setChars(arg) : pointerToChars(arg)); +#end + + private static int normalizeVectorTypeArity(int length) { + switch (length) { + case 3: + // cl_3 is identical in size, alignment and behavior to cl_4. See section 6.1.5 + return 4; + case 2: + case 4: + case 8: + case 16: + return length; + default: + throw new IllegalArgumentException("Invalid vector type length: " + length + " (valid vector type sizes are 2, 3, 4, 8, 16)"); + } } - + /** #documentCallsFunction("clSetKernelArg") */ diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java b/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java index 86be0874..db4d8840 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java @@ -12,8 +12,14 @@ final class ReusablePointer { public ReusablePointer(long bytesCapacity) { this.bytesCapacity = bytesCapacity; - this.pointer = Pointer.allocateBytes(bytesCapacity).withoutValidityInformation(); + this.pointer = allocateAlignedBytes(bytesCapacity).withoutValidityInformation(); } + + static Pointer allocateAlignedBytes(int count) { + // Allocate memory aligned to 128 bytes to match alignment of cl_double16. + return Pointer.allocateAlignedBytes(null /* io */, count, 128 /* alignment */, null /* beforeDeallocation */); + } + public Pointer pointerToInts(int... values) { if (values == null) return null; @@ -48,7 +54,7 @@ public Pointer allocatedBytes(int needed) { if (needed == 0) return null; if (needed > bytesCapacity) { - return (Pointer)Pointer.allocateBytes(needed); + return (Pointer)allocateAlignedBytes(needed); } else { return (Pointer)pointer; } @@ -59,4 +65,4 @@ public Pointer allocatedSizeTs(int needed) { public Pointer allocatedInts(int needed) { return allocatedBytes(needed * 4); } -} \ No newline at end of file +} diff --git a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java index 5d0c3956..28895bb0 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java @@ -56,7 +56,7 @@ public Object testArrayArg(String type, Object array, Class targetType) { @Test public void nullArg() { - assertArrayEquals(new Pointer[] { null }, testArg("int", CLKernel.NULL_POINTER_KERNEL_ARGUMENT, Pointer.class).getPointers()); + assertArrayEquals(new Pointer[] { null }, testArg("int*", CLKernel.NULL_POINTER_KERNEL_ARGUMENT, Pointer.class).getPointers()); } byte[] byteTup(int n) { From 0942d2400c37ea2912b88104eaa97c7934a8ae2a Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 22:44:52 +0000 Subject: [PATCH 27/34] Fix KernelTest.nullArg --- .../com/nativelibs4java/opencl/KernelTest.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java index 28895bb0..ea48a02d 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java @@ -54,9 +54,25 @@ public Object testArrayArg(String type, Object array, Class targetType) { return out.as(targetType).read(queue, e).getArray(); } + + public Pointer testNullableArg(Object value) { + + } + @Test public void nullArg() { - assertArrayEquals(new Pointer[] { null }, testArg("int*", CLKernel.NULL_POINTER_KERNEL_ARGUMENT, Pointer.class).getPointers()); + CLBuffer out = context.createByteBuffer(Usage.InputOutput, 2) ; + CLKernel isInputNull = context.createProgram( + "kernel void isInputNull(global int* in, global bool* out) {\n" + + "*out = !in;\n" + + "}" + ).createKernel("isInputNull"); + + isInputNull.setArgs(CLKernel.NULL_POINTER_KERNEL_ARGUMENT, out); + assertTrue(out.read(queue, isInputNull.enqueueTask(queue)).as(Boolean.class).get()); + + isInputNull.setArgs(out, out); + assertFalse(out.read(queue, isInputNull.enqueueTask(queue)).as(Boolean.class).get()); } byte[] byteTup(int n) { From bd52e825fb701dbc0412ad5b9d5a6d8816b19af4 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 22:52:36 +0000 Subject: [PATCH 28/34] typo in reusablepointer --- .travis.yml | 4 ++++ .../velocity/com/nativelibs4java/opencl/ReusablePointer.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 17f9fe90..d8bf3b6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ jdk: - oraclejdk8 - openjdk6 +cache: + directories: + - $HOME/.m2 + env: - MAVEN_OPTS=-Xmx512m CL_LOG_ERRORS=stdout diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java b/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java index db4d8840..3b5c2a7c 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/ReusablePointer.java @@ -15,7 +15,7 @@ public ReusablePointer(long bytesCapacity) { this.pointer = allocateAlignedBytes(bytesCapacity).withoutValidityInformation(); } - static Pointer allocateAlignedBytes(int count) { + static Pointer allocateAlignedBytes(long count) { // Allocate memory aligned to 128 bytes to match alignment of cl_double16. return Pointer.allocateAlignedBytes(null /* io */, count, 128 /* alignment */, null /* beforeDeallocation */); } From 76c864b954e32ec1e42cf97e96f3afd1e3366c83 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 22:57:16 +0000 Subject: [PATCH 29/34] typo in test --- .../src/test/java/com/nativelibs4java/opencl/KernelTest.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java index ea48a02d..af3c8064 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/KernelTest.java @@ -54,11 +54,6 @@ public Object testArrayArg(String type, Object array, Class targetType) { return out.as(targetType).read(queue, e).getArray(); } - - public Pointer testNullableArg(Object value) { - - } - @Test public void nullArg() { CLBuffer out = context.createByteBuffer(Usage.InputOutput, 2) ; From 42ec70c7051a8d2553aecaff71f7f849d40d4e23 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 23:27:44 +0000 Subject: [PATCH 30/34] Split device-splitting tests --- .../com/nativelibs4java/opencl/CLDevice.java | 2 +- .../nativelibs4java/opencl/DeviceTest.java | 51 +++++++++++++++---- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java index 2e8d06ce..b30b9b47 100644 --- a/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java +++ b/Core/src/main/velocity/com/nativelibs4java/opencl/CLDevice.java @@ -1202,7 +1202,7 @@ public CLDevice[] createSubDevicesByCounts(long... computeUnitsForEachSubDevice) */ public CLDevice[] createSubDevicesByAffinity(AffinityDomain affinityDomain) { return createSubDevices(pointerToSizeTs( - CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN, affinityDomain.value(), 0, 0 + CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN, affinityDomain.value(), 0 )); } diff --git a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java index 0e568446..fe2b8518 100644 --- a/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java +++ b/Core/src/test/java/com/nativelibs4java/opencl/DeviceTest.java @@ -84,20 +84,49 @@ public void testSplitByCounts() { assertArrayEquals(counts, actualCounts); } - @Test - public void testSplitByAffinity() { - if (!device.getPartitionProperties().contains(CLDevice.PartitionType.ByAffinityDomain)) return; - - for (CLDevice.AffinityDomain domain : device.getPartitionAffinityDomains()) { - CLDevice[] subDevices = device.createSubDevicesByAffinity(domain); - assertTrue(subDevices.length > 1); - for (CLDevice subDevice : subDevices) { - checkParent(device, subDevice); - assertEquals(domain, subDevice.getPartitionAffinityDomain()); - } + public void checkSplitByAffinity(CLDevice.AffinityDomain domain) { + if (!device.getPartitionProperties().contains(CLDevice.PartitionType.ByAffinityDomain)) { + System.out.println("Split by affinity is not supported by device " + device); + return; + } + if (!device.getPartitionAffinityDomains().contains(domain)) { + System.out.println("Affinity domain " + domain + " not supported by device " + device); + return; + } + + CLDevice[] subDevices = device.createSubDevicesByAffinity(domain); + assertTrue(subDevices.length > 1); + for (CLDevice subDevice : subDevices) { + checkParent(device, subDevice); + assertEquals(domain, subDevice.getPartitionAffinityDomain()); } } + @Test + public void testSplitByAffinity_NUMA() { + checkSplitByAffinity(CLDevice.AffinityDomain.NUMA); + } + @Test + public void testSplitByAffinity_L4Cache() { + checkSplitByAffinity(CLDevice.AffinityDomain.L4Cache); + } + @Test + public void testSplitByAffinity_L3Cache() { + checkSplitByAffinity(CLDevice.AffinityDomain.L3Cache); + } + @Test + public void testSplitByAffinity_L2Cache() { + checkSplitByAffinity(CLDevice.AffinityDomain.L2Cache); + } + @Test + public void testSplitByAffinity_L1Cache() { + checkSplitByAffinity(CLDevice.AffinityDomain.L1Cache); + } + @Test + public void testSplitByAffinity_NextPartitionable() { + checkSplitByAffinity(CLDevice.AffinityDomain.NextPartitionable); + } + private void checkParent(CLDevice parent, CLDevice child) { assertSame(parent, child.getParent()); // Force a get info CL_DEVICE_PARENT_DEVICE. From 4c71ca8e11874e81111b5c15f66140ed19870166 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sun, 22 Mar 2015 23:51:59 +0000 Subject: [PATCH 31/34] Add repo to pom (newly separated from parent) --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index 6fb27d47..3954c537 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,22 @@ 1.10-SNAPSHOT + + + sonatype + Sonatype OSS Snapshots Repository + http://oss.sonatype.org/content/groups/public + + + + + + sonatype + Sonatype OSS Snapshots Repository + http://oss.sonatype.org/content/groups/public + + + junit From 6bb908af79e1f84f7922e0d450ee91d1411bed05 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Sat, 28 Mar 2015 11:11:34 +0000 Subject: [PATCH 32/34] Use jalico --- .../com/nativelibs4java/opencl/generator/JavaCLGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Generator/src/main/java/com/nativelibs4java/opencl/generator/JavaCLGenerator.java b/Generator/src/main/java/com/nativelibs4java/opencl/generator/JavaCLGenerator.java index 9c50fba9..89fcd1d7 100644 --- a/Generator/src/main/java/com/nativelibs4java/opencl/generator/JavaCLGenerator.java +++ b/Generator/src/main/java/com/nativelibs4java/opencl/generator/JavaCLGenerator.java @@ -8,8 +8,8 @@ import com.ochafik.lang.jnaerator.UnsupportedConversionException; import com.ochafik.lang.jnaerator.parser.*; import com.ochafik.lang.jnaerator.runtime.NativeSize; -import com.ochafik.util.listenable.Adapter; -import com.ochafik.util.listenable.Pair; +import com.nativelibs4java.jalico.Adapter; +import com.nativelibs4java.jalico.Pair; import com.ochafik.util.string.RegexUtils; import com.ochafik.util.string.StringUtils; import java.io.File; From a75465d44c548382c228451d86691b25d9f6d9c9 Mon Sep 17 00:00:00 2001 From: Nikolay Gorylenko Date: Wed, 26 Aug 2015 21:45:06 +0200 Subject: [PATCH 33/34] fix website link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed4ddc74..3c1f64ee 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [JavaCL](http://javacl.googlecode.com) provides OpenCL bindings for Java. It wraps low-level bindings in a clean object-oriented API, which adds a few goodies. -A comprehensive documentation is available on its [WebSite](javacl.googlecode.com) and [Wiki](https://code.google.com/p/javacl/wiki/FAQ?tm=6). +A comprehensive documentation is available on its [WebSite](http://javacl.googlecode.com) and [Wiki](https://code.google.com/p/javacl/wiki/FAQ?tm=6). It was previously hosted on [ochafik/nativelibs4java](http://github.com/ochafik/nativelibs4java). From 2a07936f475052ab97f06d638f4af33a8dfa4b62 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Thu, 10 Nov 2022 02:27:43 +0000 Subject: [PATCH 34/34] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3c1f64ee..ff2fa27c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +__BEWARE__: _This project hasn't been maintained in many years. An effort to refresh the BridJ / JNAerator / JavaCL stack is in progress (Nov 2022), with no guarantees_. + [![Maven Central](https://img.shields.io/maven-central/v/com.nativelibs4java/javacl.svg)]() [![Build Status](https://travis-ci.org/nativelibs4java/JavaCL.svg?branch=feature_travis-build)](https://travis-ci.org/nativelibs4java/JavaCL) [![Join the chat at https://gitter.im/nativelibs4java/JavaCL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nativelibs4java/JavaCL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [JavaCL](http://javacl.googlecode.com) provides OpenCL bindings for Java. It wraps low-level bindings in a clean object-oriented API, which adds a few goodies.