当前位置: 首页>>代码示例>>C#>>正文


C# cudnnStatus.ToString方法代码示例

本文整理汇总了C#中cudnnStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# cudnnStatus.ToString方法的具体用法?C# cudnnStatus.ToString怎么用?C# cudnnStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cudnnStatus的用法示例。


在下文中一共展示了cudnnStatus.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetErrorMessageFromCUResult

        private static string GetErrorMessageFromCUResult(cudnnStatus error)
        {
            string message = string.Empty;

            switch (error)
            {
                case cudnnStatus.Success:
                    break;
                case cudnnStatus.NotInitialized:
                    break;
                case cudnnStatus.AllocFailed:
                    break;
                case cudnnStatus.BadParam:
                    break;
                case cudnnStatus.InternalError:
                    break;
                case cudnnStatus.InvalidValue:
                    break;
                case cudnnStatus.ArchMismatch:
                    break;
                case cudnnStatus.MappingError:
                    break;
                case cudnnStatus.ExecutionFailed:
                    break;
                case cudnnStatus.NotSupported:
                    break;
                case cudnnStatus.LicenseError:
                    break;
                default:
                    break;
            }

            return error.ToString() + ": " + message ;
        }
开发者ID:MutterOberin,项目名称:managedCuda,代码行数:34,代码来源:CudaDNNException.cs

示例2: GetErrorMessageFromCUResult

		private static string GetErrorMessageFromCUResult(cudnnStatus error)
		{
			string message = string.Empty;

			switch (error)
			{
				case cudnnStatus.Success:
					message = "The operation completed successfully.";
					break;
				case cudnnStatus.NotInitialized:
					message = "The cuDNN library was not initialized properly.\nThis error is usually returned when a call to cudnnCreate() fails or when cudnnCreate() has not been called prior to calling another cuDNN routine. In the former case, it is usually due to an error in the CUDA Runtime API called by cudnnCreate() or by an error in the hardware setup.";
					break;
				case cudnnStatus.AllocFailed:
					message = "Resource allocation failed inside the cuDNN library. This is usually caused by an internal cudaMalloc() failure.\nTo correct: prior to the function call, deallocate previously allocated memory as much as possible.";
					break;
				case cudnnStatus.BadParam:
					message = "An incorrect value or parameter was passed to the function.\nTo correct: ensure that all the parameters being passed have valid values.";
					break;
				case cudnnStatus.InternalError:
					message = "An internal cuDNN operation failed.";
					break;
				case cudnnStatus.InvalidValue:
					message = "";
					break;
				case cudnnStatus.ArchMismatch:
					message = "The function requires a feature absent from the current GPU device. Note that cuDNN only supports devices with compute capabilities greater than or equal to 3.0.\nTo correct: compile and run the application on a device with appropriate compute capability.";
					break;
				case cudnnStatus.MappingError:
					message = "An access to GPU memory space failed, which is usually caused by a failure to bind a texture.\nTo correct: prior to the function call, unbind any previously bound textures.\nOtherwise, this may indicate an internal error/bug in the library.";
					break;
				case cudnnStatus.ExecutionFailed:
					message = "The GPU program failed to execute. This is usually caused by a failure to launch some cuDNN kernel on the GPU, which can occur for multiple reasons.\nTo correct: check that the hardware, an appropriate version of the driver, and the cuDNN library are correctly installed.\nOtherwise, this may indicate a internal error/bug in the library.";
					break;
				case cudnnStatus.NotSupported:
					message = "The functionality requested is not presently supported by cuDNN.";
					break;
				case cudnnStatus.LicenseError:
					message = "The functionality requested requires some license and an error was detected when trying to check the current licensing. This error can happen if the license is not present or is expired or if the environment variable NVIDIA_LICENSE_FILE is not set properly.";
					break;
				default:
					break;
			}

			return error.ToString() + ": " + message ;
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:45,代码来源:CudaDNNException.cs


注:本文中的cudnnStatus.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。