All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kernels.float.uniform.kh Maven / Gradle / Ivy

#include 

extern "C"
__kernel void uniform_float(int n,float lower,float upper,float *result) {
           int totalThreads = get_num_groups(0) * get_local_size(0);
           int tid = get_local_id(0);
            int i = get_group_id(0) * get_local_size(0) + tid;

          for(; i < n; i += totalThreads) {
              float u = result[i];
              result[i] = u * upper + (1 - u) * lower;
          }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy