Cache sizes can be gotten programatically. I don't see that as an impediment. Would need to be benchmarked of course to see how that affects performance.
To be more precise: you can try to figure out how cache size would affect optimal block size in theory and in practice this gets you pretty decent performance. But to get the last bit of performance out of the hardware you need to benchmark several configurations on the hardware and select the best one based on run time parameters like u-arch and cache size.