PosixFdInputStreamBuffer( ::libmaus::aio::PosixFdInput & rstream, int64_t const rblocksize, uint64_t const rputbackspace = 0 ) : stream(rstream), optblocksize(getOptimalBlockSize()), filesize(stream.sizeChecked()), blocksize((rblocksize < 0) ? optblocksize : rblocksize), putbackspace(rputbackspace), buffer(putbackspace + blocksize,false), symsread(0) { init(false); }
void KernelScheduler::moldKernelLaunchConfigForMaximumOccupancy(boost::shared_ptr<AbstractElasticKernel> kernel) { size_t newBlockSize = getOptimalBlockSize(kernel); // get the optimal block size LaunchParameters parameters = kernel.get()->getLaunchParams(); size_t totalThreads = parameters.getNumTotalThreads(); // make sure we ahve the same amount of threads overall, by decreasing the block size size_t newBlockNum = totalThreads / newBlockSize; if (totalThreads % newBlockSize) { ++newBlockNum; } //set the new configuration kernel.get()->setLaunchParams(LaunchParameters(newBlockSize, newBlockNum)); }