add math operations for multicore version
authorjzhou <jzhou>
Fri, 29 May 2009 01:15:25 +0000 (01:15 +0000)
committerjzhou <jzhou>
Fri, 29 May 2009 01:15:25 +0000 (01:15 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/BuildCodeMultiCore.java
Robust/src/Runtime/math.c
Robust/src/Runtime/multicoretask.c
Robust/src/buildscript

index 93b2228fd099dc3b179838ff322d66f1e0213ea2..9c75c336316ec8f48f4c55904f53a1a0fb3b73a6 100644 (file)
@@ -447,11 +447,6 @@ public class BuildCode {
       Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
       while(classit.hasNext()) {
        ClassDescriptor cn=(ClassDescriptor)classit.next();
-       if(state.MULTICORE) {
-               if(cn.getSymbol().equals("Math")) {
-                       continue;
-               }
-       }
        Iterator methodit=cn.getMethods();
        while(methodit.hasNext()) {
          /* Classify parameters */
index d058c95f2f73ce9ae2bfdb2119746442746c00e5..afd4a7c28ed77062c6e1e74bf24d28491999b50f 100644 (file)
@@ -662,7 +662,7 @@ public class BuildCodeMultiCore extends BuildCode {
        } else {
                output.println("tprintf(\"Process %x(%d): task %s\\n\", corenum, corenum, \"" + task.getSymbol() + "\");");
        }
-       output.println("BAMBOO_DEBUGPRINT((int)BAMBOO_GET_EXE_TIME());");
+       output.println("BAMBOO_DEBUGPRINT(BAMBOO_GET_EXE_TIME());");
     output.println("#endif");
     output.println("#ifdef DEBUG");
        if(this.state.RAW) {
index e450d09ee879ccb8df0034b89f25afeb27136263..183fb6b8f79eb0b2c54ab964b0b38c8be9d32fac 100644 (file)
 #include "runtime.h"
-#ifdef MULTICORE
-#ifdef RAW
 #include "math.h"
-#endif
-#else
-#include "math.h"
-#endif
 #include "structdefs.h"
 
-#ifndef MULTICORE
 double CALL11(___Math______cos____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return cos(___a___);
-#endif
-#else
   return cos(___a___);
-#endif
 }
 
 double CALL11(___Math______sin____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return sin(___a___);
-#endif
-#else
   return sin(___a___);
-#endif
 }
 
 double CALL11(___Math______tan____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return tan(___a___);
-#endif
-#else
-  return tan(___a___);
-#endif
 }
 
 double CALL11(___Math______acos____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return acos(___a___);
-#endif
-#else
   return acos(___a___);
-#endif
 }
 
 double CALL11(___Math______asin____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return asin(___a___);
-#endif
-#else
-  return asin(___a___);
-#endif
 }
 
 double CALL11(___Math______atan____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return atan(___a___);
-#endif
-#else
   return atan(___a___);
-#endif
 }
 
 double CALL22(___Math______atan2____D_D, double ___a___, double ___b___, double ___a___, double ___b___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return atan2(___a___,___b___);
-#endif
-#else
   return atan2(___a___,___b___);
-#endif
 }
 
 double CALL11(___Math______log____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return log(___a___);
-#endif
-#else
-  return log(___a___);
-#endif
 }
 
 double CALL11(___Math______exp____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return exp(___a___);
-#endif
-#else
   return exp(___a___);
-#endif
 }
 
 double CALL11(___Math______sqrt____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return -1;
-#ifdef RAW
   return sqrt(___a___);
-#endif
-#else
-  return sqrt(___a___);
-#endif
 }
 
 double CALL22(___Math______pow____D_D, double ___a___, double ___b___, double ___a___, double ___b___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return pow(___a___);
-#endif
-#else
   return pow(___a___,___b___);
-#endif
 }
 
 double CALL11(___Math______ceil____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return ceil(___a___);
-#endif
-#else
   return ceil(___a___);
-#endif
 }
 
 double CALL11(___Math______floor____D, double ___a___, double ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return floor(___a___);
-#endif
-#else
   return floor(___a___);
-#endif
 }
 
 float CALL11(___Math______cosf____F, float ___a___, float ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return cosf(___a___);
-#endif
-#else
-  return cosf(___a___);
-#endif
 }
 
 float CALL11(___Math______sinf____F, float ___a___, float ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return sinf(___a___);
-#endif
-#else
   return sinf(___a___);
-#endif
 }
 
 float CALL11(___Math______expf____F, float ___a___, float ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return expf(___a___);
-#endif
-#else
-  return expf(___a___);
-#endif
 }
 
 float CALL11(___Math______sqrtf____F, float ___a___, float ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return sqrtf(___a___);
-#endif
-#else
   return sqrtf(___a___);
-#endif
 }
 
 float CALL11(___Math______logf____F, float ___a___, float ___a___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
   return logf(___a___);
-#endif
-#else
-  return logf(___a___);
-#endif
 }
 
 float CALL22(___Math______powf____F_F, float ___a___, float ___b___, float ___a___, float ___b___) {
-#ifdef MULTICORE
-  return 1;
-#ifdef RAW
-  return powf(___a___,___b___);
-#endif
-#else
   return powf(___a___,___b___);
-#endif
 }
-#endif
index c421e13afabf9bae8998a35199130a3751300d6e..44e910a7d32fad0dfc1259cf5e78f4fee7038c2f 100644 (file)
@@ -386,7 +386,7 @@ inline void run(void * arg) {
                                                                  totalexetime = BAMBOO_GET_EXE_TIME();
 #else
                                                                  BAMBOO_DEBUGPRINT(0xbbbbbbbb);
-                                                                 BAMBOO_DEBUGPRINT((int)BAMBOO_GET_EXE_TIME());
+                                                                 BAMBOO_DEBUGPRINT(BAMBOO_GET_EXE_TIME());
 #endif
                                                                  // profile mode, send msgs to other cores to request pouring
                                                                  // out progiling data
index c0c6f9369b08730e06de134bd42b8e6be77c46cc..9236c4ab2c9978a03b9e464bf5ca05e0ccdeedf6 100755 (executable)
@@ -563,6 +563,7 @@ cp ../Runtime/runtime.h ./
 cp ../Runtime/SimpleHash.h ./
 cp ../Tilera/Runtime/*.c ./
 cp ../Tilera/Runtime/*.h ./
+cp ../Tilera/lib/* ./
 cp ../tmpbuilddirectory/*.c ./
 cp ../tmpbuilddirectory/*.h ./