Blame view

kernels/plugins/axb.cl 394 Bytes
89f70c1ec   glaville   import current mc...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  kernel void transform(global TYPE *vector, float a, float b)
  {
      const int i = get_global_id(0);
      
      TYPE value = (TYPE) (vector[i] * a + b);
      vector[i] = value;
  }
  
  kernel void clamped_transform(global TYPE *vector, float a, float b, TYPE min, TYPE max)
  {
      const int i = get_global_id(0);
      
      TYPE value = (TYPE) (vector[i] * a + b);
      vector[i] = clamp(value, min, max);
  }