summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLException.java
blob: c74b99bca7913df85a7834aff0a2378664e6eb98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
/*
 * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of JogAmp Community.
 */

package com.jogamp.opencl;

import com.jogamp.opencl.llb.gl.CLGL;
import com.jogamp.opencl.llb.CL;
import com.jogamp.opencl.llb.CLDeviceBinding;
import com.jogamp.opencl.llb.CLImageBinding;
import com.jogamp.opencl.llb.CLMemObjBinding;
import com.jogamp.opencl.llb.CLPlatformBinding;
import com.jogamp.opencl.llb.CLProgramBinding;

/**
 * Main Exception type for runtime OpenCL errors and failed function calls (e.g. returning not CL_SUCCESS).
 * @author Michael Bien
 */
public class CLException extends RuntimeException {

    // must be positive
    private static final long serialVersionUID = 6573520735486076436L;

    public final int errorcode;
    public final String error;

    //man page no longer exists
//    private final static String ERROR_CODE_DOC =
//            "http://www.khronos.org/opencl/sdk/1.1/docs/man/xhtml/errors.html";

    public CLException(final String message) {
        super(message);
        errorcode = 0;
        error = "none";
    }

    private CLException(final int errorcode, final String errorStr, final String message) {
        super(message + " [error: " + errorStr+"]"/* + " (man page: "+ERROR_CODE_DOC+")"*/);
        this.error = errorStr;
        this.errorcode = errorcode;
    }

    /**
     * Throws a CLException when <code>status != CL_SUCCESS</code>.
     */
    public static void checkForError(final int status, final String message) {
        if(status != CL.CL_SUCCESS) {
            final CLException ex = newException(status, message);
            ex.fillInStackTrace();
            throw ex;
        }
    }

    /**
     * Returns a CLException specific to the error code.
     */
    public static CLException newException(final int status, final String message) {
        final CLException specificEx = createSpecificException(status, message);
        if(specificEx != null) {
            specificEx.fillInStackTrace();
            return specificEx;
        }
        return new CLException(status, "unknown", "unknown cause: code " + status);
    }

    /**
     * Returns a human readable String for the OpenCL error code.
     */
    public String getCLErrorString() {
        return error;
    }


     // - - - generated code do not edit - - -

    /**
     * Returns a human readable String for the OpenCL error code or null if not known.
     */
    public static String resolveErrorCode(final int error) {
        switch(error) {
            case CLDeviceBinding.CL_DEVICE_NOT_FOUND:                       return "CL_DEVICE_NOT_FOUND";
            case CLDeviceBinding.CL_DEVICE_NOT_AVAILABLE:                   return "CL_DEVICE_NOT_AVAILABLE";
            case CL.CL_COMPILER_NOT_AVAILABLE:                 return "CL_COMPILER_NOT_AVAILABLE";
            case CLMemObjBinding.CL_MEM_OBJECT_ALLOCATION_FAILURE:          return "CL_MEM_OBJECT_ALLOCATION_FAILURE";
            case CL.CL_OUT_OF_RESOURCES:                       return "CL_OUT_OF_RESOURCES";
            case CL.CL_OUT_OF_HOST_MEMORY:                     return "CL_OUT_OF_HOST_MEMORY";
            case CL.CL_PROFILING_INFO_NOT_AVAILABLE:           return "CL_PROFILING_INFO_NOT_AVAILABLE";
            case CLMemObjBinding.CL_MEM_COPY_OVERLAP:                       return "CL_MEM_COPY_OVERLAP";
            case CLImageBinding.CL_IMAGE_FORMAT_MISMATCH:                  return "CL_IMAGE_FORMAT_MISMATCH";
            case CLImageBinding.CL_IMAGE_FORMAT_NOT_SUPPORTED:             return "CL_IMAGE_FORMAT_NOT_SUPPORTED";
            case CLProgramBinding.CL_BUILD_PROGRAM_FAILURE:                  return "CL_BUILD_PROGRAM_FAILURE";
            case CLMemObjBinding.CL_MAP_FAILURE:                            return "CL_MAP_FAILURE";
            case CL.CL_INVALID_VALUE:                          return "CL_INVALID_VALUE";
            case CL.CL_INVALID_DEVICE_TYPE:                    return "CL_INVALID_DEVICE_TYPE";
            case CL.CL_INVALID_PLATFORM:                       return "CL_INVALID_PLATFORM";
            case CL.CL_INVALID_DEVICE:                         return "CL_INVALID_DEVICE";
            case CL.CL_INVALID_CONTEXT:                        return "CL_INVALID_CONTEXT";
            case CL.CL_INVALID_QUEUE_PROPERTIES:               return "CL_INVALID_QUEUE_PROPERTIES";
            case CL.CL_INVALID_COMMAND_QUEUE:                  return "CL_INVALID_COMMAND_QUEUE";
            case CL.CL_INVALID_HOST_PTR:                       return "CL_INVALID_HOST_PTR";
            case CL.CL_INVALID_MEM_OBJECT:                     return "CL_INVALID_MEM_OBJECT";
            case CL.CL_INVALID_IMAGE_FORMAT_DESCRIPTOR:        return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR";
            case CL.CL_INVALID_IMAGE_SIZE:                     return "CL_INVALID_IMAGE_SIZE";
            case CL.CL_INVALID_SAMPLER:                        return "CL_INVALID_SAMPLER";
            case CL.CL_INVALID_BINARY:                         return "CL_INVALID_BINARY";
            case CL.CL_INVALID_BUILD_OPTIONS:                  return "CL_INVALID_BUILD_OPTIONS";
            case CL.CL_INVALID_PROGRAM:                        return "CL_INVALID_PROGRAM";
            case CL.CL_INVALID_PROGRAM_EXECUTABLE:             return "CL_INVALID_PROGRAM_EXECUTABLE";
            case CL.CL_INVALID_KERNEL_NAME:                    return "CL_INVALID_KERNEL_NAME";
            case CL.CL_INVALID_KERNEL_DEFINITION:              return "CL_INVALID_KERNEL_DEFINITION";
            case CL.CL_INVALID_KERNEL:                         return "CL_INVALID_KERNEL";
            case CL.CL_INVALID_ARG_INDEX:                      return "CL_INVALID_ARG_INDEX";
            case CL.CL_INVALID_ARG_VALUE:                      return "CL_INVALID_ARG_VALUE";
            case CL.CL_INVALID_ARG_SIZE:                       return "CL_INVALID_ARG_SIZE";
            case CL.CL_INVALID_KERNEL_ARGS:                    return "CL_INVALID_KERNEL_ARGS";
            case CL.CL_INVALID_WORK_DIMENSION:                 return "CL_INVALID_WORK_DIMENSION";
            case CL.CL_INVALID_WORK_GROUP_SIZE:                return "CL_INVALID_WORK_GROUP_SIZE";
            case CL.CL_INVALID_WORK_ITEM_SIZE:                 return "CL_INVALID_WORK_ITEM_SIZE";
            case CL.CL_INVALID_GLOBAL_OFFSET:                  return "CL_INVALID_GLOBAL_OFFSET";
            case CL.CL_INVALID_EVENT_WAIT_LIST:                return "CL_INVALID_EVENT_WAIT_LIST";
            case CL.CL_INVALID_EVENT:                          return "CL_INVALID_EVENT";
            case CL.CL_INVALID_OPERATION:                      return "CL_INVALID_OPERATION";
            case CL.CL_INVALID_BUFFER_SIZE:                    return "CL_INVALID_BUFFER_SIZE";
            case CL.CL_INVALID_MIP_LEVEL:                      return "CL_INVALID_MIP_LEVEL";
            case CL.CL_INVALID_GLOBAL_WORK_SIZE:               return "CL_INVALID_GLOBAL_WORK_SIZE";
            case CL.CL_INVALID_PROPERTY:                       return "CL_INVALID_PROPERTY";
            case CLPlatformBinding.CL_PLATFORM_NOT_FOUND_KHR:                 return "CL_PLATFORM_NOT_FOUND_KHR";
            case CL.CL_MISALIGNED_SUB_BUFFER_OFFSET:             return "CL_MISALIGNED_SUB_BUFFER_OFFSET";
            case CL.CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST:  return "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST";
            case CLGL.CL_INVALID_GL_OBJECT:                    return "CL_INVALID_GL_OBJECT";
            case CLGL.CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR:  return "CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR";
            default: return null;
        }
    }

    private static CLException createSpecificException(final int error, final String message) {
        switch(error) {
            case CLDeviceBinding.CL_DEVICE_NOT_FOUND:                       return new CLDeviceNotFoundException(message);
            case CLDeviceBinding.CL_DEVICE_NOT_AVAILABLE:                   return new CLDeviceNotAvailableException(message);
            case CL.CL_COMPILER_NOT_AVAILABLE:                 return new CLCompilerNotAvailableException(message);
            case CLMemObjBinding.CL_MEM_OBJECT_ALLOCATION_FAILURE:          return new CLMemObjectAllocationFailureException(message);
            case CL.CL_OUT_OF_RESOURCES:                       return new CLOutOfResourcesException(message);
            case CL.CL_OUT_OF_HOST_MEMORY:                     return new CLOutOfHostMemoryException(message);
            case CL.CL_PROFILING_INFO_NOT_AVAILABLE:           return new CLProfilingInfoNotAvailableException(message);
            case CLMemObjBinding.CL_MEM_COPY_OVERLAP:                       return new CLMemCopyOverlapException(message);
            case CLImageBinding.CL_IMAGE_FORMAT_MISMATCH:                  return new CLImageFormatMismatchException(message);
            case CLImageBinding.CL_IMAGE_FORMAT_NOT_SUPPORTED:             return new CLImageFormatNotSupportedException(message);
            case CLProgramBinding.CL_BUILD_PROGRAM_FAILURE:                  return new CLBuildProgramFailureException(message);
            case CLMemObjBinding.CL_MAP_FAILURE:                            return new CLMapFailureException(message);
            case CL.CL_INVALID_VALUE:                          return new CLInvalidValueException(message);
            case CL.CL_INVALID_DEVICE_TYPE:                    return new CLInvalidDeviceTypeException(message);
            case CL.CL_INVALID_PLATFORM:                       return new CLInvalidPlatformException(message);
            case CL.CL_INVALID_DEVICE:                         return new CLInvalidDeviceException(message);
            case CL.CL_INVALID_CONTEXT:                        return new CLInvalidContextException(message);
            case CL.CL_INVALID_QUEUE_PROPERTIES:               return new CLInvalidQueuePropertiesException(message);
            case CL.CL_INVALID_COMMAND_QUEUE:                  return new CLInvalidCommandQueueException(message);
            case CL.CL_INVALID_HOST_PTR:                       return new CLInvalidHostPtrException(message);
            case CL.CL_INVALID_MEM_OBJECT:                     return new CLInvalidMemObjectException(message);
            case CL.CL_INVALID_IMAGE_FORMAT_DESCRIPTOR:        return new CLInvalidImageFormatDescriptorException(message);
            case CL.CL_INVALID_IMAGE_SIZE:                     return new CLInvalidImageSizeException(message);
            case CL.CL_INVALID_SAMPLER:                        return new CLInvalidSamplerException(message);
            case CL.CL_INVALID_BINARY:                         return new CLInvalidBinaryException(message);
            case CL.CL_INVALID_BUILD_OPTIONS:                  return new CLInvalidBuildOptionsException(message);
            case CL.CL_INVALID_PROGRAM:                        return new CLInvalidProgramException(message);
            case CL.CL_INVALID_PROGRAM_EXECUTABLE:             return new CLInvalidProgramExecutableException(message);
            case CL.CL_INVALID_KERNEL_NAME:                    return new CLInvalidKernelNameException(message);
            case CL.CL_INVALID_KERNEL_DEFINITION:              return new CLInvalidKernelDefinitionException(message);
            case CL.CL_INVALID_KERNEL:                         return new CLInvalidKernelException(message);
            case CL.CL_INVALID_ARG_INDEX:                      return new CLInvalidArgIndexException(message);
            case CL.CL_INVALID_ARG_VALUE:                      return new CLInvalidArgValueException(message);
            case CL.CL_INVALID_ARG_SIZE:                       return new CLInvalidArgSizeException(message);
            case CL.CL_INVALID_KERNEL_ARGS:                    return new CLInvalidKernelArgsException(message);
            case CL.CL_INVALID_WORK_DIMENSION:                 return new CLInvalidWorkDimensionException(message);
            case CL.CL_INVALID_WORK_GROUP_SIZE:                return new CLInvalidWorkGroupSizeException(message);
            case CL.CL_INVALID_WORK_ITEM_SIZE:                 return new CLInvalidWorkItemSizeException(message);
            case CL.CL_INVALID_GLOBAL_OFFSET:                  return new CLInvalidGlobalOffsetException(message);
            case CL.CL_INVALID_EVENT_WAIT_LIST:                return new CLInvalidEventWaitListException(message);
            case CL.CL_INVALID_EVENT:                          return new CLInvalidEventException(message);
            case CL.CL_INVALID_OPERATION:                      return new CLInvalidOperationException(message);
            case CL.CL_INVALID_BUFFER_SIZE:                    return new CLInvalidBufferSizeException(message);
            case CL.CL_INVALID_MIP_LEVEL:                      return new CLInvalidMipLevelException(message);
            case CL.CL_INVALID_GLOBAL_WORK_SIZE:               return new CLInvalidGlobalWorkSizeException(message);
            case CL.CL_INVALID_PROPERTY:                       return new CLInvalidPropertyException(message);
            case CLPlatformBinding.CL_PLATFORM_NOT_FOUND_KHR:                 return new CLPlatformNotFoundKhrException(message);
            case CL.CL_MISALIGNED_SUB_BUFFER_OFFSET:             return new CLMisalignedSubBufferOffsetException(message);
            case CL.CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST:  return new CLExecStatusErrorForEventsInWaitListException(message);
            case CLGL.CL_INVALID_GL_OBJECT:                    return new CLInvalidGLObjectException(message);
            case CLGL.CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR:  return new CLInvalidGLSharegroupReferenceKhrException(message);
            default: return null;
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_DEVICE_NOT_FOUND errors.
     */
    public final static class CLDeviceNotFoundException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_DEVICE_NOT_FOUND;
        public CLDeviceNotFoundException(final String message) {
            super(CLDeviceBinding.CL_DEVICE_NOT_FOUND, "CL_DEVICE_NOT_FOUND", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_DEVICE_NOT_AVAILABLE errors.
     */
    public final static class CLDeviceNotAvailableException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_DEVICE_NOT_AVAILABLE;
        public CLDeviceNotAvailableException(final String message) {
            super(CLDeviceBinding.CL_DEVICE_NOT_AVAILABLE, "CL_DEVICE_NOT_AVAILABLE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_COMPILER_NOT_AVAILABLE errors.
     */
    public final static class CLCompilerNotAvailableException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_COMPILER_NOT_AVAILABLE;
        public CLCompilerNotAvailableException(final String message) {
            super(CL.CL_COMPILER_NOT_AVAILABLE, "CL_COMPILER_NOT_AVAILABLE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_MEM_OBJECT_ALLOCATION_FAILURE errors.
     */
    public final static class CLMemObjectAllocationFailureException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_MEM_OBJECT_ALLOCATION_FAILURE;
        public CLMemObjectAllocationFailureException(final String message) {
            super(CLMemObjBinding.CL_MEM_OBJECT_ALLOCATION_FAILURE, "CL_MEM_OBJECT_ALLOCATION_FAILURE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_OUT_OF_RESOURCES errors.
     */
    public final static class CLOutOfResourcesException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_OUT_OF_RESOURCES;
        public CLOutOfResourcesException(final String message) {
            super(CL.CL_OUT_OF_RESOURCES, "CL_OUT_OF_RESOURCES", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_OUT_OF_HOST_MEMORY errors.
     */
    public final static class CLOutOfHostMemoryException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_OUT_OF_HOST_MEMORY;
        public CLOutOfHostMemoryException(final String message) {
            super(CL.CL_OUT_OF_HOST_MEMORY, "CL_OUT_OF_HOST_MEMORY", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_PROFILING_INFO_NOT_AVAILABLE errors.
     */
    public final static class CLProfilingInfoNotAvailableException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_PROFILING_INFO_NOT_AVAILABLE;
        public CLProfilingInfoNotAvailableException(final String message) {
            super(CL.CL_PROFILING_INFO_NOT_AVAILABLE, "CL_PROFILING_INFO_NOT_AVAILABLE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_MEM_COPY_OVERLAP errors.
     */
    public final static class CLMemCopyOverlapException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_MEM_COPY_OVERLAP;
        public CLMemCopyOverlapException(final String message) {
            super(CLMemObjBinding.CL_MEM_COPY_OVERLAP, "CL_MEM_COPY_OVERLAP", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_IMAGE_FORMAT_MISMATCH errors.
     */
    public final static class CLImageFormatMismatchException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_IMAGE_FORMAT_MISMATCH;
        public CLImageFormatMismatchException(final String message) {
            super(CLImageBinding.CL_IMAGE_FORMAT_MISMATCH, "CL_IMAGE_FORMAT_MISMATCH", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_IMAGE_FORMAT_NOT_SUPPORTED errors.
     */
    public final static class CLImageFormatNotSupportedException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_IMAGE_FORMAT_NOT_SUPPORTED;
        public CLImageFormatNotSupportedException(final String message) {
            super(CLImageBinding.CL_IMAGE_FORMAT_NOT_SUPPORTED, "CL_IMAGE_FORMAT_NOT_SUPPORTED", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_BUILD_PROGRAM_FAILURE errors.
     */
    public final static class CLBuildProgramFailureException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_BUILD_PROGRAM_FAILURE;
        public CLBuildProgramFailureException(final String message) {
            super(CLProgramBinding.CL_BUILD_PROGRAM_FAILURE, "CL_BUILD_PROGRAM_FAILURE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_MAP_FAILURE errors.
     */
    public final static class CLMapFailureException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_MAP_FAILURE;
        public CLMapFailureException(final String message) {
            super(CLMemObjBinding.CL_MAP_FAILURE, "CL_MAP_FAILURE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_VALUE errors.
     *
     */
    public final static class CLInvalidValueException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_VALUE;
        public CLInvalidValueException(final String message) {
            super(CL.CL_INVALID_VALUE, "CL_INVALID_VALUE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_DEVICE_TYPE errors.
     *
     */
    public final static class CLInvalidDeviceTypeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_DEVICE_TYPE;
        public CLInvalidDeviceTypeException(final String message) {
            super(CL.CL_INVALID_DEVICE_TYPE, "CL_INVALID_DEVICE_TYPE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_PLATFORM errors.
     *
     */
    public final static class CLInvalidPlatformException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_PLATFORM;
        public CLInvalidPlatformException(final String message) {
            super(CL.CL_INVALID_PLATFORM, "CL_INVALID_PLATFORM", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_DEVICE errors.
     *
     */
    public final static class CLInvalidDeviceException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_DEVICE;
        public CLInvalidDeviceException(final String message) {
            super(CL.CL_INVALID_DEVICE, "CL_INVALID_DEVICE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_CONTEXT errors.
     *
     */
    public final static class CLInvalidContextException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_CONTEXT;
        public CLInvalidContextException(final String message) {
            super(CL.CL_INVALID_CONTEXT, "CL_INVALID_CONTEXT", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_QUEUE_PROPERTIES errors.
     *
     */
    public final static class CLInvalidQueuePropertiesException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_QUEUE_PROPERTIES;
        public CLInvalidQueuePropertiesException(final String message) {
            super(CL.CL_INVALID_QUEUE_PROPERTIES, "CL_INVALID_QUEUE_PROPERTIES", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_COMMAND_QUEUE errors.
     *
     */
    public final static class CLInvalidCommandQueueException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_COMMAND_QUEUE;
        public CLInvalidCommandQueueException(final String message) {
            super(CL.CL_INVALID_COMMAND_QUEUE, "CL_INVALID_COMMAND_QUEUE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_HOST_PTR errors.
     *
     */
    public final static class CLInvalidHostPtrException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_HOST_PTR;
        public CLInvalidHostPtrException(final String message) {
            super(CL.CL_INVALID_HOST_PTR, "CL_INVALID_HOST_PTR", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_MEM_OBJECT errors.
     *
     */
    public final static class CLInvalidMemObjectException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_MEM_OBJECT;
        public CLInvalidMemObjectException(final String message) {
            super(CL.CL_INVALID_MEM_OBJECT, "CL_INVALID_MEM_OBJECT", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_IMAGE_FORMAT_DESCRIPTOR errors.
     *
     */
    public final static class CLInvalidImageFormatDescriptorException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_IMAGE_FORMAT_DESCRIPTOR;
        public CLInvalidImageFormatDescriptorException(final String message) {
            super(CL.CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_IMAGE_SIZE errors.
     *
     */
    public final static class CLInvalidImageSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_IMAGE_SIZE;
        public CLInvalidImageSizeException(final String message) {
            super(CL.CL_INVALID_IMAGE_SIZE, "CL_INVALID_IMAGE_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_SAMPLER errors.
     *
     */
    public final static class CLInvalidSamplerException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_SAMPLER;
        public CLInvalidSamplerException(final String message) {
            super(CL.CL_INVALID_SAMPLER, "CL_INVALID_SAMPLER", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_BINARY errors.
     *
     */
    public final static class CLInvalidBinaryException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_BINARY;
        public CLInvalidBinaryException(final String message) {
            super(CL.CL_INVALID_BINARY, "CL_INVALID_BINARY", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_BUILD_OPTIONS errors.
     *
     */
    public final static class CLInvalidBuildOptionsException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_BUILD_OPTIONS;
        public CLInvalidBuildOptionsException(final String message) {
            super(CL.CL_INVALID_BUILD_OPTIONS, "CL_INVALID_BUILD_OPTIONS", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_PROGRAM errors.
     *
     */
    public final static class CLInvalidProgramException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_PROGRAM;
        public CLInvalidProgramException(final String message) {
            super(CL.CL_INVALID_PROGRAM, "CL_INVALID_PROGRAM", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_PROGRAM_EXECUTABLE errors.
     *
     */
    public final static class CLInvalidProgramExecutableException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_PROGRAM_EXECUTABLE;
        public CLInvalidProgramExecutableException(final String message) {
            super(CL.CL_INVALID_PROGRAM_EXECUTABLE, "CL_INVALID_PROGRAM_EXECUTABLE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_KERNEL_NAME errors.
     *
     */
    public final static class CLInvalidKernelNameException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_KERNEL_NAME;
        public CLInvalidKernelNameException(final String message) {
            super(CL.CL_INVALID_KERNEL_NAME, "CL_INVALID_KERNEL_NAME", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_KERNEL_DEFINITION errors.
     *
     */
    public final static class CLInvalidKernelDefinitionException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_KERNEL_DEFINITION;
        public CLInvalidKernelDefinitionException(final String message) {
            super(CL.CL_INVALID_KERNEL_DEFINITION, "CL_INVALID_KERNEL_DEFINITION", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_KERNEL errors.
     *
     */
    public final static class CLInvalidKernelException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_KERNEL;
        public CLInvalidKernelException(final String message) {
            super(CL.CL_INVALID_KERNEL, "CL_INVALID_KERNEL", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_ARG_INDEX errors.
     *
     */
    public final static class CLInvalidArgIndexException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_ARG_INDEX;
        public CLInvalidArgIndexException(final String message) {
            super(CL.CL_INVALID_ARG_INDEX, "CL_INVALID_ARG_INDEX", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_ARG_VALUE errors.
     *
     */
    public final static class CLInvalidArgValueException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_ARG_VALUE;
        public CLInvalidArgValueException(final String message) {
            super(CL.CL_INVALID_ARG_VALUE, "CL_INVALID_ARG_VALUE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_ARG_SIZE errors.
     *
     */
    public final static class CLInvalidArgSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_ARG_SIZE;
        public CLInvalidArgSizeException(final String message) {
            super(CL.CL_INVALID_ARG_SIZE, "CL_INVALID_ARG_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_KERNEL_ARGS errors.
     *
     */
    public final static class CLInvalidKernelArgsException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_KERNEL_ARGS;
        public CLInvalidKernelArgsException(final String message) {
            super(CL.CL_INVALID_KERNEL_ARGS, "CL_INVALID_KERNEL_ARGS", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_WORK_DIMENSION errors.
     *
     */
    public final static class CLInvalidWorkDimensionException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_WORK_DIMENSION;
        public CLInvalidWorkDimensionException(final String message) {
            super(CL.CL_INVALID_WORK_DIMENSION, "CL_INVALID_WORK_DIMENSION", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_WORK_GROUP_SIZE errors.
     *
     */
    public final static class CLInvalidWorkGroupSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_WORK_GROUP_SIZE;
        public CLInvalidWorkGroupSizeException(final String message) {
            super(CL.CL_INVALID_WORK_GROUP_SIZE, "CL_INVALID_WORK_GROUP_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_WORK_ITEM_SIZE errors.
     *
     */
    public final static class CLInvalidWorkItemSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_WORK_ITEM_SIZE;
        public CLInvalidWorkItemSizeException(final String message) {
            super(CL.CL_INVALID_WORK_ITEM_SIZE, "CL_INVALID_WORK_ITEM_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_GLOBAL_OFFSET errors.
     *
     */
    public final static class CLInvalidGlobalOffsetException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_GLOBAL_OFFSET;
        public CLInvalidGlobalOffsetException(final String message) {
            super(CL.CL_INVALID_GLOBAL_OFFSET, "CL_INVALID_GLOBAL_OFFSET", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_EVENT_WAIT_LIST errors.
     *
     */
    public final static class CLInvalidEventWaitListException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_EVENT_WAIT_LIST;
        public CLInvalidEventWaitListException(final String message) {
            super(CL.CL_INVALID_EVENT_WAIT_LIST, "CL_INVALID_EVENT_WAIT_LIST", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_EVENT errors.
     *
     */
    public final static class CLInvalidEventException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_EVENT;
        public CLInvalidEventException(final String message) {
            super(CL.CL_INVALID_EVENT, "CL_INVALID_EVENT", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_OPERATION errors.
     *
     */
    public final static class CLInvalidOperationException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_OPERATION;
        public CLInvalidOperationException(final String message) {
            super(CL.CL_INVALID_OPERATION, "CL_INVALID_OPERATION", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_GL_OBJECT errors.
     *
     */
    public final static class CLInvalidGLObjectException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CLGL.CL_INVALID_GL_OBJECT;
        public CLInvalidGLObjectException(final String message) {
            super(CLGL.CL_INVALID_GL_OBJECT, "CL_INVALID_GL_OBJECT", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_BUFFER_SIZE errors.
     *
     */
    public final static class CLInvalidBufferSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_BUFFER_SIZE;
        public CLInvalidBufferSizeException(final String message) {
            super(CL.CL_INVALID_BUFFER_SIZE, "CL_INVALID_BUFFER_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_MIP_LEVEL errors.
     *
     */
    public final static class CLInvalidMipLevelException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_MIP_LEVEL;
        public CLInvalidMipLevelException(final String message) {
            super(CL.CL_INVALID_MIP_LEVEL, "CL_INVALID_MIP_LEVEL", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_GLOBAL_WORK_SIZE errors.
     *
     */
    public final static class CLInvalidGlobalWorkSizeException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_GLOBAL_WORK_SIZE;
        public CLInvalidGlobalWorkSizeException(final String message) {
            super(CL.CL_INVALID_GLOBAL_WORK_SIZE, "CL_INVALID_GLOBAL_WORK_SIZE", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_PROPERTY errors.
     *
     */
    public final static class CLInvalidPropertyException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_INVALID_PROPERTY;
        public CLInvalidPropertyException(final String message) {
            super(CL.CL_INVALID_PROPERTY, "CL_INVALID_PROPERTY", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR errors.
     *
     */
    public final static class CLInvalidGLSharegroupReferenceKhrException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CLGL.CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR;
        public CLInvalidGLSharegroupReferenceKhrException(final String message) {
            super(CLGL.CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR, "CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_PLATFORM_NOT_FOUND_KHR errors.
     *
     */
    public final static class CLPlatformNotFoundKhrException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_PLATFORM_NOT_FOUND_KHR;
        public CLPlatformNotFoundKhrException(final String message) {
            super(CLPlatformBinding.CL_PLATFORM_NOT_FOUND_KHR, "CL_PLATFORM_NOT_FOUND_KHR", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_MISALIGNED_SUB_BUFFER_OFFSET errors.
     *
     */
    public final static class CLMisalignedSubBufferOffsetException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_MISALIGNED_SUB_BUFFER_OFFSET;
        public CLMisalignedSubBufferOffsetException(final String message) {
            super(CL.CL_MISALIGNED_SUB_BUFFER_OFFSET, "CL_MISALIGNED_SUB_BUFFER_OFFSET", message);
        }
    }

    /**
     * {@link CLException} thrown on CL.CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST errors.
     *
     */
    public final static class CLExecStatusErrorForEventsInWaitListException extends CLException {
        private static final long serialVersionUID = CLException.serialVersionUID+CL.CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST;
        public CLExecStatusErrorForEventsInWaitListException(final String message) {
            super(CL.CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST", message);
        }
    }

}