Status Codes

group NVCV_C_UTIL_STATUS

Declares entities to handle return status codes used in NVCV.

NVCV functions uses status codes to return if they succeeded or not.

Defines

NVCV_MAX_STATUS_MESSAGE_LENGTH

Maximum status message length in bytes.

This is the maximum number of bytes that will be written by nvcvGetLastStatusMessage and nvcvPeekAtLastStatusMessage to the status message output buffer. It includes the final ‘\0’.

Enums

enum NVCVStatus

Status codes.

Values:

enumerator NVCV_SUCCESS

Operation completed successfully.

enumerator NVCV_ERROR_NOT_IMPLEMENTED

Operation isn’t implemented.

enumerator NVCV_ERROR_INVALID_ARGUMENT

Invalid argument, either wrong range or value not accepted.

enumerator NVCV_ERROR_INVALID_IMAGE_FORMAT

Image type not accepted.

enumerator NVCV_ERROR_INVALID_OPERATION

Operation isn’t valid in this context.

enumerator NVCV_ERROR_DEVICE

Device backend error.

enumerator NVCV_ERROR_NOT_READY

Operation not completed yet, try again later.

enumerator NVCV_ERROR_OUT_OF_MEMORY

Not enough free memory to allocate object.

enumerator NVCV_ERROR_INTERNAL

Internal, non specific error.

enumerator NVCV_ERROR_NOT_COMPATIBLE

Implementation version incompatibility.

enumerator NVCV_ERROR_OVERFLOW

Result is larger than maximum accepted value.

enumerator NVCV_ERROR_UNDERFLOW

Result is smaller than minimum accepted value.

Functions

const char *nvcvStatusGetName(NVCVStatus code)

Returns a string representation of the status code.

Parameters

code[in] Status code whose string representation is to be returned.

Returns

The string representation of the status code. Returned string is valid until next call of this function from the same calling thread. Returned pointer must not be freed.

NVCVStatus nvcvGetLastError()

Returns and resets the error status of the last NVCV function call that failed in current thread.

A new call to this function will return NVCV_SUCCESS, as the thread-specific status was reset. This operation doesn’t affect the statuses in other threads.

Returns

The status of the last NVCV function call that failed in current thread.

NVCVStatus nvcvGetLastErrorMessage(char *msgBuffer, int32_t lenBuffer)

Returns and resets the error status code and message of the last NVCV function call that failed in current thread.

A new call to this function will return NVCV_SUCCESS, as the thread-specific status was reset. This operation doesn’t affect the status in other threads.

It’s guaranteed that the message is never larger than NVCV_MAX_STATUS_MESSAGE_LENGTH bytes, including the ‘\0’ string terminator.

Parameters
  • msgBuffer[out] Pointer to memory where the status message will be written to. If NULL, no message is returned.

  • lenBuffer[in] Size in bytes of msgBuffer.

    • If less than zero, lenBuffer is assumed to be 0.

Returns

The status of the last NVCV function call that failed in current thread.

NVCVStatus nvcvPeekAtLastError()

Returns the error status of the last NVCV function call that failed in current thread.

The internal status code and message of current thread won’t be reset.

Returns

The status of the last NVCV function call that failed in current thread.

NVCVStatus nvcvPeekAtLastErrorMessage(char *msgBuffer, int32_t lenBuffer)

Returns the status code and message of the last NVCV function call that failed in current thread.

The internal status code and message of current thread won’t be reset.

It’s guaranteed that the message is never larger than NVCV_MAX_STATUS_MESSAGE_LENGTH bytes, including the ‘\0’ string terminator.

Parameters
  • msgBuffer[out] Pointer to memory where the status message will be written to. If NULL, no message is returned.

  • lenBuffer[in] Size in bytes of msgBuffer.

    • If less than zero, lenBuffer is assumed to be 0.

Returns

The status of the last NVCV function call that failed in current thread.

void nvcvSetThreadStatus(NVCVStatus status, const char *fmt, ...)

Sets the internal status in current thread.

This is used by nvcv extensions and/or language bindings to seamlessly integrate their status handling with the C API.

Parameters
  • status[in] The status code to be set

  • fmt, ...[in] The status message associated with the status code. Pass NULL if no customized error message is needed. It accepts a printf-like format.

void nvcvSetThreadStatusVarArgList(NVCVStatus status, const char *fmt, va_list va)

Sets the internal status in current thread.

This is used by nvcv extensions and/or language bindings to seamlessly integrate their status handling with the C API.

Parameters
  • status[in] The status code to be set

  • fmt, ...[in] The status message associated with the status code. Pass NULL if no customized error message is needed. It accepts a printf-like format.