//intput set
const int in_n = 1;
const int in_c = 3;
const int in_h = 56;
const int in_w = 56;
cudnnTensorDescriptor_t in_desc;
bool input_c = false;
CUDNN_CALL(cudnnCreateTensorDescriptor(&in_desc));
CUDNN_CALL(cudnnSetTensor4dDescriptor(
in_desc, CUDNN_TENSOR_NHWC, CUDNN_DATA_FLOAT,in_n, in_c, in_h, in_w));
//kernel set
const int filt_k = 4;
const int filt_c = 3;
const int filt_h = 3;
const int filt_w = 3;
cudnnFilterDescriptor_t filt_desc;
CUDNN_CALL(cudnnCreateFilterDescriptor(&filt_desc));
CUDNN_CALL(cudnnSetFilter4dDescriptor(
filt_desc, CUDNN_DATA_FLOAT, CUDNN_TENSOR_NCHW,
filt_k, filt_c, filt_h, filt_w));
//get workspacesize
size_t ws_size;
CUDNN_CALL(cudnnGetConvolutionForwardWorkspaceSize(
cudnn, in_desc, filt_desc, conv_desc, out_desc, algo, &ws_size));
when is input h and w set 56 ws_size is 16832,and input h and w set 96 ws_size is 0 ,and input h and w set 150 ws_size is 0,input h and w set 151 ws_size is 5.01MB,so i don’t know why this happen.