Movatterモバイル変換


[0]ホーム

URL:


NVIDIACUDA Toolkit Documentation
Search In:
< Previous |Next >
CUDA Runtime API (PDF) - v13.0.2 (older) - Last updated October 9, 2025 -Send Feedback

6.3. Error Handling

This section describes the error handling functions of the CUDA runtime application programming interface.

Functions

__host____device__ ​const char* cudaGetErrorName (cudaError_t error )
Returns the string representation of an error code enum name.
__host____device__ ​const char* cudaGetErrorString (cudaError_t error )
Returns the description string for an error code.
__host____device__cudaError_t cudaGetLastError ( void )
Returns the last error from a runtime call.
__host____device__cudaError_t cudaPeekAtLastError ( void )
Returns the last error from a runtime call.

Functions

__host____device__ ​const char* cudaGetErrorName (cudaError_t error )
Returns the string representation of an error code enum name.
Parameters
error
- Error code to convert to string
Returns

char* pointer to a NULL-terminated string

Description

Returns a string containing the name of an error code in the enum. If the error code is not recognized, "unrecognized error code" is returned.

See also:

cudaGetErrorString,cudaGetLastError,cudaPeekAtLastError,cudaError,cuGetErrorName

__host____device__ ​const char* cudaGetErrorString (cudaError_t error )
Returns the description string for an error code.
Parameters
error
- Error code to convert to string
Returns

char* pointer to a NULL-terminated string

Description

Returns the description string for an error code. If the error code is not recognized, "unrecognized error code" is returned.

See also:

cudaGetErrorName,cudaGetLastError,cudaPeekAtLastError,cudaError,cuGetErrorString

__host____device__cudaError_t cudaGetLastError ( void )
Returns the last error from a runtime call.
Returns

cudaSuccess,cudaErrorMissingConfiguration,cudaErrorMemoryAllocation,cudaErrorInitializationError,cudaErrorLaunchFailure,cudaErrorLaunchTimeout,cudaErrorLaunchOutOfResources,cudaErrorInvalidDeviceFunction,cudaErrorInvalidConfiguration,cudaErrorInvalidDevice,cudaErrorInvalidValue,cudaErrorInvalidPitchValue,cudaErrorInvalidSymbol,cudaErrorUnmapBufferObjectFailed,cudaErrorInvalidDevicePointer,cudaErrorInvalidTexture,cudaErrorInvalidTextureBinding,cudaErrorInvalidChannelDescriptor,cudaErrorInvalidMemcpyDirection,cudaErrorInvalidFilterSetting,cudaErrorInvalidNormSetting,cudaErrorUnknown,cudaErrorInvalidResourceHandle,cudaErrorInsufficientDriver,cudaErrorNoDevice,cudaErrorSetOnActiveProcess,cudaErrorStartupFailure,cudaErrorInvalidPtx,cudaErrorUnsupportedPtxVersion,cudaErrorNoKernelImageForDevice,cudaErrorJitCompilerNotFound,cudaErrorJitCompilationDisabled

Description

Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library in the host thread and resets it tocudaSuccess.

Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.

Note:

See also:

cudaPeekAtLastError,cudaGetErrorName,cudaGetErrorString,cudaError

__host____device__cudaError_t cudaPeekAtLastError ( void )
Returns the last error from a runtime call.
Returns

cudaSuccess,cudaErrorMissingConfiguration,cudaErrorMemoryAllocation,cudaErrorInitializationError,cudaErrorLaunchFailure,cudaErrorLaunchTimeout,cudaErrorLaunchOutOfResources,cudaErrorInvalidDeviceFunction,cudaErrorInvalidConfiguration,cudaErrorInvalidDevice,cudaErrorInvalidValue,cudaErrorInvalidPitchValue,cudaErrorInvalidSymbol,cudaErrorUnmapBufferObjectFailed,cudaErrorInvalidDevicePointer,cudaErrorInvalidTexture,cudaErrorInvalidTextureBinding,cudaErrorInvalidChannelDescriptor,cudaErrorInvalidMemcpyDirection,cudaErrorInvalidFilterSetting,cudaErrorInvalidNormSetting,cudaErrorUnknown,cudaErrorInvalidResourceHandle,cudaErrorInsufficientDriver,cudaErrorNoDevice,cudaErrorSetOnActiveProcess,cudaErrorStartupFailure,cudaErrorInvalidPtx,cudaErrorUnsupportedPtxVersion,cudaErrorNoKernelImageForDevice,cudaErrorJitCompilerNotFound,cudaErrorJitCompilationDisabled

Description

Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library in the host thread. This call does not reset the error tocudaSuccess likecudaGetLastError().

Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.

Note:

See also:

cudaGetLastError,cudaGetErrorName,cudaGetErrorString,cudaError



[8]ページ先頭

©2009-2025 Movatter.jp