Beispiel #1
0
/***************************************************************************************
  In fact these are 9 different combining methods for 2 blocks (3 * 3)
  And for one specific method, if the one block's area is larger than the other, there
is only one entire size;
  Otherwise these are two entire sizes because one of the block could rotate 90 degree
  So there should be 9 ~ 18 different entire sizes for these 2 blocks
***************************************************************************************/
void Size::calculation()
{
	getAllCombinations();

	for (int i = 0; i < allCombinations.size(); i++)
	{
		vector<int> temp;

		if (debugLv)
		{
			cout << "cur combination: ";
			printVector(allCombinations[i]);
		}

		getNewSize(allCombinations[i], temp);

		if (debugLv)
		{
			cout << "correspondent size: ";
			printVector(temp);
		}

		res.push_back(temp);
	}

	if (debugLv)
	{
		cout << "number of sizes found: " << res.size() << endl;
		printRes();
	}
	return;
}
Beispiel #2
0
//-----------------------------------------------------------------------------
void setNewSize(size_t* origSize, size_t* newSize, const char* suffix,
                const char* kernelName, size_t dimensions) {
  size_t* envSize = getNewSize(suffix, kernelName, dimensions);
  if(envSize == NULL)
    memcpy(newSize, origSize, dimensions * sizeof(size_t));
  else
    memcpy(newSize, envSize, dimensions * sizeof(size_t));
}