Ingen beskrivning

vecadd4.cl 499B

123456789101112131415161718192021222324
  1. __kernel void vector_add(__global const uint *A, __global const uint *B, __global uint *C) {
  2. // Get the index of the current element to be processed
  3. int i = get_global_id(0);
  4. // Do the operation
  5. C[i] = (A[i] + B[i]);
  6. // Now break the compiler
  7. uint a[4];
  8. uchar c = 0x01;
  9. short s = 0x0101;
  10. c = 0x23;
  11. s = c;
  12. for(int t=0;t<4;t++) {
  13. a[t]=c;
  14. }
  15. for(int t=0;t<4;t++) {
  16. a[t]=s;
  17. if(t>0) {
  18. a[t-1]=a[t] + c + s;
  19. }
  20. }
  21. }