From bff3dab505cf1b91286bcd49622ab706231f65aa Mon Sep 17 00:00:00 2001 From: castano Date: Fri, 20 Jul 2012 16:36:20 +0000 Subject: [PATCH] Fix errors. --- src/nvtt/cuda/CudaMath.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nvtt/cuda/CudaMath.h b/src/nvtt/cuda/CudaMath.h index 5d4ac54..dc93056 100644 --- a/src/nvtt/cuda/CudaMath.h +++ b/src/nvtt/cuda/CudaMath.h @@ -193,6 +193,11 @@ inline __device__ __host__ float lengthSquared(float3 a) return dot(a, a); } +inline __device__ __host__ float lengthSquared(float2 a) +{ + return dot(a, a); +} + // Use power method to find the first eigenvector. // http://www.miislita.com/information-retrieval-tutorial/matrix-tutorial-3-eigenvalues-eigenvectors.html @@ -335,8 +340,8 @@ inline __device__ __host__ float2 firstEigenVector2D( float matrix[3] ) { // @@ 8 iterations is probably more than enough. - const float3 row0 = make_float2(matrix[0], matrix[1]); - const float3 row1 = make_float2(matrix[1], matrix[2]); + const float2 row0 = make_float2(matrix[0], matrix[1]); + const float2 row1 = make_float2(matrix[1], matrix[2]); float r0 = lengthSquared(row0); float r1 = lengthSquared(row1);