Go to the documentation of this file.00001
00005 #ifndef EXEC_PLAN_H
00006 #define EXEC_PLAN_H
00007
00008 #include <map>
00009
00010 namespace skepu
00011 {
00012
00013 enum BackEnd
00014 {
00015 CPU_BACKEND,
00016 OMP_BACKEND,
00017 CU_BACKEND,
00018 CUM_BACKEND,
00019 CL_BACKEND,
00020 CLM_BACKEND
00021 };
00022
00023
00044 class ExecPlan
00045 {
00046 public:
00047 int maxThreads;
00048 int maxBlocks;
00049 int numOmpThreads;
00050
00051 void add(int lowBound, int highBound, BackEnd backEnd)
00052 {
00053 sizePlan.insert(std::make_pair(std::make_pair(lowBound, highBound),backEnd));
00054 }
00055
00056 BackEnd find(int size)
00057 {
00058 if(sizePlan.empty())
00059 return CPU_BACKEND;
00060
00061 std::map< std::pair<int, int>, BackEnd >::iterator it;
00062 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
00063 {
00064 if(size >= it->first.first && size <= it->first.second)
00065 return it->second;
00066 }
00067
00068 return (--it)->second;
00069 }
00070
00071 private:
00072 std::map< std::pair<int, int>, BackEnd > sizePlan;
00073 };
00074
00075 }
00076
00077 #endif