 	return dim3(num_blocks,num_threads, 3000);
 }
 
-dim3 getBetterDimensions(int numTads, int tadLength, int xRank, int yRank, int zRank, int dimensionLength, int elementSize, int reduction) {
-	int num_blocks = numTads;
-	int num_threads = tadLength;
-
-	if (num_threads > maxThreads) num_threads = maxThreads;
-	if (num_blocks > blockLimit) num_blocks = blockLimit;
-
-	// since we use shared memory as fast memory for some cases - we need to count that in
+int getBaseMemorySize(int xRank, int yRank, int zRank) {
 	int memory_limit = 256;
 
 	if (xRank == 0) xRank = 2;

	memory_limit += zRank == 0 ? 0 : (zRank * 2 + 4);
	memory_limit += xRank * 6;
	memory_limit += MAX_RANK; // special case, needed roughtly in one pase

	// at this momen we've stored all required information for things. time to count in reduction multipliers
	int reduction_per_block;

			0,
			shape::rank(resultShapeInfoPointer),
			dimensionLength,
			sizeof(float),
			2
	);

	reduceFloat<<<launchDims.x,launchDims.y,launchDims.z, *stream>>>(
