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

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

There is a newer version: 0.4-rc3.8
Show newest version
#include 

extern "C"
__kernel void uniform_double(int n,double lower,double upper,double *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) {
              double u = result[i];
              result[i] = u * upper + (1 - u) * lower;
          }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy