> -----Original Message----- > From: Beignet [mailto:[email protected]] On Behalf Of > rander > Sent: Monday, March 6, 2017 10:20 AM > To: [email protected] > Cc: Wang, Rander <[email protected]> > Subject: [Beignet] [PATCH 2/2] Backend: refine the geometry function > > Signed-off-by: rander <[email protected]> > --- > backend/src/libocl/src/ocl_geometric.cl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/backend/src/libocl/src/ocl_geometric.cl > b/backend/src/libocl/src/ocl_geometric.cl > index af39ed3..1f66daa 100644 > --- a/backend/src/libocl/src/ocl_geometric.cl > +++ b/backend/src/libocl/src/ocl_geometric.cl > @@ -100,10 +100,10 @@ OVERLOADABLE float fast_length(float x) { return > __gen_ocl_fabs(x); } > OVERLOADABLE float fast_length(float2 x) { return sqrt(dot(x,x)); } > OVERLOADABLE float fast_length(float3 x) { return sqrt(dot(x,x)); } > OVERLOADABLE float fast_length(float4 x) { return sqrt(dot(x,x)); } > -OVERLOADABLE float fast_distance(float x, float y) { return length(x-y); } > -OVERLOADABLE float fast_distance(float2 x, float2 y) { return length(x-y); } > -OVERLOADABLE float fast_distance(float3 x, float3 y) { return length(x-y); } > -OVERLOADABLE float fast_distance(float4 x, float4 y) { return length(x-y); } > +OVERLOADABLE float fast_distance(float x, float y) { return > fast_length(x-y); } > +OVERLOADABLE float fast_distance(float2 x, float2 y) { return > fast_length(x-y); } > +OVERLOADABLE float fast_distance(float3 x, float3 y) { return > fast_length(x-y); } > +OVERLOADABLE float fast_distance(float4 x, float4 y) { return > fast_length(x-y); } > OVERLOADABLE float fast_normalize(float x) { return x > 0 ? 1.f : (x < 0 ? > -1.f : > 0.f); } > OVERLOADABLE float2 fast_normalize(float2 x) { return x * rsqrt(dot(x, x)); } > OVERLOADABLE float3 fast_normalize(float3 x) { return x * rsqrt(dot(x, x)); } > -- > 2.7.4
The patch looks good. - Ruiling _______________________________________________ Beignet mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/beignet
