kernels.float.setrange_strided.kh Maven / Gradle / Ivy
#include "transform.h"
__global float op(float d1,float *params) {
float min = params[0];
float max = params[1];
if(d1 >= min && d1 <= max)
return d1;
if(min == 0 && max == 1) {
float val = 1 / (1 + exp(-d1));
return (floor(val * (max - min)) + min);
}
float ret = (floor(d1 * (max - min)) + min);
return ret;
}
extern "C"
__kernel void setrange_strided_float(int n,int idx,float *dy,int incy,float *params,float *result) {
transform(n,idx,dy,incy,params,result);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy