30 BackEndParams() : backend(CPU_BACKEND)
32 #ifdef SKEPU_MAX_GPU_THREADS
33 maxThreads = SKEPU_MAX_GPU_THREADS;
38 #ifdef SKEPU_MAX_GPU_BLOCKS
39 maxBlocks = SKEPU_MAX_GPU_BLOCKS;
44 #ifdef SKEPU_OMP_MAX_THREADS
45 numOmpThreads = SKEPU_OMP_MAX_THREADS;
79 void add(
int lowBound,
int highBound, BackEnd backend,
unsigned gs,
unsigned bs)
85 sizePlan.insert(std::make_pair(std::make_pair(lowBound, highBound),bp));
88 void add(
int lowBound,
int highBound, BackEnd backend,
unsigned numOmpThreads)
92 bp.numOmpThreads = numOmpThreads;
93 sizePlan.insert(std::make_pair(std::make_pair(lowBound, highBound),bp));
96 void add(
int lowBound,
int highBound, BackEndParams params)
98 sizePlan.insert(std::make_pair(std::make_pair(lowBound, highBound),params));
101 void add(
int lowBound,
int highBound, BackEnd backend)
105 sizePlan.insert(std::make_pair(std::make_pair(lowBound, highBound),bp));
108 void setMaxThreads(
int size,
int maxthreads)
110 std::map< std::pair<int, int>, BackEndParams >::iterator it;
111 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
113 if(size >= it->first.first && size <= it->first.second)
115 it->second.maxThreads=maxthreads;
120 (--it)->second.maxThreads= maxthreads;
123 void setMaxBlocks(
int size,
int maxBlocks)
125 std::map< std::pair<int, int>, BackEndParams >::iterator it;
126 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
128 if(size >= it->first.first && size <= it->first.second)
130 it->second.maxBlocks=maxBlocks;
135 (--it)->second.maxBlocks= maxBlocks;
138 void setNumOmpThreads(
int size,
int ompThreads)
140 std::map< std::pair<int, int>, BackEndParams >::iterator it;
141 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
143 if(size >= it->first.first && size <= it->first.second)
145 it->second.numOmpThreads = ompThreads;
150 (--it)->second.numOmpThreads = ompThreads;
153 int numOmpThreads(
int size)
158 std::map< std::pair<int, int>, BackEndParams >::iterator it;
159 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
161 if(size >= it->first.first && size <= it->first.second)
163 return it->second.numOmpThreads;
167 return (--it)->second.numOmpThreads;
170 int maxThreads(
int size)
175 std::map< std::pair<int, int>, BackEndParams >::iterator it;
176 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
178 if(size >= it->first.first && size <= it->first.second)
180 return it->second.maxThreads;
184 return (--it)->second.maxThreads;
187 BackEnd find(
int size)
192 std::map< std::pair<int, int>, BackEndParams >::iterator it;
193 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
195 if(size >= it->first.first && size <= it->first.second)
197 return it->second.backend;
201 return (--it)->second.backend;
204 BackEndParams find_(
int size)
207 return BackEndParams();
209 std::map< std::pair<int, int>, BackEndParams >::iterator it;
210 for(it = sizePlan.begin(); it != sizePlan.end(); ++it)
212 if(size >= it->first.first && size <= it->first.second)
218 return (--it)->second;
227 std::map< std::pair<int, int>, BackEndParams > sizePlan;
A class that describes an execution plan, not used very much in this case as decision is mostly left ...
Definition: exec_plan.h:75