kernels.double.uniform.kh Maven / Gradle / Ivy
#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