You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let input_desc = cudnn.create_4d_tensor::<f32>(sys::cudnnTensorFormat_t::CUDNN_TENSOR_NCHW, [1,1,64,64]).unwrap();
let output_desc = cudnn.create_4d_tensor::<f32>(sys::cudnnTensorFormat_t::CUDNN_TENSOR_NCHW, [1,1,64,64]).unwrap();
let filter_desc = cudnn.create_4d_filter::<f32>(sys::cudnnTensorFormat_t::CUDNN_TENSOR_NCHW, [1,1,1,1]).unwrap();
let mut convolution_desc = cudnn.create_conv2d::<f32>([0,0], [1,1], [1,1], sys::cudnnConvolutionMode_t::CUDNN_CONVOLUTION).unwrap();
convolution_desc.set_math_type(sys::cudnnMathType_t::CUDNN_DEFAULT_MATH).unwrap();
convolution_desc.set_group_count(1).unwrap();
let convolution = ConvForward {conv: &convolution_desc, x: &input_desc, w: &filter_desc, y: &output_desc};
let algo = convolution.pick_algorithm().unwrap();
let workspace_size = convolution.get_workspace_size(algo).unwrap();
let matrix = vec![0.5; 64*64];
let kernel = vec![0.2; 1];
let matrix_output = vec![0.0; 64*64];
let src = gpu.htod_copy(matrix).unwrap();
let filter = gpu.htod_copy(kernel).unwrap();
let mut dest = gpu.htod_copy(matrix_output).unwrap();
unsafe {
let mut workspace = gpu.alloc_zeros::<u8>(workspace_size).unwrap();
let mut workspace = workspace.transmute_mut::<u8>(workspace_size).unwrap();
convolution.launch(algo, Some(&mut workspace), (1.,0.), &src, &filter, &mut dest).unwrap();
}
And it that form (with one element kernel) it works as expected, output is full of 0.1 (0.5*0.2).
However, as soon as I change kernel's dimensions to more than that (for example [1,1,3,3]) it throws CudnnError(CUDNN_STATUS_BAD_PARAM) at pick_algorithm()... What I'm doing wrong?
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hello
I'm trying to setup convolution like that:
And it that form (with one element kernel) it works as expected, output is full of 0.1 (0.5*0.2).
However, as soon as I change kernel's dimensions to more than that (for example [1,1,3,3]) it throws
CudnnError(CUDNN_STATUS_BAD_PARAM)
at pick_algorithm()... What I'm doing wrong?Thanks in advance
The text was updated successfully, but these errors were encountered: