Example #1
0
        public static CudnnConvolutionDescriptor CreateConvolution(CudnnConvolutionDescriptorParametersEx parameters)
        {
            var convolution = CreateConvolution();

            convolution.SetParameters(parameters);
            return(convolution);
        }
        public void SetParameters(CudnnConvolutionDescriptorParametersEx param)
        {
            if (param == null)
                throw new ArgumentNullException("param");

            CudnnContext.Invoke(() => CudnnNativeMethods.cudnnSetConvolutionDescriptorEx(
                                                    this.Handle,
                                                    param.Num, param.Channels, param.Height, param.Width,
                                                    param.Kernel, param.FilterHeight, param.FilterWidth,
                                                    param.HeightPadding, param.WidthPadding,
                                                    param.HeightStride, param.WidthStride,
                                                    param.HeightUpscale, param.WidthUpscale,
                                                    param.Mode));

            initialized = true;
        }
Example #3
0
        public void SetParameters(CudnnConvolutionDescriptorParametersEx param)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }

            CudnnContext.Invoke(() => CudnnNativeMethods.cudnnSetConvolutionDescriptorEx(
                                    this.Handle,
                                    param.Num, param.Channels, param.Height, param.Width,
                                    param.Kernel, param.FilterHeight, param.FilterWidth,
                                    param.HeightPadding, param.WidthPadding,
                                    param.HeightStride, param.WidthStride,
                                    param.HeightUpscale, param.WidthUpscale,
                                    param.Mode));

            initialized = true;
        }
Example #4
0
 public static CudnnConvolutionDescriptor CreateConvolution(CudnnConvolutionDescriptorParametersEx parameters)
 {
     var convolution = CreateConvolution();
     convolution.SetParameters(parameters);
     return convolution;
 }