better default settings for CUB
better default settings for CUB

Summary: The default CUB settings led to very slow execution in practice when using "dynamic" memory allocation with C2 (i.e freeing blobs after their use). After some tinkering, I arrived to these numbers, that work with resnet-50 and NVIDIA M40 GPU much better than the origianal defaults. Also made the maximum allocated memory configurable.

Reviewed By: Yangqing

Differential Revision: D5732930

fbshipit-source-id: 9ff34f49d5a3eb138bc6f44c82918731a35325a6

Yangqing/caffe2,davinwang/caffe2,sf-wind/caffe2,davinwang/caffe2,xzturn/caffe2,xzturn/caffe2,caffe2/caffe2,pietern/caffe2,xzturn/caffe2,pietern/caffe2,davinwang/caffe2,sf-wind/caffe2,Yangqing/caffe2,sf-wind/caffe2,xzturn/caffe2,Yangqing/caffe2,davinwang/caffe2,davinwang/caffe2,sf-wind/caffe2,pietern/caffe2,Yangqing/caffe2,sf-wind/caffe2,pietern/caffe2,xzturn/caffe2,Yangqing/caffe2,pietern/caffe2