소스 검색

tests/sched_policies/execute_all_tasks.c: check the absolute value of the substraction.

Cyril Roelandt 13 년 전
부모
커밋
cffdd44ad9
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      tests/Makefile.am
  2. 2 1
      tests/sched_policies/execute_all_tasks.c

+ 2 - 0
tests/Makefile.am

@@ -546,5 +546,7 @@ perfmodels_non_linear_regression_based_SOURCES+=\
 	perfmodels/opencl_memset.c
 endif
 
+sched_policies_execute_all_tasks_LDFLAGS = -lm
+
 showcheck:
 	-cat $(TEST_LOGS) /dev/null

+ 2 - 1
tests/sched_policies/execute_all_tasks.c

@@ -14,6 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <math.h>
 #include <unistd.h>
 
 #include <starpu.h>
@@ -104,7 +105,7 @@ run(struct starpu_sched_policy *p)
 
 		pi = tasks[i]->profiling_info;
 		task_len = starpu_timing_timespec_delay_us(&pi->start_time, &pi->end_time);
-		if (task_len - 1e6 > 1000) /* That's 1ms, should be good. */
+		if (fabs(task_len - 1e6) > 1000) /* That's 1ms, should be good. */
 			return 1;
 
 		starpu_task_destroy(tasks[i]);