vector_scal_opencl_codelet.texi 745 B

123456789101112131415161718192021
  1. @copying
  2. Copyright (C) 2009-2011 Université de Bordeaux 1
  3. Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3
  6. or any later version published by the Free Software Foundation;
  7. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  8. See the GNU Free Documentation License in COPYING.GFDL for more details.
  9. @end copying
  10. @smallexample
  11. __kernel void vector_mult_opencl(__global float* val, int nx, float factor)
  12. @{
  13. const int i = get_global_id(0);
  14. if (i < nx) @{
  15. val[i] *= factor;
  16. @}
  17. @}
  18. @end smallexample