Пример #1
0
static void	*getMoreMem(int size)
{
  int		units;
  void		*address;
  t_header	*tmp;

  units = size;
  if (units < MIN_MALLOC)
    units = MIN_MALLOC;
  address = sbrk(units);
  if (address == (void *)-1)
    return (NULL);
  tmp = address;
  tmp->magic = MALLOC_MAGIC;
  tmp->next = NULL;
  if (MIN_MALLOC - size >= THRESHOLD)
    {
      tmp->size = size - sizeof(*tmp);
      split_end(tmp);
    }
  else
    tmp->size = size - sizeof(*tmp);
  if (gl_lowlimit == NULL)
    gl_lowlimit = tmp;
  return (tmp);
}
Пример #2
0
std::string OpenCLParser::getTypedKernelName(std::string line) {

	boost::regex split_bgn("template\\s+__attribute__\\(\\(mangled_name\\(");
	boost::regex split_end("\\)");
	boost::sregex_token_iterator it;

	it = boost::sregex_token_iterator(line.begin(),line.end(), split_bgn, -1);
	it++;
	line = (*it);
	it = boost::sregex_token_iterator(line.begin(),line.end(), split_end, -1);
	line = *it;
	return line;
}
Пример #3
0
std::string OpenCLParser::getKernelType(std::string line) {

	boost::regex split_bgn("template\\s+<class\\s+");
	boost::regex split_end("\\s*>");
	boost::sregex_token_iterator it;

	it = boost::sregex_token_iterator(line.begin(),line.end(), split_bgn, -1);
	it++;
	line = (*it);
	it = boost::sregex_token_iterator(line.begin(),line.end(), split_end, -1);
	line = *it;
	return line;
}
Пример #4
0
std::string OpenCLParser::getKernelName(std::string line) {

	boost::regex split_bgn("\\_*\\_*kernel\\s+void\\s+");
	boost::regex split_end("\\(");
	boost::sregex_token_iterator it;

	it = boost::sregex_token_iterator(line.begin(),line.end(), split_bgn, -1);
	it++;
	line = (*it);
	it = boost::sregex_token_iterator(line.begin(),line.end(), split_end, -1);
	line = *it;
	return line;
}
Пример #5
0
std::string OpenCLParser::getTypedKernelLine(std::string line) {

	std::string kernel_name = getKernelName(line);
	boost::regex split_bgn(kernel_name);
	boost::regex split_end("\\;");
	boost::sregex_token_iterator it;

	it = boost::sregex_token_iterator(line.begin(),line.end(), split_bgn, -1);
	it++;
	it++;
	line = (*it);
	it = boost::sregex_token_iterator(line.begin(),line.end(), split_end, -1);
	line = *it;
	return line;
}