Skip to content

Commit 9b0cfab

Browse files
committed
Fix all javadoc errors + some of the warnings
1 parent 827f82d commit 9b0cfab

19 files changed

+391
-244
lines changed

Core/src/main/Header.vm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
#end
114114

115115
#macro (documentCallsFunction $functionName)
116-
* Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/${functionName}.html">$functionName</a>.<br>
116+
* Calls <a href="http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/${functionName}.html">$functionName</a>.<br>
117+
#end
118+
119+
#macro (documentQueue)
120+
* @param queue Execution queue for this operation.
117121
#end
118122

Core/src/main/velocity/com/nativelibs4java/opencl/CLAbstractEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ static <T> Pointer<T> copyNonNullEntities(CLAbstractEntity[] entities, int[] cou
5656
}
5757

5858
/**
59-
* Manual release of the OpenCL resources represented by this object.<br/>
60-
* Note that resources are automatically released by the garbage collector, so in general there's no need to call this method.<br/>
61-
* In an environment with fast allocation/deallocation of large objects, it might be safer to call release() manually, though.<br/>
59+
* Manual release of the OpenCL resources represented by this object.<br>
60+
* Note that resources are automatically released by the garbage collector, so in general there's no need to call this method.<br>
61+
* In an environment with fast allocation/deallocation of large objects, it might be safer to call release() manually, though.<br>
6262
* Note that release() does not necessarily free the object immediately : OpenCL maintains a reference count for all its objects, and an object released on the Java side might still be pointed to by running kernels or queued operations.
6363
*/
6464
public synchronized void release() {

Core/src/main/velocity/com/nativelibs4java/opencl/CLBuffer.java

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#parse("main/Header.vm")
2+
3+
#macro (documentMapFlags)
4+
* @param flags Map flags.
5+
#end
6+
27
package com.nativelibs4java.opencl;
38
import com.nativelibs4java.util.Pair;
49
import static com.nativelibs4java.opencl.CLException.error;
@@ -23,9 +28,9 @@
2328

2429

2530
/**
26-
* OpenCL Memory Buffer Object.<br/>
27-
* A buffer object stores a one-dimensional collection of elements.<br/>
28-
* Elements of a buffer object can be a scalar data type (such as an int, float), vector data type, or a user-defined structure.<br/>
31+
* OpenCL Memory Buffer Object.<br>
32+
* A buffer object stores a one-dimensional collection of elements.<br>
33+
* Elements of a buffer object can be a scalar data type (such as an int, float), vector data type, or a user-defined structure.<br>
2934
* @see CLContext
3035
* @author Olivier Chafik
3136
*/
@@ -50,33 +55,49 @@ public long getElementCount() {
5055
}
5156
/**
5257
#documentCallsFunction("clEnqueueMapBuffer")
58+
#documentQueue()
59+
#documentMapFlags()
60+
#documentEventsToWaitForAndReturn()
5361
*/
5462
public Pointer<T> map(CLQueue queue, MapFlags flags, CLEvent... eventsToWaitFor) throws CLException.MapFailure {
5563
return map(queue, flags, 0, getElementCount(), true, eventsToWaitFor).getFirst();
5664
}
5765
/**
5866
#documentCallsFunction("clEnqueueMapBuffer")
67+
#documentQueue()
68+
#documentMapFlags()
69+
* @param offset offset in the {@link CLBuffer}
70+
* @param length length to write (in bytes)
71+
#documentEventsToWaitForAndReturn()
5972
*/
6073
public Pointer<T> map(CLQueue queue, MapFlags flags, long offset, long length, CLEvent... eventsToWaitFor) throws CLException.MapFailure {
6174
return map(queue, flags, offset, length, true, eventsToWaitFor).getFirst();
6275
}
6376

6477
/**
6578
#documentCallsFunction("clEnqueueMapBuffer")
79+
#documentQueue()
80+
#documentMapFlags()
81+
#documentEventsToWaitForAndReturn()
6682
*/
6783
public Pair<Pointer<T>, CLEvent> mapLater(CLQueue queue, MapFlags flags, CLEvent... eventsToWaitFor) throws CLException.MapFailure {
6884
return map(queue, flags, 0, getElementCount(), false, eventsToWaitFor);
6985
}
7086
/**
7187
#documentCallsFunction("clEnqueueMapBuffer")
88+
#documentQueue()
89+
#documentMapFlags()
90+
* @param offset offset in the {@link CLBuffer}
91+
* @param length length to write (in bytes)
92+
#documentEventsToWaitForAndReturn()
7293
*/
7394
public Pair<Pointer<T>, CLEvent> mapLater(CLQueue queue, MapFlags flags, long offset, long length, CLEvent... eventsToWaitFor) throws CLException.MapFailure {
7495
return map(queue, flags, offset, length, false, eventsToWaitFor);
7596
}
7697

7798
/**
7899
#documentCallsFunction("clEnqueueFillBuffer")
79-
* @param queue Queue on which to enqueue this fill buffer command.
100+
#documentQueue()
80101
* @param pattern Data pattern to fill the buffer with.
81102
#documentEventsToWaitForAndReturn()
82103
*/
@@ -86,8 +107,6 @@ public CLEvent fillBuffer(CLQueue queue, Pointer<T> pattern, CLEvent... eventsTo
86107

87108
/**
88109
#documentCallsFunction("clEnqueueFillBuffer")
89-
* @param queue
90-
* @param queue Queue on which to enqueue this fill buffer command.
91110
* @param pattern Data pattern to fill the buffer with.
92111
* @param patternLength Length in elements (not in bytes) of the pattern to use.
93112
* @param offset Offset in elements where to start filling the pattern.
@@ -155,7 +174,7 @@ protected void checkBounds(long offset, long length) {
155174
* Can be used to create a new buffer object (referred to as a sub-buffer object) from an existing buffer object.
156175
* @param usage is used to specify allocation and usage information about the image memory object being created and is described in table 5.3 of the OpenCL spec.
157176
* @param offset
158-
* @param length
177+
* @param length length in bytes
159178
* @since OpenCL 1.1
160179
* @return sub-buffer that is a "window" of this buffer starting at the provided offset, with the provided length
161180
*/
@@ -171,7 +190,7 @@ public CLBuffer<T> createSubBuffer(Usage usage, long offset, long length) {
171190

172191
/**
173192
* enqueues a command to copy a buffer object identified by src_buffer to another buffer object identified by destination.
174-
* @param destination
193+
* @param destination destination buffer object
175194
#documentEventsToWaitForAndReturn()
176195
*/
177196
public CLEvent copyTo(CLQueue queue, CLMem destination, CLEvent... eventsToWaitFor) {
@@ -181,10 +200,10 @@ public CLEvent copyTo(CLQueue queue, CLMem destination, CLEvent... eventsToWaitF
181200
/**
182201
#documentCallsFunction("clEnqueueCopyBuffer")
183202
* enqueues a command to copy a buffer object identified by src_buffer to another buffer object identified by destination.
184-
* @param queue
203+
#documentQueue()
185204
* @param srcOffset
186-
* @param length
187-
* @param destination
205+
* @param length length in bytes
206+
* @param destination destination buffer object
188207
* @param destOffset
189208
#documentEventsToWaitForAndReturn()
190209
*/
@@ -250,6 +269,9 @@ protected Pair<Pointer<T>, CLEvent> map(CLQueue queue, MapFlags flags, long offs
250269

251270
/**
252271
#documentCallsFunction("clEnqueueUnmapMemObject")
272+
#documentQueue()
273+
* @param buffer
274+
#documentEventsToWaitForAndReturn()
253275
*/
254276
public CLEvent unmap(CLQueue queue, Pointer<T> buffer, CLEvent... eventsToWaitFor) {
255277
#declareReusablePtrsAndEventsInOut();
@@ -260,6 +282,10 @@ public CLEvent unmap(CLQueue queue, Pointer<T> buffer, CLEvent... eventsToWaitFo
260282
/**
261283
#documentCallsFunction("clEnqueueReadBuffer")
262284
* @deprecated use {@link CLBuffer#read(CLQueue, Pointer, boolean, CLEvent[])} instead
285+
#documentQueue()
286+
* @param out output buffer
287+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
288+
#documentEventsToWaitForAndReturn()
263289
*/
264290
@Deprecated
265291
public CLEvent read(CLQueue queue, Buffer out, boolean blocking, CLEvent... eventsToWaitFor) {
@@ -268,6 +294,10 @@ public CLEvent read(CLQueue queue, Buffer out, boolean blocking, CLEvent... even
268294

269295
/**
270296
#documentCallsFunction("clEnqueueReadBuffer")
297+
#documentQueue()
298+
* @param out output buffer
299+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
300+
#documentEventsToWaitForAndReturn()
271301
*/
272302
public CLEvent read(CLQueue queue, Pointer<T> out, boolean blocking, CLEvent... eventsToWaitFor) {
273303
return read(queue, 0, -1, out, blocking, eventsToWaitFor);
@@ -276,6 +306,12 @@ public CLEvent read(CLQueue queue, Pointer<T> out, boolean blocking, CLEvent...
276306
/**
277307
#documentCallsFunction("clEnqueueReadBuffer")
278308
* @deprecated use {@link CLBuffer#read(CLQueue, long, long, Pointer, boolean, CLEvent[])} instead
309+
#documentQueue()
310+
* @param offset offset in the {@link CLBuffer}
311+
* @param length length to write (in bytes)
312+
* @param out output buffer
313+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
314+
#documentEventsToWaitForAndReturn()
279315
*/
280316
@Deprecated
281317
public CLEvent read(CLQueue queue, long offset, long length, Buffer out, boolean blocking, CLEvent... eventsToWaitFor) {
@@ -301,6 +337,12 @@ public CLEvent read(CLQueue queue, long offset, long length, Buffer out, boolean
301337

302338
/**
303339
#documentCallsFunction("clEnqueueReadBuffer")
340+
#documentQueue()
341+
* @param offset offset in the {@link CLBuffer}
342+
* @param length length to write (in bytes)
343+
* @param out output buffer
344+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
345+
#documentEventsToWaitForAndReturn()
304346
*/
305347
public CLEvent read(CLQueue queue, long offset, long length, Pointer<T> out, boolean blocking, CLEvent... eventsToWaitFor) {
306348
if (out == null)
@@ -334,6 +376,10 @@ public CLEvent read(CLQueue queue, long offset, long length, Pointer<T> out, boo
334376
/**
335377
#documentCallsFunction("clEnqueueWriteBuffer")
336378
* @deprecated use {@link CLBuffer#write(CLQueue, Pointer, boolean, CLEvent[])} instead
379+
#documentQueue()
380+
* @param in input buffer
381+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
382+
#documentEventsToWaitForAndReturn()
337383
*/
338384
@Deprecated
339385
public CLEvent write(CLQueue queue, Buffer in, boolean blocking, CLEvent... eventsToWaitFor) {
@@ -342,6 +388,10 @@ public CLEvent write(CLQueue queue, Buffer in, boolean blocking, CLEvent... even
342388

343389
/**
344390
#documentCallsFunction("clEnqueueWriteBuffer")
391+
#documentQueue()
392+
* @param in input buffer
393+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
394+
#documentEventsToWaitForAndReturn()
345395
*/
346396
public CLEvent write(CLQueue queue, Pointer<T> in, boolean blocking, CLEvent... eventsToWaitFor) {
347397
return write(queue, 0, -1, in, blocking, eventsToWaitFor);
@@ -350,6 +400,12 @@ public CLEvent write(CLQueue queue, Pointer<T> in, boolean blocking, CLEvent...
350400
/**
351401
#documentCallsFunction("clEnqueueWriteBuffer")
352402
* @deprecated use {@link CLBuffer#write(CLQueue, long, long, Pointer, boolean, CLEvent[])} instead
403+
#documentQueue()
404+
* @param offset offset in the {@link CLBuffer}
405+
* @param length length to write (in bytes)
406+
* @param in input buffer
407+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
408+
#documentEventsToWaitForAndReturn()
353409
*/
354410
@Deprecated
355411
public CLEvent write(CLQueue queue, long offset, long length, Buffer in, boolean blocking, CLEvent... eventsToWaitFor) {
@@ -370,6 +426,12 @@ public CLEvent write(CLQueue queue, long offset, long length, Buffer in, boolean
370426

371427
/**
372428
#documentCallsFunction("clEnqueueWriteBuffer")
429+
#documentQueue()
430+
* @param offset offset in the {@link CLBuffer}
431+
* @param length length to write (in bytes)
432+
* @param in input buffer
433+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
434+
#documentEventsToWaitForAndReturn()
373435
*/
374436
public CLEvent write(CLQueue queue, long offset, long length, Pointer<T> in, boolean blocking, CLEvent... eventsToWaitFor) {
375437
if (length == 0)
@@ -404,12 +466,24 @@ public CLEvent write(CLQueue queue, long offset, long length, Pointer<T> in, boo
404466

405467
/**
406468
#documentCallsFunction("clEnqueueWriteBuffer")
469+
#documentQueue()
470+
* @param offset offset in the {@link CLBuffer}
471+
* @param length length to write (in bytes)
472+
* @param in input buffer
473+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
474+
#documentEventsToWaitForAndReturn()
407475
*/
408476
public CLEvent writeBytes(CLQueue queue, long offset, long length, ByteBuffer in, boolean blocking, CLEvent... eventsToWaitFor) {
409477
return writeBytes(queue, offset, length, pointerToBuffer(in), blocking, eventsToWaitFor);
410478
}
411479
/**
412480
#documentCallsFunction("clEnqueueWriteBuffer")
481+
#documentQueue()
482+
* @param offset offset in the {@link CLBuffer}
483+
* @param length length to write (in bytes)
484+
* @param in input buffer
485+
* @param blocking whether the operation should be blocking (and return null), or non-blocking (and return a completion event)
486+
#documentEventsToWaitForAndReturn()
413487
*/
414488
public CLEvent writeBytes(CLQueue queue, long offset, long length, Pointer<?> in, boolean blocking, CLEvent... eventsToWaitFor) {
415489
if (in == null)
@@ -455,7 +529,8 @@ public <T> CLBuffer<T> as(Class<T> newTargetType) {
455529

456530
/**
457531
#documentCallsFunction("clEnqueueCopyBuffer")
458-
* @param queue
532+
#documentQueue()
533+
* @param destination destination buffer object
459534
#documentEventsToWaitForAndReturn()
460535
*/
461536
public CLEvent copyTo(CLQueue queue, CLBuffer destination, CLEvent... eventsToWaitFor) {
@@ -464,7 +539,11 @@ public CLEvent copyTo(CLQueue queue, CLBuffer destination, CLEvent... eventsToWa
464539

465540
/**
466541
#documentCallsFunction("clEnqueueCopyBuffer")
467-
* @param queue
542+
#documentQueue()
543+
* @param destination destination buffer object
544+
* @param sourceByteOffset byte offset in the source
545+
* @param destinationByteOffset byte offset in the destination
546+
* @param byteCount number of bytes to copy
468547
#documentEventsToWaitForAndReturn()
469548
*/
470549
public CLEvent copyBytesTo(CLQueue queue, CLBuffer destination, long sourceByteOffset, long destinationByteOffset, long byteCount, CLEvent... eventsToWaitFor) {
@@ -482,7 +561,11 @@ public CLEvent copyBytesTo(CLQueue queue, CLBuffer destination, long sourceByteO
482561

483562
/**
484563
#documentCallsFunction("clEnqueueCopyBuffer")
485-
* @param queue
564+
#documentQueue()
565+
* @param destination destination buffer object
566+
* @param sourceElementOffset element offset in the source
567+
* @param destinationElementOffset element offset in the destination
568+
* @param elementCount number of elements to copy
486569
#documentEventsToWaitForAndReturn()
487570
*/
488571
public CLEvent copyElementsTo(CLQueue queue, CLBuffer destination, long sourceElementOffset, long destinationElementOffset, long elementCount, CLEvent... eventsToWaitFor) {

0 commit comments

Comments
 (0)