OpenCL Getting Started in Ubuntu 20.10 LTS with Intel Graphics Card

###0. OpenCL is GPGPU
OpenCL is used for general-purpose computing on graphics processing unit.

Execute calculations parallelly to gain time optimization.

It runs simple calculations like addition and multiplication simultaneously, making ordinal for-loop asynchronous to reduce execution time from O(n^m) to O(n^m-k) (k∈N <= n | varying according to GPU specifications).

###1. Download driver
from [here](https://software.intel.com/content/www/us/en/develop/articles/opencl-drivers.html)
###2. Install lib
`sudo apt-get install intel-opencl-icd`
###3. Write codes

```.sh
mkdir hello-opencl && cd hello-opencl
touch gpu_add.cl
touch main.cpp
```
all of the following codes are taken from [here](https://www.eriksmistad.no/getting-started-with-opencl-and-gpu-computing/)

```.c:gpu_add.cl
__kernel void gpu_add(__global const int *A, __global const int *B,
                         __global int *C) {
  // Get the index of the current element to be processed
  int i = get_global_id(0);
  // Do the operation
  C[i] = A[i] + B[i];
}
```

```.cpp:main.cpp
#include <stdio.h>
#include <stdlib.h>
 
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
 
#define MAX_SOURCE_SIZE (0x100000)
 
int main(void) {
    // Create the two input vectors
    int i;
    const int LIST_SIZE = 1024;
    int *A = (int*)malloc(sizeof(int)*LIST_SIZE);
    int *B = (int*)malloc(sizeof(int)*LIST_SIZE);
    for(i = 0; i < LIST_SIZE; i++) {
        A[i] = i;
        B[i] = LIST_SIZE - i;
    }
 
    // Load the kernel source code into the array source_str
    FILE *fp;
    char *source_str;
    size_t source_size;
 
    fp = fopen("gpu_add.cl", "r");
    if (!fp) {
        fprintf(stderr, "Failed to load kernel.\n");
        exit(1);
    }
    source_str = (char*)malloc(MAX_SOURCE_SIZE);
    source_size = fread( source_str, 1, MAX_SOURCE_SIZE, fp);
    fclose( fp );
 
    // Get platform and device information
    cl_platform_id platform_id = NULL;
    cl_device_id device_id = NULL;   
    cl_uint ret_num_devices;
    cl_uint ret_num_platforms;
    cl_int ret = clGetPlatformIDs(1, &platform_id, &ret_num_platforms);
    ret = clGetDeviceIDs( platform_id, CL_DEVICE_TYPE_DEFAULT, 1, 
            &device_id, &ret_num_devices);
 
    // Create an OpenCL context
    cl_context context = clCreateContext( NULL, 1, &device_id, NULL, NULL, &ret);
 
    // Create a command queue
    cl_command_queue command_queue = clCreateCommandQueue(context, device_id, 0, &ret);
 
    // Create memory buffers on the device for each vector 
    cl_mem a_mem_obj = clCreateBuffer(context, CL_MEM_READ_ONLY, 
            LIST_SIZE * sizeof(int), NULL, &ret);
    cl_mem b_mem_obj = clCreateBuffer(context, CL_MEM_READ_ONLY,
            LIST_SIZE * sizeof(int), NULL, &ret);
    cl_mem c_mem_obj = clCreateBuffer(context, CL_MEM_WRITE_ONLY, 
            LIST_SIZE * sizeof(int), NULL, &ret);
 
    // Copy the lists A and B to their respective memory buffers
    ret = clEnqueueWriteBuffer(command_queue, a_mem_obj, CL_TRUE, 0,
            LIST_SIZE * sizeof(int), A, 0, NULL, NULL);
    ret = clEnqueueWriteBuffer(command_queue, b_mem_obj, CL_TRUE, 0, 
            LIST_SIZE * sizeof(int), B, 0, NULL, NULL);
 
    // Create a program from the kernel source
    cl_program program = clCreateProgramWithSource(context, 1, 
            (const char **)&source_str, (const size_t *)&source_size, &ret);
 
    // Build the program
    ret = clBuildProgram(program, 1, &device_id, NULL, NULL, NULL);
 
    // Create the OpenCL kernel
    cl_kernel kernel = clCreateKernel(program, "gpu_add", &ret);
 
    // Set the arguments of the kernel
    ret = clSetKernelArg(kernel, 0, sizeof(cl_mem), (void *)&a_mem_obj);
    ret = clSetKernelArg(kernel, 1, sizeof(cl_mem), (void *)&b_mem_obj);
    ret = clSetKernelArg(kernel, 2, sizeof(cl_mem), (void *)&c_mem_obj);
 
    // Execute the OpenCL kernel on the list
    size_t global_item_size = LIST_SIZE; // Process the entire lists
    size_t local_item_size = 64; // Divide work items into groups of 64
    ret = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, 
            &global_item_size, &local_item_size, 0, NULL, NULL);
 
    // Read the memory buffer C on the device to the local variable C
    int *C = (int*)malloc(sizeof(int)*LIST_SIZE);
    ret = clEnqueueReadBuffer(command_queue, c_mem_obj, CL_TRUE, 0, 
            LIST_SIZE * sizeof(int), C, 0, NULL, NULL);
 
    // Display the result to the screen
    for(i = 0; i < LIST_SIZE; i++)
        printf("%d + %d = %d\n", A[i], B[i], C[i]);
 
    // Clean up
    ret = clFlush(command_queue);
    ret = clFinish(command_queue);
    ret = clReleaseKernel(kernel);
    ret = clReleaseProgram(program);
    ret = clReleaseMemObject(a_mem_obj);
    ret = clReleaseMemObject(b_mem_obj);
    ret = clReleaseMemObject(c_mem_obj);
    ret = clReleaseCommandQueue(command_queue);
    ret = clReleaseContext(context);
    free(A);
    free(B);
    free(C);
    return 0;
}
```

###4. Build
`gcc main.cpp -o gpu_add -l OpenCL`
this command creates an executable named gpu_add

###5. Run the executable
`./gpu_add`

```.sh:output
0 + 1024 = 1024
1 + 1023 = 1024
2 + 1022 = 1024
3 + 1021 = 1024
4 + 1020 = 1024
5 + 1019 = 1024
6 + 1018 = 1024
7 + 1017 = 1024
8 + 1016 = 1024
9 + 1015 = 1024
10 + 1014 = 1024
11 + 1013 = 1024
12 + 1012 = 1024
13 + 1011 = 1024
14 + 1010 = 1024
15 + 1009 = 1024
16 + 1008 = 1024
17 + 1007 = 1024
18 + 1006 = 1024
19 + 1005 = 1024
20 + 1004 = 1024
21 + 1003 = 1024
22 + 1002 = 1024
23 + 1001 = 1024
24 + 1000 = 1024
25 + 999 = 1024
26 + 998 = 1024
27 + 997 = 1024
28 + 996 = 1024
29 + 995 = 1024
30 + 994 = 1024
31 + 993 = 1024
32 + 992 = 1024
33 + 991 = 1024
34 + 990 = 1024
35 + 989 = 1024
36 + 988 = 1024
37 + 987 = 1024
38 + 986 = 1024
39 + 985 = 1024
40 + 984 = 1024
41 + 983 = 1024
42 + 982 = 1024
43 + 981 = 1024
44 + 980 = 1024
45 + 979 = 1024
46 + 978 = 1024
47 + 977 = 1024
48 + 976 = 1024
49 + 975 = 1024
50 + 974 = 1024
51 + 973 = 1024
52 + 972 = 1024
53 + 971 = 1024
54 + 970 = 1024
55 + 969 = 1024
56 + 968 = 1024
57 + 967 = 1024
58 + 966 = 1024
59 + 965 = 1024
60 + 964 = 1024
61 + 963 = 1024
62 + 962 = 1024
63 + 961 = 1024
64 + 960 = 1024
65 + 959 = 1024
66 + 958 = 1024
67 + 957 = 1024
68 + 956 = 1024
69 + 955 = 1024
70 + 954 = 1024
71 + 953 = 1024
72 + 952 = 1024
73 + 951 = 1024
74 + 950 = 1024
75 + 949 = 1024
76 + 948 = 1024
77 + 947 = 1024
78 + 946 = 1024
79 + 945 = 1024
80 + 944 = 1024
81 + 943 = 1024
82 + 942 = 1024
83 + 941 = 1024
84 + 940 = 1024
85 + 939 = 1024
86 + 938 = 1024
87 + 937 = 1024
88 + 936 = 1024
89 + 935 = 1024
90 + 934 = 1024
91 + 933 = 1024
92 + 932 = 1024
93 + 931 = 1024
94 + 930 = 1024
95 + 929 = 1024
96 + 928 = 1024
97 + 927 = 1024
98 + 926 = 1024
99 + 925 = 1024
100 + 924 = 1024
101 + 923 = 1024
102 + 922 = 1024
103 + 921 = 1024
104 + 920 = 1024
105 + 919 = 1024
106 + 918 = 1024
107 + 917 = 1024
108 + 916 = 1024
109 + 915 = 1024
110 + 914 = 1024
111 + 913 = 1024
112 + 912 = 1024
113 + 911 = 1024
114 + 910 = 1024
115 + 909 = 1024
116 + 908 = 1024
117 + 907 = 1024
118 + 906 = 1024
119 + 905 = 1024
120 + 904 = 1024
121 + 903 = 1024
122 + 902 = 1024
123 + 901 = 1024
124 + 900 = 1024
125 + 899 = 1024
126 + 898 = 1024
127 + 897 = 1024
128 + 896 = 1024
129 + 895 = 1024
130 + 894 = 1024
131 + 893 = 1024
132 + 892 = 1024
133 + 891 = 1024
134 + 890 = 1024
135 + 889 = 1024
136 + 888 = 1024
137 + 887 = 1024
138 + 886 = 1024
139 + 885 = 1024
140 + 884 = 1024
141 + 883 = 1024
142 + 882 = 1024
143 + 881 = 1024
144 + 880 = 1024
145 + 879 = 1024
146 + 878 = 1024
147 + 877 = 1024
148 + 876 = 1024
149 + 875 = 1024
150 + 874 = 1024
151 + 873 = 1024
152 + 872 = 1024
153 + 871 = 1024
154 + 870 = 1024
155 + 869 = 1024
156 + 868 = 1024
157 + 867 = 1024
158 + 866 = 1024
159 + 865 = 1024
160 + 864 = 1024
161 + 863 = 1024
162 + 862 = 1024
163 + 861 = 1024
164 + 860 = 1024
165 + 859 = 1024
166 + 858 = 1024
167 + 857 = 1024
168 + 856 = 1024
169 + 855 = 1024
170 + 854 = 1024
171 + 853 = 1024
172 + 852 = 1024
173 + 851 = 1024
174 + 850 = 1024
175 + 849 = 1024
176 + 848 = 1024
177 + 847 = 1024
178 + 846 = 1024
179 + 845 = 1024
180 + 844 = 1024
181 + 843 = 1024
182 + 842 = 1024
183 + 841 = 1024
184 + 840 = 1024
185 + 839 = 1024
186 + 838 = 1024
187 + 837 = 1024
188 + 836 = 1024
189 + 835 = 1024
190 + 834 = 1024
191 + 833 = 1024
192 + 832 = 1024
193 + 831 = 1024
194 + 830 = 1024
195 + 829 = 1024
196 + 828 = 1024
197 + 827 = 1024
198 + 826 = 1024
199 + 825 = 1024
200 + 824 = 1024
201 + 823 = 1024
202 + 822 = 1024
203 + 821 = 1024
204 + 820 = 1024
205 + 819 = 1024
206 + 818 = 1024
207 + 817 = 1024
208 + 816 = 1024
209 + 815 = 1024
210 + 814 = 1024
211 + 813 = 1024
212 + 812 = 1024
213 + 811 = 1024
214 + 810 = 1024
215 + 809 = 1024
216 + 808 = 1024
217 + 807 = 1024
218 + 806 = 1024
219 + 805 = 1024
220 + 804 = 1024
221 + 803 = 1024
222 + 802 = 1024
223 + 801 = 1024
224 + 800 = 1024
225 + 799 = 1024
226 + 798 = 1024
227 + 797 = 1024
228 + 796 = 1024
229 + 795 = 1024
230 + 794 = 1024
231 + 793 = 1024
232 + 792 = 1024
233 + 791 = 1024
234 + 790 = 1024
235 + 789 = 1024
236 + 788 = 1024
237 + 787 = 1024
238 + 786 = 1024
239 + 785 = 1024
240 + 784 = 1024
241 + 783 = 1024
242 + 782 = 1024
243 + 781 = 1024
244 + 780 = 1024
245 + 779 = 1024
246 + 778 = 1024
247 + 777 = 1024
248 + 776 = 1024
249 + 775 = 1024
250 + 774 = 1024
251 + 773 = 1024
252 + 772 = 1024
253 + 771 = 1024
254 + 770 = 1024
255 + 769 = 1024
256 + 768 = 1024
257 + 767 = 1024
258 + 766 = 1024
259 + 765 = 1024
260 + 764 = 1024
261 + 763 = 1024
262 + 762 = 1024
263 + 761 = 1024
264 + 760 = 1024
265 + 759 = 1024
266 + 758 = 1024
267 + 757 = 1024
268 + 756 = 1024
269 + 755 = 1024
270 + 754 = 1024
271 + 753 = 1024
272 + 752 = 1024
273 + 751 = 1024
274 + 750 = 1024
275 + 749 = 1024
276 + 748 = 1024
277 + 747 = 1024
278 + 746 = 1024
279 + 745 = 1024
280 + 744 = 1024
281 + 743 = 1024
282 + 742 = 1024
283 + 741 = 1024
284 + 740 = 1024
285 + 739 = 1024
286 + 738 = 1024
287 + 737 = 1024
288 + 736 = 1024
289 + 735 = 1024
290 + 734 = 1024
291 + 733 = 1024
292 + 732 = 1024
293 + 731 = 1024
294 + 730 = 1024
295 + 729 = 1024
296 + 728 = 1024
297 + 727 = 1024
298 + 726 = 1024
299 + 725 = 1024
300 + 724 = 1024
301 + 723 = 1024
302 + 722 = 1024
303 + 721 = 1024
304 + 720 = 1024
305 + 719 = 1024
306 + 718 = 1024
307 + 717 = 1024
308 + 716 = 1024
309 + 715 = 1024
310 + 714 = 1024
311 + 713 = 1024
312 + 712 = 1024
313 + 711 = 1024
314 + 710 = 1024
315 + 709 = 1024
316 + 708 = 1024
317 + 707 = 1024
318 + 706 = 1024
319 + 705 = 1024
320 + 704 = 1024
321 + 703 = 1024
322 + 702 = 1024
323 + 701 = 1024
324 + 700 = 1024
325 + 699 = 1024
326 + 698 = 1024
327 + 697 = 1024
328 + 696 = 1024
329 + 695 = 1024
330 + 694 = 1024
331 + 693 = 1024
332 + 692 = 1024
333 + 691 = 1024
334 + 690 = 1024
335 + 689 = 1024
336 + 688 = 1024
337 + 687 = 1024
338 + 686 = 1024
339 + 685 = 1024
340 + 684 = 1024
341 + 683 = 1024
342 + 682 = 1024
343 + 681 = 1024
344 + 680 = 1024
345 + 679 = 1024
346 + 678 = 1024
347 + 677 = 1024
348 + 676 = 1024
349 + 675 = 1024
350 + 674 = 1024
351 + 673 = 1024
352 + 672 = 1024
353 + 671 = 1024
354 + 670 = 1024
355 + 669 = 1024
356 + 668 = 1024
357 + 667 = 1024
358 + 666 = 1024
359 + 665 = 1024
360 + 664 = 1024
361 + 663 = 1024
362 + 662 = 1024
363 + 661 = 1024
364 + 660 = 1024
365 + 659 = 1024
366 + 658 = 1024
367 + 657 = 1024
368 + 656 = 1024
369 + 655 = 1024
370 + 654 = 1024
371 + 653 = 1024
372 + 652 = 1024
373 + 651 = 1024
374 + 650 = 1024
375 + 649 = 1024
376 + 648 = 1024
377 + 647 = 1024
378 + 646 = 1024
379 + 645 = 1024
380 + 644 = 1024
381 + 643 = 1024
382 + 642 = 1024
383 + 641 = 1024
384 + 640 = 1024
385 + 639 = 1024
386 + 638 = 1024
387 + 637 = 1024
388 + 636 = 1024
389 + 635 = 1024
390 + 634 = 1024
391 + 633 = 1024
392 + 632 = 1024
393 + 631 = 1024
394 + 630 = 1024
395 + 629 = 1024
396 + 628 = 1024
397 + 627 = 1024
398 + 626 = 1024
399 + 625 = 1024
400 + 624 = 1024
401 + 623 = 1024
402 + 622 = 1024
403 + 621 = 1024
404 + 620 = 1024
405 + 619 = 1024
406 + 618 = 1024
407 + 617 = 1024
408 + 616 = 1024
409 + 615 = 1024
410 + 614 = 1024
411 + 613 = 1024
412 + 612 = 1024
413 + 611 = 1024
414 + 610 = 1024
415 + 609 = 1024
416 + 608 = 1024
417 + 607 = 1024
418 + 606 = 1024
419 + 605 = 1024
420 + 604 = 1024
421 + 603 = 1024
422 + 602 = 1024
423 + 601 = 1024
424 + 600 = 1024
425 + 599 = 1024
426 + 598 = 1024
427 + 597 = 1024
428 + 596 = 1024
429 + 595 = 1024
430 + 594 = 1024
431 + 593 = 1024
432 + 592 = 1024
433 + 591 = 1024
434 + 590 = 1024
435 + 589 = 1024
436 + 588 = 1024
437 + 587 = 1024
438 + 586 = 1024
439 + 585 = 1024
440 + 584 = 1024
441 + 583 = 1024
442 + 582 = 1024
443 + 581 = 1024
444 + 580 = 1024
445 + 579 = 1024
446 + 578 = 1024
447 + 577 = 1024
448 + 576 = 1024
449 + 575 = 1024
450 + 574 = 1024
451 + 573 = 1024
452 + 572 = 1024
453 + 571 = 1024
454 + 570 = 1024
455 + 569 = 1024
456 + 568 = 1024
457 + 567 = 1024
458 + 566 = 1024
459 + 565 = 1024
460 + 564 = 1024
461 + 563 = 1024
462 + 562 = 1024
463 + 561 = 1024
464 + 560 = 1024
465 + 559 = 1024
466 + 558 = 1024
467 + 557 = 1024
468 + 556 = 1024
469 + 555 = 1024
470 + 554 = 1024
471 + 553 = 1024
472 + 552 = 1024
473 + 551 = 1024
474 + 550 = 1024
475 + 549 = 1024
476 + 548 = 1024
477 + 547 = 1024
478 + 546 = 1024
479 + 545 = 1024
480 + 544 = 1024
481 + 543 = 1024
482 + 542 = 1024
483 + 541 = 1024
484 + 540 = 1024
485 + 539 = 1024
486 + 538 = 1024
487 + 537 = 1024
488 + 536 = 1024
489 + 535 = 1024
490 + 534 = 1024
491 + 533 = 1024
492 + 532 = 1024
493 + 531 = 1024
494 + 530 = 1024
495 + 529 = 1024
496 + 528 = 1024
497 + 527 = 1024
498 + 526 = 1024
499 + 525 = 1024
500 + 524 = 1024
501 + 523 = 1024
502 + 522 = 1024
503 + 521 = 1024
504 + 520 = 1024
505 + 519 = 1024
506 + 518 = 1024
507 + 517 = 1024
508 + 516 = 1024
509 + 515 = 1024
510 + 514 = 1024
511 + 513 = 1024
512 + 512 = 1024
513 + 511 = 1024
514 + 510 = 1024
515 + 509 = 1024
516 + 508 = 1024
517 + 507 = 1024
518 + 506 = 1024
519 + 505 = 1024
520 + 504 = 1024
521 + 503 = 1024
522 + 502 = 1024
523 + 501 = 1024
524 + 500 = 1024
525 + 499 = 1024
526 + 498 = 1024
527 + 497 = 1024
528 + 496 = 1024
529 + 495 = 1024
530 + 494 = 1024
531 + 493 = 1024
532 + 492 = 1024
533 + 491 = 1024
534 + 490 = 1024
535 + 489 = 1024
536 + 488 = 1024
537 + 487 = 1024
538 + 486 = 1024
539 + 485 = 1024
540 + 484 = 1024
541 + 483 = 1024
542 + 482 = 1024
543 + 481 = 1024
544 + 480 = 1024
545 + 479 = 1024
546 + 478 = 1024
547 + 477 = 1024
548 + 476 = 1024
549 + 475 = 1024
550 + 474 = 1024
551 + 473 = 1024
552 + 472 = 1024
553 + 471 = 1024
554 + 470 = 1024
555 + 469 = 1024
556 + 468 = 1024
557 + 467 = 1024
558 + 466 = 1024
559 + 465 = 1024
560 + 464 = 1024
561 + 463 = 1024
562 + 462 = 1024
563 + 461 = 1024
564 + 460 = 1024
565 + 459 = 1024
566 + 458 = 1024
567 + 457 = 1024
568 + 456 = 1024
569 + 455 = 1024
570 + 454 = 1024
571 + 453 = 1024
572 + 452 = 1024
573 + 451 = 1024
574 + 450 = 1024
575 + 449 = 1024
576 + 448 = 1024
577 + 447 = 1024
578 + 446 = 1024
579 + 445 = 1024
580 + 444 = 1024
581 + 443 = 1024
582 + 442 = 1024
583 + 441 = 1024
584 + 440 = 1024
585 + 439 = 1024
586 + 438 = 1024
587 + 437 = 1024
588 + 436 = 1024
589 + 435 = 1024
590 + 434 = 1024
591 + 433 = 1024
592 + 432 = 1024
593 + 431 = 1024
594 + 430 = 1024
595 + 429 = 1024
596 + 428 = 1024
597 + 427 = 1024
598 + 426 = 1024
599 + 425 = 1024
600 + 424 = 1024
601 + 423 = 1024
602 + 422 = 1024
603 + 421 = 1024
604 + 420 = 1024
605 + 419 = 1024
606 + 418 = 1024
607 + 417 = 1024
608 + 416 = 1024
609 + 415 = 1024
610 + 414 = 1024
611 + 413 = 1024
612 + 412 = 1024
613 + 411 = 1024
614 + 410 = 1024
615 + 409 = 1024
616 + 408 = 1024
617 + 407 = 1024
618 + 406 = 1024
619 + 405 = 1024
620 + 404 = 1024
621 + 403 = 1024
622 + 402 = 1024
623 + 401 = 1024
624 + 400 = 1024
625 + 399 = 1024
626 + 398 = 1024
627 + 397 = 1024
628 + 396 = 1024
629 + 395 = 1024
630 + 394 = 1024
631 + 393 = 1024
632 + 392 = 1024
633 + 391 = 1024
634 + 390 = 1024
635 + 389 = 1024
636 + 388 = 1024
637 + 387 = 1024
638 + 386 = 1024
639 + 385 = 1024
640 + 384 = 1024
641 + 383 = 1024
642 + 382 = 1024
643 + 381 = 1024
644 + 380 = 1024
645 + 379 = 1024
646 + 378 = 1024
647 + 377 = 1024
648 + 376 = 1024
649 + 375 = 1024
650 + 374 = 1024
651 + 373 = 1024
652 + 372 = 1024
653 + 371 = 1024
654 + 370 = 1024
655 + 369 = 1024
656 + 368 = 1024
657 + 367 = 1024
658 + 366 = 1024
659 + 365 = 1024
660 + 364 = 1024
661 + 363 = 1024
662 + 362 = 1024
663 + 361 = 1024
664 + 360 = 1024
665 + 359 = 1024
666 + 358 = 1024
667 + 357 = 1024
668 + 356 = 1024
669 + 355 = 1024
670 + 354 = 1024
671 + 353 = 1024
672 + 352 = 1024
673 + 351 = 1024
674 + 350 = 1024
675 + 349 = 1024
676 + 348 = 1024
677 + 347 = 1024
678 + 346 = 1024
679 + 345 = 1024
680 + 344 = 1024
681 + 343 = 1024
682 + 342 = 1024
683 + 341 = 1024
684 + 340 = 1024
685 + 339 = 1024
686 + 338 = 1024
687 + 337 = 1024
688 + 336 = 1024
689 + 335 = 1024
690 + 334 = 1024
691 + 333 = 1024
692 + 332 = 1024
693 + 331 = 1024
694 + 330 = 1024
695 + 329 = 1024
696 + 328 = 1024
697 + 327 = 1024
698 + 326 = 1024
699 + 325 = 1024
700 + 324 = 1024
701 + 323 = 1024
702 + 322 = 1024
703 + 321 = 1024
704 + 320 = 1024
705 + 319 = 1024
706 + 318 = 1024
707 + 317 = 1024
708 + 316 = 1024
709 + 315 = 1024
710 + 314 = 1024
711 + 313 = 1024
712 + 312 = 1024
713 + 311 = 1024
714 + 310 = 1024
715 + 309 = 1024
716 + 308 = 1024
717 + 307 = 1024
718 + 306 = 1024
719 + 305 = 1024
720 + 304 = 1024
721 + 303 = 1024
722 + 302 = 1024
723 + 301 = 1024
724 + 300 = 1024
725 + 299 = 1024
726 + 298 = 1024
727 + 297 = 1024
728 + 296 = 1024
729 + 295 = 1024
730 + 294 = 1024
731 + 293 = 1024
732 + 292 = 1024
733 + 291 = 1024
734 + 290 = 1024
735 + 289 = 1024
736 + 288 = 1024
737 + 287 = 1024
738 + 286 = 1024
739 + 285 = 1024
740 + 284 = 1024
741 + 283 = 1024
742 + 282 = 1024
743 + 281 = 1024
744 + 280 = 1024
745 + 279 = 1024
746 + 278 = 1024
747 + 277 = 1024
748 + 276 = 1024
749 + 275 = 1024
750 + 274 = 1024
751 + 273 = 1024
752 + 272 = 1024
753 + 271 = 1024
754 + 270 = 1024
755 + 269 = 1024
756 + 268 = 1024
757 + 267 = 1024
758 + 266 = 1024
759 + 265 = 1024
760 + 264 = 1024
761 + 263 = 1024
762 + 262 = 1024
763 + 261 = 1024
764 + 260 = 1024
765 + 259 = 1024
766 + 258 = 1024
767 + 257 = 1024
768 + 256 = 1024
769 + 255 = 1024
770 + 254 = 1024
771 + 253 = 1024
772 + 252 = 1024
773 + 251 = 1024
774 + 250 = 1024
775 + 249 = 1024
776 + 248 = 1024
777 + 247 = 1024
778 + 246 = 1024
779 + 245 = 1024
780 + 244 = 1024
781 + 243 = 1024
782 + 242 = 1024
783 + 241 = 1024
784 + 240 = 1024
785 + 239 = 1024
786 + 238 = 1024
787 + 237 = 1024
788 + 236 = 1024
789 + 235 = 1024
790 + 234 = 1024
791 + 233 = 1024
792 + 232 = 1024
793 + 231 = 1024
794 + 230 = 1024
795 + 229 = 1024
796 + 228 = 1024
797 + 227 = 1024
798 + 226 = 1024
799 + 225 = 1024
800 + 224 = 1024
801 + 223 = 1024
802 + 222 = 1024
803 + 221 = 1024
804 + 220 = 1024
805 + 219 = 1024
806 + 218 = 1024
807 + 217 = 1024
808 + 216 = 1024
809 + 215 = 1024
810 + 214 = 1024
811 + 213 = 1024
812 + 212 = 1024
813 + 211 = 1024
814 + 210 = 1024
815 + 209 = 1024
816 + 208 = 1024
817 + 207 = 1024
818 + 206 = 1024
819 + 205 = 1024
820 + 204 = 1024
821 + 203 = 1024
822 + 202 = 1024
823 + 201 = 1024
824 + 200 = 1024
825 + 199 = 1024
826 + 198 = 1024
827 + 197 = 1024
828 + 196 = 1024
829 + 195 = 1024
830 + 194 = 1024
831 + 193 = 1024
832 + 192 = 1024
833 + 191 = 1024
834 + 190 = 1024
835 + 189 = 1024
836 + 188 = 1024
837 + 187 = 1024
838 + 186 = 1024
839 + 185 = 1024
840 + 184 = 1024
841 + 183 = 1024
842 + 182 = 1024
843 + 181 = 1024
844 + 180 = 1024
845 + 179 = 1024
846 + 178 = 1024
847 + 177 = 1024
848 + 176 = 1024
849 + 175 = 1024
850 + 174 = 1024
851 + 173 = 1024
852 + 172 = 1024
853 + 171 = 1024
854 + 170 = 1024
855 + 169 = 1024
856 + 168 = 1024
857 + 167 = 1024
858 + 166 = 1024
859 + 165 = 1024
860 + 164 = 1024
861 + 163 = 1024
862 + 162 = 1024
863 + 161 = 1024
864 + 160 = 1024
865 + 159 = 1024
866 + 158 = 1024
867 + 157 = 1024
868 + 156 = 1024
869 + 155 = 1024
870 + 154 = 1024
871 + 153 = 1024
872 + 152 = 1024
873 + 151 = 1024
874 + 150 = 1024
875 + 149 = 1024
876 + 148 = 1024
877 + 147 = 1024
878 + 146 = 1024
879 + 145 = 1024
880 + 144 = 1024
881 + 143 = 1024
882 + 142 = 1024
883 + 141 = 1024
884 + 140 = 1024
885 + 139 = 1024
886 + 138 = 1024
887 + 137 = 1024
888 + 136 = 1024
889 + 135 = 1024
890 + 134 = 1024
891 + 133 = 1024
892 + 132 = 1024
893 + 131 = 1024
894 + 130 = 1024
895 + 129 = 1024
896 + 128 = 1024
897 + 127 = 1024
898 + 126 = 1024
899 + 125 = 1024
900 + 124 = 1024
901 + 123 = 1024
902 + 122 = 1024
903 + 121 = 1024
904 + 120 = 1024
905 + 119 = 1024
906 + 118 = 1024
907 + 117 = 1024
908 + 116 = 1024
909 + 115 = 1024
910 + 114 = 1024
911 + 113 = 1024
912 + 112 = 1024
913 + 111 = 1024
914 + 110 = 1024
915 + 109 = 1024
916 + 108 = 1024
917 + 107 = 1024
918 + 106 = 1024
919 + 105 = 1024
920 + 104 = 1024
921 + 103 = 1024
922 + 102 = 1024
923 + 101 = 1024
924 + 100 = 1024
925 + 99 = 1024
926 + 98 = 1024
927 + 97 = 1024
928 + 96 = 1024
929 + 95 = 1024
930 + 94 = 1024
931 + 93 = 1024
932 + 92 = 1024
933 + 91 = 1024
934 + 90 = 1024
935 + 89 = 1024
936 + 88 = 1024
937 + 87 = 1024
938 + 86 = 1024
939 + 85 = 1024
940 + 84 = 1024
941 + 83 = 1024
942 + 82 = 1024
943 + 81 = 1024
944 + 80 = 1024
945 + 79 = 1024
946 + 78 = 1024
947 + 77 = 1024
948 + 76 = 1024
949 + 75 = 1024
950 + 74 = 1024
951 + 73 = 1024
952 + 72 = 1024
953 + 71 = 1024
954 + 70 = 1024
955 + 69 = 1024
956 + 68 = 1024
957 + 67 = 1024
958 + 66 = 1024
959 + 65 = 1024
960 + 64 = 1024
961 + 63 = 1024
962 + 62 = 1024
963 + 61 = 1024
964 + 60 = 1024
965 + 59 = 1024
966 + 58 = 1024
967 + 57 = 1024
968 + 56 = 1024
969 + 55 = 1024
970 + 54 = 1024
971 + 53 = 1024
972 + 52 = 1024
973 + 51 = 1024
974 + 50 = 1024
975 + 49 = 1024
976 + 48 = 1024
977 + 47 = 1024
978 + 46 = 1024
979 + 45 = 1024
980 + 44 = 1024
981 + 43 = 1024
982 + 42 = 1024
983 + 41 = 1024
984 + 40 = 1024
985 + 39 = 1024
986 + 38 = 1024
987 + 37 = 1024
988 + 36 = 1024
989 + 35 = 1024
990 + 34 = 1024
991 + 33 = 1024
992 + 32 = 1024
993 + 31 = 1024
994 + 30 = 1024
995 + 29 = 1024
996 + 28 = 1024
997 + 27 = 1024
998 + 26 = 1024
999 + 25 = 1024
1000 + 24 = 1024
1001 + 23 = 1024
1002 + 22 = 1024
1003 + 21 = 1024
1004 + 20 = 1024
1005 + 19 = 1024
1006 + 18 = 1024
1007 + 17 = 1024
1008 + 16 = 1024
1009 + 15 = 1024
1010 + 14 = 1024
1011 + 13 = 1024
1012 + 12 = 1024
1013 + 11 = 1024
1014 + 10 = 1024
1015 + 9 = 1024
1016 + 8 = 1024
1017 + 7 = 1024
1018 + 6 = 1024
1019 + 5 = 1024
1020 + 4 = 1024
1021 + 3 = 1024
1022 + 2 = 1024
1023 + 1 = 1024
```

Thank you for reading