fixed ocl::minMax for FP-types

This commit is contained in:
Ilya Lavrenov
2013-10-27 15:55:40 +04:00
parent d3bcf609f1
commit 7afbae57ba
4 changed files with 56 additions and 214 deletions

View File

@@ -474,10 +474,14 @@ static void arithmetic_minMax_run(const oclMat &src, const oclMat & mask, cl_mem
ostringstream stream;
stream << "-D T=" << typeMap[src.depth()] << channelMap[src.channels()];
stream << " -D MAX_VAL=" << (WT)numeric_limits<T>::max();
stream << " -D MIN_VAL=" << (numeric_limits<T>::is_integer ?
(WT)numeric_limits<T>::min() : -(WT)(std::numeric_limits<T>::max()));
string buildOptions = stream.str();
if (numeric_limits<T>::is_integer)
{
stream << " -D MAX_VAL=" << (WT)numeric_limits<T>::max();
stream << " -D MIN_VAL=" << (WT)numeric_limits<T>::min();
}
else
stream << " -D DEPTH_" << src.depth();
std::string buildOptions = stream.str();
vector<pair<size_t , const void *> > args;
args.push_back( make_pair( sizeof(cl_mem) , (void *)&src.data));