Преглед на файлове

Fix for the cfd benchmark

Added an include needed for correctly invoking the free primitive and
added namespace for the rand function (problems only on the odroid XU3)
Andrea Gussoni преди 8 години
родител
ревизия
f36be0a00d
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      opencl/cfd/util.h

+ 2 - 1
opencl/cfd/util.h

@@ -1,5 +1,6 @@
 #ifndef _C_UTIL_
 #define _C_UTIL_
+#include <cstdlib>
 #include <math.h>
 #include <iostream>
 #include <omp.h>
@@ -69,7 +70,7 @@ double gettime() {
 template<typename datatype>
 void fill(datatype *A, const int n, const datatype maxi){
     for (int j = 0; j < n; j++){
-        A[j] = ((datatype) maxi * (rand() / (RAND_MAX + 1.0f)));
+        A[j] = ((datatype) maxi * (std::rand() / (RAND_MAX + 1.0f)));
     }
 }