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


C# CUResult.ToString方法代码示例

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


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

示例1: GetErrorMessageFromCUResult


//.........这里部分代码省略.........
					message = "This indicates that peer access is not supported across the given devices.";
					break;
				case CUResult.ErrorInvalidPtx:
					message = "This indicates that a PTX JIT compilation failed.";
					break;
				case CUResult.ErrorInvalidGraphicsContext:
					message = "This indicates an error with OpenGL or DirectX context.";
					break;
				case CUResult.ErrorInvalidSource:
					message = "This indicates that the device kernel source is invalid.";
					break;
				case CUResult.ErrorFileNotFound:
					message = "This indicates that the file specified was not found.";
					break;
				case CUResult.ErrorSharedObjectSymbolNotFound:
					message = "This indicates that a link to a shared object failed to resolve.";
					break;
				case CUResult.ErrorSharedObjectInitFailed:
					message = "This indicates that initialization of a shared object failed.";
					break;
				case CUResult.ErrorOperatingSystem:
					message = "This indicates that an OS call failed.";
					break;
				case CUResult.ErrorInvalidHandle:
					message = "This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like CUstream and CUevent.";
					break;
				case CUResult.ErrorNotFound:
					message = "This indicates that a named symbol was not found. Examples of symbols are global/constant variable names, texture names, and surface names.";
					break;
				case CUResult.ErrorNotReady:
					message = "This indicates that asynchronous operations issued previously have not completed yet. This result is not actually an error, but must be indicated differently than CUDA_SUCCESS (which indicates completion). Calls that may return this value include cuEventQuery() and cuStreamQuery().";
					break;
				case CUResult.ErrorIllegalAddress:
					message = "While executing a kernel, the device encountered a load or store instruction on an invalid memory address.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorLaunchOutOfResources:
					message = "This indicates that a launch did not occur because it did not have appropriate resources. This error usually indicates that the user has attempted to pass too many arguments to the device kernel, or the kernel launch specifies too many threads for the kernel's register count. Passing arguments of the wrong size (i.e. a 64-bit pointer when a 32-bit int is expected) is equivalent to passing too many arguments and can also result in this error.";
					break;
				case CUResult.ErrorLaunchTimeout:
					message = "This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device attribute CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information. The context cannot be used (and must be destroyed similar to CUDA_ERROR_LAUNCH_FAILED). All existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorLaunchIncompatibleTexturing:
					message = "This error indicates a kernel launch that uses an incompatible texturing mode.";
					break;
				case CUResult.ErrorPeerAccessAlreadyEnabled:
					message = "This error indicates that a call to ::cuCtxEnablePeerAccess() is trying to re-enable peer access to a context which has already had peer access to it enabled.";
					break;
				case CUResult.ErrorPeerAccessNotEnabled:
					message = "This error indicates that ::cuCtxDisablePeerAccess() is trying to disable peer access which has not been enabled yet via ::cuCtxEnablePeerAccess().";
					break;
				case CUResult.ErrorPrimaryContextActice:
					message = "This error indicates that the primary context for the specified device has already been initialized.";
					break;
				case CUResult.ErrorContextIsDestroyed:
					message = "This error indicates that the context current to the calling thread has been destroyed using ::cuCtxDestroy, or is a primary context which has not yet been initialized.";
					break;
				case CUResult.ErrorAssert:
					message = "A device-side assert triggered during kernel execution. The context cannot be used anymore, and must be destroyed. All existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorTooManyPeers:
					message = "This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the devices passed to cuCtxEnablePeerAccess().";
					break;
				case CUResult.ErrorHostMemoryAlreadyRegistered:
					message = "This error indicates that the memory range passed to cuMemHostRegister() has already been registered.";
					break;
				case CUResult.ErrorHostMemoryNotRegistered:
					message = "This error indicates that the pointer passed to cuMemHostUnregister() does not correspond to any currently registered memory region.";
					break;
				case CUResult.ErrorHardwareStackError:
					message = "While executing a kernel, the device encountered a stack error.\nThis can be due to stack corruption or exceeding the stack size limit.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorIllegalInstruction:
					message = "While executing a kernel, the device encountered an illegal instruction.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorMisalignedAddress:
					message = "While executing a kernel, the device encountered a load or store instruction on a memory address which is not aligned.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorInvalidAddressSpace:
					message = "While executing a kernel, the device encountered an instruction which can only operate on memory locations in certain address spaces (global, shared, or local), but was supplied a memory address not belonging to an allowed address space.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorInvalidPC:
					message = "While executing a kernel, the device program counter wrapped its address space.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorLaunchFailed:
					message = "An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointer and accessing out of bounds shared memory.\nThe context cannot be used, so it must be destroyed (and a new one should be created).\nAll existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
					break;
				case CUResult.ErrorNotPermitted:
					message = "This error indicates that the attempted operation is not permitted.";
					break;
				case CUResult.ErrorNotSupported:
					message = "This error indicates that the attempted operation is not supported on the current system or device.";
					break;
				case CUResult.ErrorUnknown:
					message = "This indicates that an unknown internal error has occurred.";
					break;
				default:
					break;
			}
			return error.ToString() + ": " + message;
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:101,代码来源:CudaException.cs


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