JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
CLDevice.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opencl;
30
31import java.nio.ByteOrder;
32import java.util.ArrayList;
33import java.util.Collections;
34import java.util.EnumSet;
35import java.util.HashSet;
36import java.util.List;
37import java.util.Map;
38import java.util.Scanner;
39import java.util.Set;
40
41import com.jogamp.opencl.llb.CL;
42import com.jogamp.opencl.spi.CLInfoAccessor;
43import com.jogamp.opencl.util.CLUtil;
44
45/**
46 * This object represents an OpenCL device.
47 * @see CLPlatform#listCLDevices(com.jogamp.opencl.CLDevice.Type...)
48 * @see CLPlatform#getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type...)
49 * @see CLContext#getDevices()
50 * @see CLContext#getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type)
51 * @author Michael Bien, et al.
52 */
53public class CLDevice extends CLObject {
54
55 private Set<String> extensions;
56
57 private final CLInfoAccessor deviceInfo;
58 private final CLPlatform platform;
59
60 protected CLDevice(final CLPlatform platform, final long id) {
61 super(id);
62 this.platform = platform;
63 this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getCLBinding(), id);
64 }
65
66 protected CLDevice(final CLContext context, final long id) {
67 super(context, id);
68 this.platform = context.getPlatform();
69 this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getCLBinding(), id);
70 }
71
73 return createCommandQueue(0);
74 }
75
77 return createCommandQueue(property.QUEUE_MODE);
78 }
79
81 int flags = 0;
82 if(properties != null) {
83 for (int i = 0; i < properties.length; i++) {
84 flags |= properties[i].QUEUE_MODE;
85 }
86 }
87 return createCommandQueue(flags);
88 }
89
90 public CLCommandQueue createCommandQueue(final long properties) {
91 if(context == null)
92 throw new IllegalStateException("this device is not associated with a context");
93 return context.createCommandQueue(this, properties);
94 }
95
96 /*keep this package private*/
97 void setContext(final CLContext context) {
98 this.context = context;
99 }
100
101 @Override
103 return platform;
104 }
105
106 /**
107 * Returns the name of this device.
108 */
109 @CLProperty("CL_DEVICE_NAME")
110 public String getName() {
111 return deviceInfo.getString(CL.CL_DEVICE_NAME);
112 }
113
114 /**
115 * Returns the OpenCL profile of this device.
116 */
117 @CLProperty("CL_DEVICE_PROFILE")
118 public String getProfile() {
119 return deviceInfo.getString(CL.CL_DEVICE_PROFILE);
120 }
121
122 /**
123 * Returns the vendor of this device.
124 */
125 @CLProperty("CL_DEVICE_VENDOR")
126 public String getVendor() {
127 return deviceInfo.getString(CL.CL_DEVICE_VENDOR);
128 }
129
130 /**
131 * Returns the vendor id of this device.
132 */
133 @CLProperty("CL_DEVICE_VENDOR_ID")
134 public long getVendorID() {
135 return deviceInfo.getLong(CL.CL_DEVICE_VENDOR_ID);
136 }
137
138 /**
139 * Returns the OpenCL version supported by the device.
140 */
141 @CLProperty("CL_DEVICE_VERSION")
143 return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_VERSION));
144 }
145
146 /**
147 * Returns the OpenCL-C version supported by the device.
148 */
149 @CLProperty("CL_DEVICE_OPENCL_C_VERSION")
151 return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_OPENCL_C_VERSION));
152 }
153
154 /**
155 * Returns OpenCL software driver version string in the form major_number.minor_number.
156 */
157 @CLProperty("CL_DRIVER_VERSION")
158 public String getDriverVersion() {
159 return deviceInfo.getString(CL.CL_DRIVER_VERSION);
160 }
161
162 /**
163 * Returns the type of this device.
164 */
165 @CLProperty("CL_DEVICE_TYPE")
166 public Type getType() {
167 return Type.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_TYPE));
168 }
169
170 /**
171 * The default compute device address space size specified in bits.
172 * Currently supported values are 32 or 64 bits.
173 */
174 @CLProperty("CL_DEVICE_ADDRESS_BITS")
175 public int getAddressBits() {
176 return (int)deviceInfo.getLong(CL.CL_DEVICE_ADDRESS_BITS);
177 }
178
179 /**
180 * Preferred native vector width size for built-in short vectors.
181 * The vector width is defined as the number of scalar elements that can be stored in the vector.
182 */
183 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT")
185 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
186 }
187
188 /**
189 * Preferred native vector width size for built-in char vectors.
190 * The vector width is defined as the number of scalar elements that can be stored in the vector.
191 */
192 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR")
194 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR);
195 }
196
197 /**
198 * Preferred native vector width size for built-in int vectors.
199 * The vector width is defined as the number of scalar elements that can be stored in the vector.
200 */
201 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT")
203 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
204 }
205
206 /**
207 * Preferred native vector width size for built-in long vectors.
208 * The vector width is defined as the number of scalar elements that can be stored in the vector.
209 */
210 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG")
212 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
213 }
214
215 /**
216 * Preferred native vector width size for built-in float vectors.
217 * The vector width is defined as the number of scalar elements that can be stored in the vector.
218 */
219 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT")
221 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
222 }
223
224 /**
225 * Preferred native vector width size for built-in double vectors.
226 * The vector width is defined as the number of scalar elements that can be stored in the vector.
227 */
228 @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE")
230 return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
231 }
232
233 /**
234 * Native vector width size for built-in char vectors.
235 * The vector width is defined as the number of scalar elements that can be stored in the vector.
236 */
237 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR")
239 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR);
240 }
241
242 /**
243 * Native vector width size for built-in short vectors.
244 * The vector width is defined as the number of scalar elements that can be stored in the vector.
245 */
246 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT")
248 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT);
249 }
250
251 /**
252 * Native vector width size for built-in int vectors.
253 * The vector width is defined as the number of scalar elements that can be stored in the vector.
254 */
255 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_INT")
257 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_INT);
258 }
259
260 /**
261 * Native vector width size for built-in long vectors.
262 * The vector width is defined as the number of scalar elements that can be stored in the vector.
263 */
264 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG")
266 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG);
267 }
268
269 /**
270 * Native vector width size for built-in half vectors.
271 * The vector width is defined as the number of scalar elements that can be stored in the vector.
272 */
273 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF")
275 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF);
276 }
277
278 /**
279 * Native vector width size for built-in float vectors.
280 * The vector width is defined as the number of scalar elements that can be stored in the vector.
281 */
282 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT")
284 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT);
285 }
286
287 /**
288 * Native vector width size for built-in double vectors.
289 * The vector width is defined as the number of scalar elements that can be stored in the vector.
290 */
291 @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE")
293 return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE);
294 }
295
296 /**
297 * Returns the number of parallel compute cores on the OpenCL device.
298 * The minimum value is 1.
299 */
300 @CLProperty("CL_DEVICE_MAX_COMPUTE_UNITS")
301 public int getMaxComputeUnits() {
302 return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_COMPUTE_UNITS);
303 }
304
305 /**
306 * Returns the maximum number of work-items in a work-group executing
307 * a kernel using the data parallel execution model.
308 * The minimum value is 1.
309 */
310 @CLProperty("CL_DEVICE_MAX_WORK_GROUP_SIZE")
311 public int getMaxWorkGroupSize() {
312 return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_GROUP_SIZE);
313 }
314
315 /**
316 * Returns the maximum configured clock frequency of the device in MHz.
317 */
318 @CLProperty("CL_DEVICE_MAX_CLOCK_FREQUENCY")
319 public int getMaxClockFrequency() {
320 return (int) (deviceInfo.getLong(CL.CL_DEVICE_MAX_CLOCK_FREQUENCY));
321 }
322
323 /**
324 * Returns the maximum dimensions that specify the global and local work-item
325 * IDs used by the data parallel execution model.
326 * The minimum value is 3.
327 */
328 @CLProperty("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS")
330 return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
331 }
332
333 /**
334 * Returns the maximum number of work-items that can be specified in each
335 * dimension of the work-group.
336 * The minimum value is (1, 1, 1).
337 */
338 @CLProperty("CL_DEVICE_MAX_WORK_ITEM_SIZES")
339 public int[] getMaxWorkItemSizes() {
340 final int n = getMaxWorkItemDimensions();
341 return deviceInfo.getInts(CL.CL_DEVICE_MAX_WORK_ITEM_SIZES, n);
342 }
343
344 /**
345 * Returns the max size in bytes of the arguments that can be passed to a kernel.<br/>
346 * The minimum OpenCL 1.0 value is 256.<br/>
347 * The minimum OpenCL 1.1 value is 1024.<br/>
348 */
349 @CLProperty("CL_DEVICE_MAX_PARAMETER_SIZE")
350 public long getMaxParameterSize() {
351 return deviceInfo.getLong(CL.CL_DEVICE_MAX_PARAMETER_SIZE);
352 }
353
354 /**
355 * Returns the largest allocatable size of a {@link CLBuffer} on this device.
356 */
357 @CLProperty("CL_DEVICE_MAX_MEM_ALLOC_SIZE")
358 public long getMaxMemAllocSize() {
359 return deviceInfo.getLong(CL.CL_DEVICE_MAX_MEM_ALLOC_SIZE);
360 }
361
362 /**
363 * Returns the <code>uint32_t</code> memory base address alignment
364 * value reinterpreted as a <code>long</code> value.
365 */
366 @CLProperty("CL_DEVICE_MEM_BASE_ADDR_ALIGN")
367 public long getMemBaseAddrAlign() {
369 }
370
371 /**
372 * Returns the global memory size in bytes.
373 */
374 @CLProperty("CL_DEVICE_GLOBAL_MEM_SIZE")
375 public long getGlobalMemSize() {
376 return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_SIZE);
377 }
378
379 /**
380 * Returns the local memory size in bytes.<br/>
381 * The minimum OpenCL 1.0 value is 16 KB.<br/>
382 * The minimum OpenCL 1.1 value is 32 KB.<br/>
383 */
384 @CLProperty("CL_DEVICE_LOCAL_MEM_SIZE")
385 public long getLocalMemSize() {
386 return deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_SIZE);
387 }
388
389 /**
390 * Returns true if the device and the host have a unified memory subsystem.
391 */
392 @CLProperty("CL_DEVICE_HOST_UNIFIED_MEMORY")
393 public boolean isMemoryUnified() {
394 return deviceInfo.getLong(CL.CL_DEVICE_HOST_UNIFIED_MEMORY) == CL.CL_TRUE;
395 }
396
397 /**
398 * Returns the max size in bytes of a constant buffer allocation.
399 * The minimum value is 64 KB.
400 */
401 @CLProperty("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE")
404 }
405
406 /**
407 * Returns the size of global memory cache line in bytes.
408 */
409 @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE")
412 }
413
414 /**
415 * Returns the size of global memory cache in bytes.
416 */
417 @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_SIZE")
418 public long getGlobalMemCacheSize() {
419 return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
420 }
421
422 /**
423 * Returns the max number of arguments declared with the <code>constant</code>
424 * qualifier in a kernel. The minimum value is 8.
425 */
426 @CLProperty("CL_DEVICE_MAX_CONSTANT_ARGS")
427 public long getMaxConstantArgs() {
428 return deviceInfo.getLong(CL.CL_DEVICE_MAX_CONSTANT_ARGS);
429 }
430
431 /**
432 * Returns true if images are supported by the OpenCL device and false otherwise.
433 */
434 @CLProperty("CL_DEVICE_IMAGE_SUPPORT")
435 public boolean isImageSupportAvailable() {
436 return deviceInfo.getLong(CL.CL_DEVICE_IMAGE_SUPPORT) == CL.CL_TRUE;
437 }
438
439 /**
440 * Returns the max number of simultaneous image objects that can be read by a kernel.
441 * The minimum value is 128 if image support is available.
442 */
443 @CLProperty("CL_DEVICE_MAX_READ_IMAGE_ARGS")
444 public int getMaxReadImageArgs() {
445 return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_READ_IMAGE_ARGS);
446 }
447
448 /**
449 * Returns the max number of simultaneous image objects that can be written by a kernel.
450 * The minimum value is 8 if image support is available.
451 */
452 @CLProperty("CL_DEVICE_MAX_WRITE_IMAGE_ARGS")
453 public int getMaxWriteImageArgs() {
454 return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_WRITE_IMAGE_ARGS);
455 }
456
457 /**
458 * Returns the max width of 2D image in pixels. The minimum value is 8192 if
459 * image support is available.
460 */
461 @CLProperty("CL_DEVICE_IMAGE2D_MAX_WIDTH")
462 public int getMaxImage2dWidth() {
463 return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_WIDTH);
464 }
465
466 /**
467 * Returns the max height of 2D image in pixels. The minimum value is 8192 if
468 * image support is available.
469 */
470 @CLProperty("CL_DEVICE_IMAGE2D_MAX_HEIGHT")
471 public int getMaxImage2dHeight() {
472 return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_HEIGHT);
473 }
474
475 /**
476 * Returns the max width of 3D image in pixels. The minimum value is 2048 if
477 * image support is available.
478 */
479 @CLProperty("CL_DEVICE_IMAGE3D_MAX_WIDTH")
480 public int getMaxImage3dWidth() {
481 return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_WIDTH);
482 }
483
484 /**
485 * Returns the max height of 3D image in pixels. The minimum value is 2048 if
486 * image support is available.
487 */
488 @CLProperty("CL_DEVICE_IMAGE3D_MAX_HEIGHT")
489 public int getMaxImage3dHeight() {
490 return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_HEIGHT);
491 }
492
493 /**
494 * Returns the max depth of 3D image in pixels. The minimum value is 2048 if
495 * image support is available.
496 */
497 @CLProperty("CL_DEVICE_IMAGE3D_MAX_DEPTH")
498 public int getMaxImage3dDepth() {
499 return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_DEPTH);
500 }
501
502 /**
503 * Returns the maximum number of samplers that can be used in a kernel. The
504 * minimum value is 16 if image support is available.
505 */
506 @CLProperty("CL_DEVICE_MAX_SAMPLERS")
507 public int getMaxSamplers() {
508 return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_SAMPLERS);
509 }
510
511 /**
512 * Returns the resolution of device timer. This is measured in nanoseconds.
513 */
514 @CLProperty("CL_DEVICE_PROFILING_TIMER_RESOLUTION")
517 }
518
519 /**
520 * Returns the execution capabilities as EnumSet.
521 */
522 @CLProperty("CL_DEVICE_EXECUTION_CAPABILITIES")
525 }
526
527 /**
528 * Returns the optional half precision floating-point capability of the device.
529 * The required minimum half precision floating-point capabilities as implemented by this
530 * extension are {@link FPConfig#ROUND_TO_ZERO}, {@link FPConfig#ROUND_TO_INF}
531 * and {@link FPConfig#INF_NAN}.
532 * @return An EnumSet containing the extensions, never null.
533 */
534 @CLProperty("CL_DEVICE_HALF_FP_CONFIG")
535 public EnumSet<FPConfig> getHalfFPConfig() {
537 return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_HALF_FP_CONFIG));
538 else
539 return EnumSet.noneOf(FPConfig.class);
540 }
541
542 /**
543 * Returns the single precision floating-point capability of the device.
544 * The mandated minimum floating-point capabilities are {@link FPConfig#ROUND_TO_NEAREST} and
545 * {@link FPConfig#INF_NAN}.
546 * @return An EnumSet containing the extensions, never null.
547 */
548 @CLProperty("CL_DEVICE_SINGLE_FP_CONFIG")
549 public EnumSet<FPConfig> getSingleFPConfig() {
550 return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_SINGLE_FP_CONFIG));
551 }
552
553 /**
554 * Returns the optional double precision floating-point capability of the device.
555 * The mandated minimum double precision floating-point capabilities are {@link FPConfig#FMA},
556 * {@link FPConfig#ROUND_TO_NEAREST}, {@link FPConfig#ROUND_TO_ZERO},
557 * {@link FPConfig#ROUND_TO_INF}, {@link FPConfig#INF_NAN}, and {@link FPConfig#DENORM}.
558 * @return An EnumSet containing the extensions, never null.
559 */
560 @CLProperty("CL_DEVICE_DOUBLE_FP_CONFIG")
561 public EnumSet<FPConfig> getDoubleFPConfig() {
563 return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_DOUBLE_FP_CONFIG));
564 else
565 return EnumSet.noneOf(FPConfig.class);
566 }
567
568 /**
569 * Returns the local memory type.
570 */
571 @CLProperty("CL_DEVICE_LOCAL_MEM_TYPE")
573 return LocalMemType.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_TYPE));
574 }
575
576 /**
577 * Returns the type of global memory cache supported.
578 */
579 @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_TYPE")
582 }
583
584
585 /**
586 * Returns the command-queue properties supported by the device.
587 */
588 @CLProperty("CL_DEVICE_QUEUE_PROPERTIES")
591 }
592
593 /**
594 * Returns true if this device is available.
595 */
596 @CLProperty("CL_DEVICE_AVAILABLE")
597 public boolean isAvailable() {
598 return deviceInfo.getLong(CL.CL_DEVICE_AVAILABLE) == CL.CL_TRUE;
599 }
600
601 /**
602 * Returns false if the implementation does not have a compiler available to
603 * compile the program source. Is true if the compiler is available.
604 * This can be false for the OpenCL ES profile only.
605 */
606 @CLProperty("CL_DEVICE_COMPILER_AVAILABLE")
607 public boolean isCompilerAvailable() {
608 return deviceInfo.getLong(CL.CL_DEVICE_COMPILER_AVAILABLE) == CL.CL_TRUE;
609 }
610
611 /**
612 * Returns true if the OpenCL device is a little endian device and false otherwise.
613 */
614 @CLProperty("CL_DEVICE_ENDIAN_LITTLE")
615 public boolean isLittleEndian() {
616 return deviceInfo.getLong(CL.CL_DEVICE_ENDIAN_LITTLE) == CL.CL_TRUE;
617 }
618
619 /**
620 * Returns true if the device implements error correction for the memories,
621 * caches, registers etc. in the device. Is false if the device does not
622 * implement error correction.
623 */
624 @CLProperty("CL_DEVICE_ERROR_CORRECTION_SUPPORT")
625 public boolean isErrorCorrectionSupported() {
627 }
628
629 /**
630 * Returns {@link #isExtensionAvailable}("cl_khr_fp16").
631 * @see #getExtensions()
632 */
633 @CLProperty("cl_khr_fp16")
634 public boolean isHalfFPAvailable() {
635 return isExtensionAvailable("cl_khr_fp16");
636 }
637
638 /**
639 * Returns {@link #isExtensionAvailable}("cl_khr_fp64").
640 * @see #getExtensions()
641 */
642 @CLProperty("cl_khr_fp64")
643 public boolean isDoubleFPAvailable() {
644 return isExtensionAvailable("cl_khr_fp64");
645 }
646
647 /**
648 * Returns {@link #isExtensionAvailable}("cl_khr_icd").
649 * @see #getExtensions()
650 */
651 @CLProperty("cl_khr_icd")
652 public boolean isICDAvailable() {
653 return isExtensionAvailable("cl_khr_icd");
654 }
655
656 /**
657 * Returns {@link #isExtensionAvailable}("cl_khr_gl_sharing") || {@link #isExtensionAvailable}("cl_APPLE_gl_sharing").
658 * @see #getExtensions()
659 */
660 @CLProperty("cl_khr_gl_sharing | cl_APPLE_gl_sharing")
661 public boolean isGLMemorySharingSupported() {
662 return isExtensionAvailable("cl_khr_gl_sharing") || isExtensionAvailable("cl_APPLE_gl_sharing");
663 }
664
665 /**
666 * Returns true if the extension is supported on this device.
667 * @see #getExtensions()
668 */
669 public boolean isExtensionAvailable(final String extension) {
670 return getExtensions().contains(extension);
671 }
672
673 /**
674 * Returns {@link ByteOrder#LITTLE_ENDIAN} or {@link ByteOrder#BIG_ENDIAN}.
675 */
676 public ByteOrder getByteOrder() {
677 if(isLittleEndian()) {
678 return ByteOrder.LITTLE_ENDIAN;
679 }else{
680 return ByteOrder.BIG_ENDIAN;
681 }
682 }
683
684 /**
685 * Returns all device extension names as unmodifiable Set.
686 */
687 @CLProperty("CL_DEVICE_EXTENSIONS")
688 public Set<String> getExtensions() {
689
690 if(extensions == null) {
691 extensions = new HashSet<String>();
692 final String ext = deviceInfo.getString(CL.CL_DEVICE_EXTENSIONS);
693 final Scanner scanner = new Scanner(ext);
694
695 while(scanner.hasNext())
696 extensions.add(scanner.next());
697
698 extensions = Collections.unmodifiableSet(extensions);
699 }
700
701 return extensions;
702 }
703
704 /**
705 * Returns a Map of device properties with the enum names as keys.
706 * @see CLUtil#obtainDeviceProperties(com.jogamp.opencl.CLDevice)
707 */
709 return CLUtil.obtainDeviceProperties(this);
710 }
711
713 return deviceInfo;
714 }
715
716 @Override
717 public String toString() {
718 return "CLDevice [id: " + ID
719 + " name: " + getName()
720 + " type: " + getType()
721 + " profile: " + getProfile()+"]";
722 }
723
724 @Override
725 public boolean equals(final Object obj) {
726 if (obj == null) {
727 return false;
728 }
729 if (getClass() != obj.getClass()) {
730 return false;
731 }
732 final CLDevice other = (CLDevice) obj;
733 if (this.ID != other.ID) {
734 return false;
735 }
736 return true;
737 }
738
739 @Override
740 public int hashCode() {
741 int hash = 3;
742 hash = 79 * hash + (int) (this.ID ^ (this.ID >>> 32));
743 return hash;
744 }
745
746 /**
747 * Enumeration for the execution capabilities of the device.
748 */
749 public enum Capabilities {
750
751 /**
752 * The OpenCL device can execute OpenCL kernels.
753 */
755
756 /**
757 * The OpenCL device can execute native kernels.
758 */
760
761 /**
762 * Value of wrapped OpenCL device type.
763 */
764 public final int CAPS;
765
766 private Capabilities(final int type) {
767 this.CAPS = type;
768 }
769
770 public static Capabilities valueOf(final int caps) {
771 switch(caps) {
772 case(CL.CL_EXEC_KERNEL):
773 return EXEC_KERNEL;
775 return EXEC_NATIVE_KERNEL;
776 }
777 return null;
778 }
779
780 public static EnumSet<Capabilities> valuesOf(final int bitfield) {
781 if((EXEC_KERNEL.CAPS & bitfield) != 0) {
782 if((EXEC_NATIVE_KERNEL.CAPS & bitfield) != 0) {
783 return EnumSet.of(EXEC_KERNEL, EXEC_NATIVE_KERNEL);
784 }else{
785 return EnumSet.of(EXEC_KERNEL);
786 }
787 }else if((EXEC_NATIVE_KERNEL.CAPS & bitfield) != 0){
788 return EnumSet.of(EXEC_NATIVE_KERNEL);
789 }
790 return null;
791 }
792
793 }
794
795 /**
796 * Enumeration for the type of a device.
797 */
798 public enum Type {
799 /**
800 * CL_DEVICE_TYPE_CPU
801 */
803 /**
804 * CL_DEVICE_TYPE_GPU
805 */
807 /**
808 * CL_DEVICE_TYPE_ACCELERATOR
809 */
811 /**
812 * CL_DEVICE_TYPE_DEFAULT. This type can be used for creating a context on
813 * the default device, a single device can never have this type.
814 */
816 /**
817 * CL_DEVICE_TYPE_ALL. This type can be used for creating a context on
818 * all devices, a single device can never have this type.
819 */
821
822 /**
823 * Value of wrapped OpenCL device type.
824 */
825 public final long TYPE;
826
827 private Type(final long type) {
828 this.TYPE = type;
829 }
830
831 public static Type valueOf(final long clDeviceType) {
832
833 if(clDeviceType == CL.CL_DEVICE_TYPE_ALL)
834 return ALL;
835
836 switch((int)clDeviceType) {
838 return DEFAULT;
840 return CPU;
842 return GPU;
844 return ACCELERATOR;
845 }
846 return null;
847 }
848 }
849
850 /**
851 * Describes floating-point capability of the device.
852 * Zero or more values are possible.
853 */
854 public enum FPConfig {
855
856 /**
857 * denorms are supported.
858 */
860
861 /**
862 * INF and quiet NaNs are supported.
863 */
865
866 /**
867 * round to nearest rounding mode supported.
868 */
870
871 /**
872 * round to positive and negative infinity rounding modes supported.
873 */
875
876 /**
877 * round to zero rounding mode supported.
878 */
880
881 /**
882 * IEEE754-2008 fused multiply-add is supported.
883 */
885
886
887 /**
888 * Value of wrapped OpenCL bitfield.
889 */
890 public final int CONFIG;
891
892 private FPConfig(final int config) {
893 this.CONFIG = config;
894 }
895
896 /**
897 * Returns a EnumSet for the given bitfield.
898 */
899 public static EnumSet<FPConfig> valuesOf(final int bitfield) {
900 final List<FPConfig> matching = new ArrayList<FPConfig>();
901 final FPConfig[] values = FPConfig.values();
902 for (final FPConfig value : values) {
903 if((value.CONFIG & bitfield) != 0)
904 matching.add(value);
905 }
906 if(matching.isEmpty())
907 return EnumSet.noneOf(FPConfig.class);
908 else
909 return EnumSet.copyOf(matching);
910 }
911
912 }
913
914 /**
915 * Type of global memory cache supported.
916 */
917 public enum GlobalMemCacheType {
918
919 /**
920 * Global memory cache not supported.
921 */
923
924 /**
925 * Read only cache.
926 */
928
929 /**
930 * Read-write cache.
931 */
933
934
935 /**
936 * Value of wrapped OpenCL value.
937 */
938 public final int TYPE;
939
940 private GlobalMemCacheType(final int type) {
941 this.TYPE = type;
942 }
943
944 /**
945 * Returns the matching GlobalMemCacheType for the given cl type.
946 */
947 public static GlobalMemCacheType valueOf(final int bitfield) {
948 final GlobalMemCacheType[] values = GlobalMemCacheType.values();
949 for (final GlobalMemCacheType value : values) {
950 if(value.TYPE == bitfield)
951 return value;
952 }
953 return null;
954 }
955 }
956
957 /**
958 * Type of local memory cache supported.
959 */
960 public enum LocalMemType {
961
962 /**
963 * GLOBAL implies that no dedicated memory storage is available (global mem is used instead).
964 */
966
967 /**
968 * LOCAL implies dedicated local memory storage such as SRAM.
969 */
971
972 /**
973 * Value of wrapped OpenCL value.
974 */
975 public final int TYPE;
976
977 private LocalMemType(final int type) {
978 this.TYPE = type;
979 }
980
981 /**
982 * Returns the matching LocalMemCacheType for the given cl type.
983 */
984 public static LocalMemType valueOf(final int clLocalCacheType) {
985 if(clLocalCacheType == CL.CL_GLOBAL)
986 return GLOBAL;
987 else if(clLocalCacheType == CL.CL_LOCAL)
988 return LOCAL;
989 return null;
990 }
991
992 }
993
994}
The command queue is used to queue a set of operations for a specific CLDevice.
CLContext is responsible for managing objects such as command-queues, memory, program and kernel obje...
Definition: CLContext.java:79
CLPlatform getPlatform()
Returns the CLPlatform this context is running on.
Definition: CLContext.java:569
This object represents an OpenCL device.
Definition: CLDevice.java:53
CLDevice(final CLContext context, final long id)
Definition: CLDevice.java:66
final CLInfoAccessor getCLAccessor()
Definition: CLDevice.java:712
int getNativeHalfVectorWidth()
Native vector width size for built-in half vectors.
Definition: CLDevice.java:274
CLVersion getVersion()
Returns the OpenCL version supported by the device.
Definition: CLDevice.java:142
int getAddressBits()
The default compute device address space size specified in bits.
Definition: CLDevice.java:175
boolean isLittleEndian()
Returns true if the OpenCL device is a little endian device and false otherwise.
Definition: CLDevice.java:615
int getMaxImage3dWidth()
Returns the max width of 3D image in pixels.
Definition: CLDevice.java:480
boolean isExtensionAvailable(final String extension)
Returns true if the extension is supported on this device.
Definition: CLDevice.java:669
boolean isImageSupportAvailable()
Returns true if images are supported by the OpenCL device and false otherwise.
Definition: CLDevice.java:435
CLDevice(final CLPlatform platform, final long id)
Definition: CLDevice.java:60
long getMaxConstantBufferSize()
Returns the max size in bytes of a constant buffer allocation.
Definition: CLDevice.java:402
boolean isCompilerAvailable()
Returns false if the implementation does not have a compiler available to compile the program source.
Definition: CLDevice.java:607
CLCommandQueue createCommandQueue(final CLCommandQueue.Mode property)
Definition: CLDevice.java:76
boolean isMemoryUnified()
Returns true if the device and the host have a unified memory subsystem.
Definition: CLDevice.java:393
CLCommandQueue createCommandQueue(final long properties)
Definition: CLDevice.java:90
CLCommandQueue createCommandQueue(final CLCommandQueue.Mode... properties)
Definition: CLDevice.java:80
String getName()
Returns the name of this device.
Definition: CLDevice.java:110
long getMaxMemAllocSize()
Returns the largest allocatable size of a CLBuffer on this device.
Definition: CLDevice.java:358
int getNativeShortVectorWidth()
Native vector width size for built-in short vectors.
Definition: CLDevice.java:247
int getNativeFloatVectorWidth()
Native vector width size for built-in float vectors.
Definition: CLDevice.java:283
int getNativeDoubleVectorWidth()
Native vector width size for built-in double vectors.
Definition: CLDevice.java:292
String getDriverVersion()
Returns OpenCL software driver version string in the form major_number.minor_number.
Definition: CLDevice.java:158
int getPreferredShortVectorWidth()
Preferred native vector width size for built-in short vectors.
Definition: CLDevice.java:184
GlobalMemCacheType getGlobalMemCacheType()
Returns the type of global memory cache supported.
Definition: CLDevice.java:580
int getPreferredDoubleVectorWidth()
Preferred native vector width size for built-in double vectors.
Definition: CLDevice.java:229
Type getType()
Returns the type of this device.
Definition: CLDevice.java:166
int getMaxWorkGroupSize()
Returns the maximum number of work-items in a work-group executing a kernel using the data parallel e...
Definition: CLDevice.java:311
int getMaxSamplers()
Returns the maximum number of samplers that can be used in a kernel.
Definition: CLDevice.java:507
boolean isHalfFPAvailable()
Returns isExtensionAvailable("cl_khr_fp16").
Definition: CLDevice.java:634
EnumSet< Capabilities > getExecutionCapabilities()
Returns the execution capabilities as EnumSet.
Definition: CLDevice.java:523
int getMaxWriteImageArgs()
Returns the max number of simultaneous image objects that can be written by a kernel.
Definition: CLDevice.java:453
CLCommandQueue createCommandQueue()
Definition: CLDevice.java:72
String getVendor()
Returns the vendor of this device.
Definition: CLDevice.java:126
int getPreferredCharVectorWidth()
Preferred native vector width size for built-in char vectors.
Definition: CLDevice.java:193
Map< String, String > getProperties()
Returns a Map of device properties with the enum names as keys.
Definition: CLDevice.java:708
int getMaxWorkItemDimensions()
Returns the maximum dimensions that specify the global and local work-item IDs used by the data paral...
Definition: CLDevice.java:329
Set< String > getExtensions()
Returns all device extension names as unmodifiable Set.
Definition: CLDevice.java:688
long getProfilingTimerResolution()
Returns the resolution of device timer.
Definition: CLDevice.java:515
String getProfile()
Returns the OpenCL profile of this device.
Definition: CLDevice.java:118
int getPreferredLongVectorWidth()
Preferred native vector width size for built-in long vectors.
Definition: CLDevice.java:211
int[] getMaxWorkItemSizes()
Returns the maximum number of work-items that can be specified in each dimension of the work-group.
Definition: CLDevice.java:339
int getNativeIntVectorWidth()
Native vector width size for built-in int vectors.
Definition: CLDevice.java:256
long getMaxParameterSize()
Returns the max size in bytes of the arguments that can be passed to a kernel.
Definition: CLDevice.java:350
boolean isDoubleFPAvailable()
Returns isExtensionAvailable("cl_khr_fp64").
Definition: CLDevice.java:643
int getMaxImage3dHeight()
Returns the max height of 3D image in pixels.
Definition: CLDevice.java:489
int getMaxImage2dHeight()
Returns the max height of 2D image in pixels.
Definition: CLDevice.java:471
long getLocalMemSize()
Returns the local memory size in bytes.
Definition: CLDevice.java:385
int getMaxImage2dWidth()
Returns the max width of 2D image in pixels.
Definition: CLDevice.java:462
boolean isErrorCorrectionSupported()
Returns true if the device implements error correction for the memories, caches, registers etc.
Definition: CLDevice.java:625
boolean equals(final Object obj)
Definition: CLDevice.java:725
int getNativeLongVectorWidth()
Native vector width size for built-in long vectors.
Definition: CLDevice.java:265
ByteOrder getByteOrder()
Returns ByteOrder#LITTLE_ENDIAN or ByteOrder#BIG_ENDIAN.
Definition: CLDevice.java:676
int getMaxImage3dDepth()
Returns the max depth of 3D image in pixels.
Definition: CLDevice.java:498
int getNativeCharVectorWidth()
Native vector width size for built-in char vectors.
Definition: CLDevice.java:238
EnumSet< FPConfig > getSingleFPConfig()
Returns the single precision floating-point capability of the device.
Definition: CLDevice.java:549
long getMemBaseAddrAlign()
Returns the uint32_t memory base address alignment value reinterpreted as a long value.
Definition: CLDevice.java:367
int getPreferredIntVectorWidth()
Preferred native vector width size for built-in int vectors.
Definition: CLDevice.java:202
EnumSet< FPConfig > getHalfFPConfig()
Returns the optional half precision floating-point capability of the device.
Definition: CLDevice.java:535
int getMaxReadImageArgs()
Returns the max number of simultaneous image objects that can be read by a kernel.
Definition: CLDevice.java:444
boolean isGLMemorySharingSupported()
Returns isExtensionAvailable("cl_khr_gl_sharing") || isExtensionAvailable("cl_APPLE_gl_sharing").
Definition: CLDevice.java:661
int getMaxComputeUnits()
Returns the number of parallel compute cores on the OpenCL device.
Definition: CLDevice.java:301
CLPlatform getPlatform()
Returns the platform for this OpenCL object.
Definition: CLDevice.java:102
EnumSet< CLCommandQueue.Mode > getQueueProperties()
Returns the command-queue properties supported by the device.
Definition: CLDevice.java:589
LocalMemType getLocalMemType()
Returns the local memory type.
Definition: CLDevice.java:572
long getGlobalMemCachelineSize()
Returns the size of global memory cache line in bytes.
Definition: CLDevice.java:410
long getMaxConstantArgs()
Returns the max number of arguments declared with the constant qualifier in a kernel.
Definition: CLDevice.java:427
long getVendorID()
Returns the vendor id of this device.
Definition: CLDevice.java:134
long getGlobalMemCacheSize()
Returns the size of global memory cache in bytes.
Definition: CLDevice.java:418
CLVersion getCVersion()
Returns the OpenCL-C version supported by the device.
Definition: CLDevice.java:150
int getMaxClockFrequency()
Returns the maximum configured clock frequency of the device in MHz.
Definition: CLDevice.java:319
boolean isAvailable()
Returns true if this device is available.
Definition: CLDevice.java:597
long getGlobalMemSize()
Returns the global memory size in bytes.
Definition: CLDevice.java:375
int getPreferredFloatVectorWidth()
Preferred native vector width size for built-in float vectors.
Definition: CLDevice.java:220
boolean isICDAvailable()
Returns isExtensionAvailable("cl_khr_icd").
Definition: CLDevice.java:652
EnumSet< FPConfig > getDoubleFPConfig()
Returns the optional double precision floating-point capability of the device.
Definition: CLDevice.java:561
Common superclass for all OpenCL objects.
Definition: CLObject.java:36
final long ID
The OpenCL object handle.
Definition: CLObject.java:41
CLPlatfrorm representing a OpenCL implementation (e.g.
Definition: CLPlatform.java:99
Version of an OpenCL Implementation.
Definition: CLVersion.java:42
static Map< String, String > obtainDeviceProperties(final CLDevice dev)
Reads all device properties and returns them as key-value map.
Definition: CLUtil.java:94
Enumeration for the command-queue settings.
static EnumSet< Mode > valuesOf(final long bitfield)
Enumeration for the execution capabilities of the device.
Definition: CLDevice.java:749
EXEC_KERNEL
The OpenCL device can execute OpenCL kernels.
Definition: CLDevice.java:754
static Capabilities valueOf(final int caps)
Definition: CLDevice.java:770
static EnumSet< Capabilities > valuesOf(final int bitfield)
Definition: CLDevice.java:780
final int CAPS
Value of wrapped OpenCL device type.
Definition: CLDevice.java:764
EXEC_NATIVE_KERNEL
The OpenCL device can execute native kernels.
Definition: CLDevice.java:759
Describes floating-point capability of the device.
Definition: CLDevice.java:854
final int CONFIG
Value of wrapped OpenCL bitfield.
Definition: CLDevice.java:890
FMA
IEEE754-2008 fused multiply-add is supported.
Definition: CLDevice.java:884
INF_NAN
INF and quiet NaNs are supported.
Definition: CLDevice.java:864
ROUND_TO_INF
round to positive and negative infinity rounding modes supported.
Definition: CLDevice.java:874
static EnumSet< FPConfig > valuesOf(final int bitfield)
Returns a EnumSet for the given bitfield.
Definition: CLDevice.java:899
ROUND_TO_NEAREST
round to nearest rounding mode supported.
Definition: CLDevice.java:869
ROUND_TO_ZERO
round to zero rounding mode supported.
Definition: CLDevice.java:879
DENORM
denorms are supported.
Definition: CLDevice.java:859
Type of global memory cache supported.
Definition: CLDevice.java:917
NONE
Global memory cache not supported.
Definition: CLDevice.java:922
final int TYPE
Value of wrapped OpenCL value.
Definition: CLDevice.java:938
static GlobalMemCacheType valueOf(final int bitfield)
Returns the matching GlobalMemCacheType for the given cl type.
Definition: CLDevice.java:947
Type of local memory cache supported.
Definition: CLDevice.java:960
GLOBAL
GLOBAL implies that no dedicated memory storage is available (global mem is used instead).
Definition: CLDevice.java:965
final int TYPE
Value of wrapped OpenCL value.
Definition: CLDevice.java:975
LOCAL
LOCAL implies dedicated local memory storage such as SRAM.
Definition: CLDevice.java:970
static LocalMemType valueOf(final int clLocalCacheType)
Returns the matching LocalMemCacheType for the given cl type.
Definition: CLDevice.java:984
Enumeration for the type of a device.
Definition: CLDevice.java:798
final long TYPE
Value of wrapped OpenCL device type.
Definition: CLDevice.java:825
ACCELERATOR
CL_DEVICE_TYPE_ACCELERATOR.
Definition: CLDevice.java:810
static Type valueOf(final long clDeviceType)
Definition: CLDevice.java:831
DEFAULT
CL_DEVICE_TYPE_DEFAULT.
Definition: CLDevice.java:815
Configures the mapping process.
Definition: CLMemory.java:402
Java bindings to OpenCL, the Open Computing Language.
Definition: CL.java:26
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE" with expression '0x103B', CType: int.
Definition: CL.java:247
static final int CL_DEVICE_HOST_UNIFIED_MEMORY
Define "CL_DEVICE_HOST_UNIFIED_MEMORY" with expression '0x1035', CType: int.
Definition: CL.java:615
static final int CL_FP_INF_NAN
Define "CL_FP_INF_NAN" with expression '(1 << 1)', CType: int.
Definition: CL.java:67
static final int CL_FP_DENORM
Define "CL_FP_DENORM" with expression '(1 << 0)', CType: int.
Definition: CL.java:285
static final int CL_DEVICE_AVAILABLE
Define "CL_DEVICE_AVAILABLE" with expression '0x1027', CType: int.
Definition: CL.java:543
static final int CL_DEVICE_LOCAL_MEM_SIZE
Define "CL_DEVICE_LOCAL_MEM_SIZE" with expression '0x1023', CType: int.
Definition: CL.java:603
static final int CL_DEVICE_MAX_MEM_ALLOC_SIZE
Define "CL_DEVICE_MAX_MEM_ALLOC_SIZE" with expression '0x1010', CType: int.
Definition: CL.java:321
static final int CL_DEVICE_TYPE_CPU
Define "CL_DEVICE_TYPE_CPU" with expression '(1 << 1)', CType: int.
Definition: CL.java:661
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF" with expression '0x103C', CType: int.
Definition: CL.java:785
static final int CL_DEVICE_NAME
Define "CL_DEVICE_NAME" with expression '0x102B', CType: int.
Definition: CL.java:653
static final int CL_DRIVER_VERSION
Define "CL_DRIVER_VERSION" with expression '0x102D', CType: int.
Definition: CL.java:765
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT" with expression '0x1007', CType: int.
Definition: CL.java:685
static final int CL_DEVICE_OPENCL_C_VERSION
Define "CL_DEVICE_OPENCL_C_VERSION" with expression '0x103D', CType: int.
Definition: CL.java:431
static final int CL_DEVICE_IMAGE2D_MAX_WIDTH
Define "CL_DEVICE_IMAGE2D_MAX_WIDTH" with expression '0x1011', CType: int.
Definition: CL.java:313
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_INT
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_INT" with expression '0x1038', CType: int.
Definition: CL.java:535
static final int CL_READ_ONLY_CACHE
Define "CL_READ_ONLY_CACHE" with expression '0x1', CType: int.
Definition: CL.java:405
static final int CL_DEVICE_TYPE
Define "CL_DEVICE_TYPE" with expression '0x1000', CType: int.
Definition: CL.java:93
static final int CL_DEVICE_SINGLE_FP_CONFIG
Define "CL_DEVICE_SINGLE_FP_CONFIG" with expression '0x101B', CType: int.
Definition: CL.java:671
static final int CL_FP_ROUND_TO_INF
Define "CL_FP_ROUND_TO_INF" with expression '(1 << 4)', CType: int.
Definition: CL.java:443
static final int CL_DEVICE_MAX_WORK_GROUP_SIZE
Define "CL_DEVICE_MAX_WORK_GROUP_SIZE" with expression '0x1004', CType: int.
Definition: CL.java:749
static final int CL_DEVICE_MAX_WRITE_IMAGE_ARGS
Define "CL_DEVICE_MAX_WRITE_IMAGE_ARGS" with expression '0x100F', CType: int.
Definition: CL.java:273
static final int CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
Define "CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS" with expression '0x1003', CType: int.
Definition: CL.java:427
static final int CL_DEVICE_IMAGE_SUPPORT
Define "CL_DEVICE_IMAGE_SUPPORT" with expression '0x1016', CType: int.
Definition: CL.java:547
static final int CL_DEVICE_VENDOR
Define "CL_DEVICE_VENDOR" with expression '0x102C', CType: int.
Definition: CL.java:257
static final int CL_DEVICE_MAX_CLOCK_FREQUENCY
Define "CL_DEVICE_MAX_CLOCK_FREQUENCY" with expression '0x100C', CType: int.
Definition: CL.java:353
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG" with expression '0x1009', CType: int.
Definition: CL.java:179
static final int CL_DEVICE_EXECUTION_CAPABILITIES
Define "CL_DEVICE_EXECUTION_CAPABILITIES" with expression '0x1029', CType: int.
Definition: CL.java:279
static final int CL_DEVICE_IMAGE3D_MAX_WIDTH
Define "CL_DEVICE_IMAGE3D_MAX_WIDTH" with expression '0x1013', CType: int.
Definition: CL.java:519
static final int CL_DEVICE_IMAGE3D_MAX_DEPTH
Define "CL_DEVICE_IMAGE3D_MAX_DEPTH" with expression '0x1015', CType: int.
Definition: CL.java:81
static final int CL_FP_ROUND_TO_NEAREST
Define "CL_FP_ROUND_TO_NEAREST" with expression '(1 << 2)', CType: int.
Definition: CL.java:777
static final int CL_DEVICE_IMAGE3D_MAX_HEIGHT
Define "CL_DEVICE_IMAGE3D_MAX_HEIGHT" with expression '0x1014', CType: int.
Definition: CL.java:59
static final int CL_TRUE
Define "CL_TRUE" with expression '1', CType: int.
Definition: CL.java:211
static final int CL_DEVICE_MAX_SAMPLERS
Define "CL_DEVICE_MAX_SAMPLERS" with expression '0x1018', CType: int.
Definition: CL.java:295
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE" with expression '0x100B', CType: int.
Definition: CL.java:91
static final int CL_DEVICE_LOCAL_MEM_TYPE
Define "CL_DEVICE_LOCAL_MEM_TYPE" with expression '0x1022', CType: int.
Definition: CL.java:231
static final int CL_DEVICE_MAX_WORK_ITEM_SIZES
Define "CL_DEVICE_MAX_WORK_ITEM_SIZES" with expression '0x1005', CType: int.
Definition: CL.java:421
static final int CL_READ_WRITE_CACHE
Define "CL_READ_WRITE_CACHE" with expression '0x2', CType: int.
Definition: CL.java:587
static final int CL_GLOBAL
Define "CL_GLOBAL" with expression '0x2', CType: int.
Definition: CL.java:755
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG" with expression '0x1039', CType: int.
Definition: CL.java:241
static final int CL_FP_ROUND_TO_ZERO
Define "CL_FP_ROUND_TO_ZERO" with expression '(1 << 3)', CType: int.
Definition: CL.java:495
static final int CL_DEVICE_MAX_COMPUTE_UNITS
Define "CL_DEVICE_MAX_COMPUTE_UNITS" with expression '0x1002', CType: int.
Definition: CL.java:115
static final int CL_DEVICE_IMAGE2D_MAX_HEIGHT
Define "CL_DEVICE_IMAGE2D_MAX_HEIGHT" with expression '0x1012', CType: int.
Definition: CL.java:49
static final int CL_DEVICE_PROFILE
Define "CL_DEVICE_PROFILE" with expression '0x102E', CType: int.
Definition: CL.java:613
static final int CL_DEVICE_PROFILING_TIMER_RESOLUTION
Define "CL_DEVICE_PROFILING_TIMER_RESOLUTION" with expression '0x1025', CType: int.
Definition: CL.java:99
static final int CL_DEVICE_GLOBAL_MEM_SIZE
Define "CL_DEVICE_GLOBAL_MEM_SIZE" with expression '0x101F', CType: int.
Definition: CL.java:461
static final int CL_DEVICE_MAX_READ_IMAGE_ARGS
Define "CL_DEVICE_MAX_READ_IMAGE_ARGS" with expression '0x100E', CType: int.
Definition: CL.java:689
static final int CL_DEVICE_GLOBAL_MEM_CACHE_TYPE
Define "CL_DEVICE_GLOBAL_MEM_CACHE_TYPE" with expression '0x101C', CType: int.
Definition: CL.java:293
static final int CL_LOCAL
Define "CL_LOCAL" with expression '0x1', CType: int.
Definition: CL.java:277
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR" with expression '0x1006', CType: int.
Definition: CL.java:335
static final int CL_DEVICE_TYPE_GPU
Define "CL_DEVICE_TYPE_GPU" with expression '(1 << 2)', CType: int.
Definition: CL.java:51
static final int CL_FP_FMA
Define "CL_FP_FMA" with expression '(1 << 5)', CType: int.
Definition: CL.java:359
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT" with expression '0x1037', CType: int.
Definition: CL.java:221
static final long CL_DEVICE_TYPE_ALL
Define "CL_DEVICE_TYPE_ALL" with expression '0xFFFFFFFF', CType: long.
Definition: CL.java:647
static final int CL_DEVICE_MAX_PARAMETER_SIZE
Define "CL_DEVICE_MAX_PARAMETER_SIZE" with expression '0x1017', CType: int.
Definition: CL.java:367
static final int CL_DEVICE_TYPE_DEFAULT
Define "CL_DEVICE_TYPE_DEFAULT" with expression '(1 << 0)', CType: int.
Definition: CL.java:577
static final int CL_DEVICE_TYPE_ACCELERATOR
Define "CL_DEVICE_TYPE_ACCELERATOR" with expression '(1 << 3)', CType: int.
Definition: CL.java:303
static final int CL_DEVICE_QUEUE_PROPERTIES
Define "CL_DEVICE_QUEUE_PROPERTIES" with expression '0x102A', CType: int.
Definition: CL.java:723
static final int CL_DEVICE_ADDRESS_BITS
Define "CL_DEVICE_ADDRESS_BITS" with expression '0x100D', CType: int.
Definition: CL.java:475
static final int CL_DEVICE_COMPILER_AVAILABLE
Define "CL_DEVICE_COMPILER_AVAILABLE" with expression '0x1028', CType: int.
Definition: CL.java:305
static final int CL_DEVICE_VENDOR_ID
Define "CL_DEVICE_VENDOR_ID" with expression '0x1001', CType: int.
Definition: CL.java:767
static final int CL_DEVICE_DOUBLE_FP_CONFIG
Define "CL_DEVICE_DOUBLE_FP_CONFIG" with expression '0x1032', CType: int.
Definition: CL.java:651
static final int CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE
Define "CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE" with expression '0x101D', CType: int.
Definition: CL.java:581
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT" with expression '0x100A', CType: int.
Definition: CL.java:145
static final int CL_DEVICE_VERSION
Define "CL_DEVICE_VERSION" with expression '0x102F', CType: int.
Definition: CL.java:669
static final int CL_DEVICE_ENDIAN_LITTLE
Define "CL_DEVICE_ENDIAN_LITTLE" with expression '0x1026', CType: int.
Definition: CL.java:781
static final int CL_DEVICE_HALF_FP_CONFIG
Define "CL_DEVICE_HALF_FP_CONFIG" with expression '0x1033', CType: int.
Definition: CL.java:301
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR" with expression '0x1036', CType: int.
Definition: CL.java:437
static final int CL_DEVICE_GLOBAL_MEM_CACHE_SIZE
Define "CL_DEVICE_GLOBAL_MEM_CACHE_SIZE" with expression '0x101E', CType: int.
Definition: CL.java:489
static final int CL_DEVICE_MEM_BASE_ADDR_ALIGN
Define "CL_DEVICE_MEM_BASE_ADDR_ALIGN" with expression '0x1019', CType: int.
Definition: CL.java:675
static final int CL_NONE
Define "CL_NONE" with expression '0x0', CType: int.
Definition: CL.java:463
static final int CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
Define "CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE" with expression '0x1020', CType: int.
Definition: CL.java:747
static final int CL_DEVICE_MAX_CONSTANT_ARGS
Define "CL_DEVICE_MAX_CONSTANT_ARGS" with expression '0x1021', CType: int.
Definition: CL.java:459
static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT
Define "CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT" with expression '0x103A', CType: int.
Definition: CL.java:331
static final int CL_EXEC_KERNEL
Define "CL_EXEC_KERNEL" with expression '(1 << 0)', CType: int.
Definition: CL.java:281
static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT
Define "CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT" with expression '0x1008', CType: int.
Definition: CL.java:703
static final int CL_DEVICE_EXTENSIONS
Define "CL_DEVICE_EXTENSIONS" with expression '0x1030', CType: int.
Definition: CL.java:379
static final int CL_EXEC_NATIVE_KERNEL
Define "CL_EXEC_NATIVE_KERNEL" with expression '(1 << 1)', CType: int.
Definition: CL.java:783
static final int CL_DEVICE_ERROR_CORRECTION_SUPPORT
Define "CL_DEVICE_ERROR_CORRECTION_SUPPORT" with expression '0x1024', CType: int.
Definition: CL.java:779
CLInfoAccessor createDeviceInfoAccessor(CL cl, long id)
Internal utility for common OpenCL clGetFooInfo calls.
long getLong(int key)
Returns the long value for the given key.
long getUInt32Long(int key)
Returns the uint32_t value for the given key, reinterpreted as a long value.
String getString(int key)
Returns the String value for the given key.