Explorar el Código

xlu_kernels.c: use fpclassify(3) rather than comparing floats to 0.0.

Cyril Roelandt hace 13 años
padre
commit
3e6185ecab
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      examples/lu/xlu_kernels.c

+ 2 - 2
examples/lu/xlu_kernels.c

@@ -312,7 +312,7 @@ static inline void STARPU_LU(common_u11)(void *descr[],
 			{
 				TYPE pivot;
 				pivot = sub11[z+z*ld];
-				STARPU_ASSERT(pivot != 0.0);
+				STARPU_ASSERT(fpclassify(pivot) != FP_ZERO);
 		
 				CPU_SCAL(nx - z - 1, (1.0/pivot), &sub11[z+(z+1)*ld], ld);
 		
@@ -331,7 +331,7 @@ static inline void STARPU_LU(common_u11)(void *descr[],
 				cudaMemcpy(&pivot, &sub11[z+z*ld], sizeof(TYPE), cudaMemcpyDeviceToHost);
 				cudaStreamSynchronize(0);
 
-				STARPU_ASSERT(pivot != 0.0);
+				STARPU_ASSERT(fpclassify(pivot) != FP_ZERO);
 				
 				inv_pivot = 1.0/pivot;
 				CUBLAS_SCAL(nx - z - 1, *(CUBLAS_TYPE*)&inv_pivot, (CUBLAS_TYPE*)&sub11[z+(z+1)*ld], ld);