Debugger API (PDF) - CUDA Toolkit v5.5 (older) - Last updated May 11, 2013 - Send Feedback

5.1. cudadebugger.h File Reference

Header file for the CUDA debugger API.

Code Example

cudadebugger.h

‎/*
 * Copyright 2007-2013 NVIDIA Corporation.  All rights reserved.
 *
 * NOTICE TO LICENSEE:
 *
 * This source code and/or documentation ("Licensed Deliverables") are
 * subject to NVIDIA intellectual property rights under U.S. and
 * international Copyright laws.
 *
 * These Licensed Deliverables contained herein is PROPRIETARY and
 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
 * conditions of a form of NVIDIA software license agreement by and
 * between NVIDIA and Licensee ("License Agreement") or electronically
 * accepted by Licensee.  Notwithstanding any terms or conditions to
 * the contrary in the License Agreement, reproduction or disclosure
 * of the Licensed Deliverables to any third party without the express
 * written consent of NVIDIA is prohibited.
 *
 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THESE LICENSED DELIVERABLES.
 *
 * U.S. Government End Users.  These Licensed Deliverables are a
 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
 * 1995), consisting of "commercial computer software" and "commercial
 * computer software documentation" as such terms are used in 48
 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
 * U.S. Government End Users acquire the Licensed Deliverables with
 * only those rights set forth herein.
 *
 * Any use of the Licensed Deliverables in individual and commercial
 * software must include, in the user documentation and internal
 * comments to the code, the above Disclaimer and U.S. Government End
 * Users Notice.
 */

/*--------------------------------- Includes --------------------------------*/

#ifndef CUDADEBUGGER_H
#define CUDADEBUGGER_H

#include <stdlib.h>
#include "cuda_stdint.h"

#if defined(__STDC__)
#include <inttypes.h>
#include <stdbool.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if defined(_WIN32) && !defined(_WIN64)
/* Windows 32-bit */
#define PRIxPTR "I32x"
#endif

#if defined(_WIN64)
/* Windows 64-bit */
#define PRIxPTR "I64x"
#endif

#if defined(_WIN32)
/* Windows 32- and 64-bit */
#define PRIx64  "I64x"
#define PRId64  "I64d"
typedef unsigned char bool;
#undef false
#undef true
#define false 0
#define true  1
#endif

/*--------------------------------- API Version ------------------------------*/

#define CUDBG_API_VERSION_MAJOR      5  /* Major release version number */
#define CUDBG_API_VERSION_MINOR      5  /* Minor release version number */
#define CUDBG_API_VERSION_REVISION  95  /* Revision (build) number */

/*---------------------------------- Constants -------------------------------*/

#define CUDBG_MAX_DEVICES 32  /* Maximum number of supported devices */
#define CUDBG_MAX_SMS     64  /* Maximum number of SMs per device */
#define CUDBG_MAX_WARPS   64  /* Maximum number of warps per SM */
#define CUDBG_MAX_LANES   32  /* Maximum number of lanes per warp */

/*----------------------- Thread/Block Coordinates Types ---------------------*/

typedef struct { uint32_t x, y; }    CuDim2;   /* DEPRECATED */
typedef struct { uint32_t x, y, z; } CuDim3;   /* 3-dimensional coordinates for threads,... */

/*--------------------- Memory Segments (as used in DWARF) -------------------*/

typedef enum {
    ptxUNSPECIFIEDStorage,
    ptxCodeStorage,
    ptxRegStorage,
    ptxSregStorage,
    ptxConstStorage,
    ptxGlobalStorage,
    ptxLocalStorage,
    ptxParamStorage,
    ptxSharedStorage,
    ptxSurfStorage,
    ptxTexStorage,
    ptxTexSamplerStorage,
    ptxGenericStorage,
    ptxIParamStorage,
    ptxOParamStorage,
    ptxFrameStorage,
    ptxMAXStorage
} ptxStorageKind;

/*--------------------------- Debugger System Calls --------------------------*/

#define CUDBG_IPC_FLAG_NAME                 cudbgIpcFlag
#define CUDBG_RPC_ENABLED                   cudbgRpcEnabled
#define CUDBG_APICLIENT_PID                 cudbgApiClientPid
#define CUDBG_DEBUGGER_INITIALIZED          cudbgDebuggerInitialized
#define CUDBG_APICLIENT_REVISION            cudbgApiClientRevision
#define CUDBG_SESSION_ID                    cudbgSessionId
#define CUDBG_ATTACH_HANDLER_AVAILABLE      cudbgAttachHandlerAvailable
#define CUDBG_DETACH_SUSPENDED_DEVICES_MASK cudbgDetachSuspendedDevicesMask
#define CUDBG_ENABLE_LAUNCH_BLOCKING        cudbgEnableLaunchBlocking
#define CUDBG_ENABLE_INTEGRATED_MEMCHECK    cudbgEnableIntegratedMemcheck
#define CUDBG_ENABLE_PREEMPTION_DEBUGGING   cudbgEnablePreemptionDebugging

/*---------------- Internal Breakpoint Entries for Error Reporting ------------*/

#define CUDBG_REPORT_DRIVER_API_ERROR                   cudbgReportDriverApiError
#define CUDBG_REPORTED_DRIVER_API_ERROR_CODE            cudbgReportedDriverApiErrorCode
#define CUDBG_REPORTED_DRIVER_API_ERROR_FUNC_NAME_SIZE  cudbgReportedDriverApiErrorFuncNameSize
#define CUDBG_REPORTED_DRIVER_API_ERROR_FUNC_NAME_ADDR  cudbgReportedDriverApiErrorFuncNameAddr
#define CUDBG_REPORT_DRIVER_INTERNAL_ERROR              cudbgReportDriverInternalError
#define CUDBG_REPORTED_DRIVER_INTERNAL_ERROR_CODE       cudbgReportedDriverInternalErrorCode

/*----------------------------- API Return Types -----------------------------*/

typedef enum {
    CUDBG_SUCCESS                           = 0x0000,  /* Succesful execution */
    CUDBG_ERROR_UNKNOWN                     = 0x0001,  /* Error type not listed below */
    CUDBG_ERROR_BUFFER_TOO_SMALL            = 0x0002,  /* Cannot copy all the queried data into the buffer argument */
    CUDBG_ERROR_UNKNOWN_FUNCTION            = 0x0003,  /* Function cannot be found in the CUDA kernel */
    CUDBG_ERROR_INVALID_ARGS                = 0x0004,  /* Wrong use of arguments (NULL pointer, illegal value,...) */
    CUDBG_ERROR_UNINITIALIZED               = 0x0005,  /* Debugger API has not yet been properly initialized */
    CUDBG_ERROR_INVALID_COORDINATES         = 0x0006,  /* Invalid block or thread coordinates were provided */
    CUDBG_ERROR_INVALID_MEMORY_SEGMENT      = 0x0007,  /* Invalid memory segment requested (read/write) */
    CUDBG_ERROR_INVALID_MEMORY_ACCESS       = 0x0008,  /* Requested address (+size) is not within proper segment boundaries */
    CUDBG_ERROR_MEMORY_MAPPING_FAILED       = 0x0009,  /* Memory is not mapped and can't be mapped */
    CUDBG_ERROR_INTERNAL                    = 0x000a,  /* A debugger internal error occurred */
    CUDBG_ERROR_INVALID_DEVICE              = 0x000b,  /* Specified device cannot be found */
    CUDBG_ERROR_INVALID_SM                  = 0x000c,  /* Specified sm cannot be found */
    CUDBG_ERROR_INVALID_WARP                = 0x000d,  /* Specified warp cannot be found */
    CUDBG_ERROR_INVALID_LANE                = 0x000e,  /* Specified lane cannot be found */
    CUDBG_ERROR_SUSPENDED_DEVICE            = 0x000f,  /* device is suspended */
    CUDBG_ERROR_RUNNING_DEVICE              = 0x0010,  /* device is running and not suspended */
    CUDBG_ERROR_INVALID_ADDRESS             = 0x0012,  /* address is out-of-range */
    CUDBG_ERROR_INCOMPATIBLE_API            = 0x0013,  /* API version does not match */
    CUDBG_ERROR_INITIALIZATION_FAILURE      = 0x0014,  /* The CUDA Driver failed to initialize */
    CUDBG_ERROR_INVALID_GRID                = 0x0015,  /* Specified grid cannot be found */
    CUDBG_ERROR_NO_EVENT_AVAILABLE          = 0x0016,  /* No event left to be processed */
    CUDBG_ERROR_SOME_DEVICES_WATCHDOGGED    = 0x0017,  /* One or more devices have an associated watchdog (eg. X) */
    CUDBG_ERROR_ALL_DEVICES_WATCHDOGGED     = 0x0018,  /* All devices have an associated watchdog (eg. X) */
    CUDBG_ERROR_INVALID_ATTRIBUTE           = 0x0019,  /* Specified attribute does not exist or is incorrect */
    CUDBG_ERROR_ZERO_CALL_DEPTH             = 0x001a,  /* No function calls have been made on the device */
    CUDBG_ERROR_INVALID_CALL_LEVEL          = 0x001b,  /* Specified call level is invalid */
    CUDBG_ERROR_COMMUNICATION_FAILURE       = 0x001c,  /* Communication error between the debugger and the application. */
    CUDBG_ERROR_INVALID_CONTEXT             = 0x001d,  /* Specified context cannot be found */
    CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM   = 0x001e,  /* Requested address was not originally allocated from device memory (most likely visible in system memory) */
    CUDBG_ERROR_MEMORY_UNMAPPING_FAILED     = 0x001f,  /* Memory is not unmapped and can't be unmapped */
    CUDBG_ERROR_INCOMPATIBLE_DISPLAY_DRIVER = 0x0020,  /* The display driver is incompatible with the API */
    CUDBG_ERROR_INVALID_MODULE              = 0x0021,  /* The specified module is not valid */
    CUDBG_ERROR_LANE_NOT_IN_SYSCALL         = 0x0022,  /* The specified lane is not inside a device syscall */
    CUDBG_ERROR_MEMCHECK_NOT_ENABLED        = 0x0023,  /* Memcheck has not been enabled */
    CUDBG_ERROR_INVALID_ENVVAR_ARGS         = 0x0024,  /* Some environment variable's value is invalid */
    CUDBG_ERROR_OS_RESOURCES                = 0x0025,  /* Error while allocating resources from the OS */
    CUDBG_ERROR_FORK_FAILED                 = 0x0026,  /* Error while forking the debugger process */
    CUDBG_ERROR_NO_DEVICE_AVAILABLE         = 0x0027,  /* No CUDA capable device was found */
} CUDBGResultResult values of all the API routines. ;

/*------------------------------ Grid Attributes -----------------------------*/

typedef enum {
    CUDBG_ATTR_GRID_LAUNCH_BLOCKING    = 0x000,   /* Whether the grid launch is blocking or not. */
    CUDBG_ATTR_GRID_TID                = 0x001,   /* Id of the host thread that launched the grid. */
} CUDBGAttributeQuery attribute. ;

typedef struct {
    CUDBGAttributeQuery attribute.  attribute;
    uint64_t       value;
} CUDBGAttributeValuePair;

typedef enum {
    CUDBG_GRID_STATUS_INVALID,          /* An invalid grid ID was passed, or an error occurred during status lookup */
    CUDBG_GRID_STATUS_PENDING,          /* The grid was launched but is not running on the HW yet */
    CUDBG_GRID_STATUS_ACTIVE,           /* The grid is currently running on the HW */
    CUDBG_GRID_STATUS_SLEEPING,         /* The grid is on the device, doing a join */
    CUDBG_GRID_STATUS_TERMINATED,       /* The grid has finished executing */
    CUDBG_GRID_STATUS_UNDETERMINED,     /* The grid is either PENDING or TERMINATED */
} CUDBGGridStatusGrid status. ;

/*------------------------------- Kernel Types -------------------------------*/

typedef enum {
    CUDBG_KNL_TYPE_UNKNOWN             = 0x000,   /* Any type not listed below. */
    CUDBG_KNL_TYPE_SYSTEM              = 0x001,   /* System kernel, such as MemCpy. */
    CUDBG_KNL_TYPE_APPLICATION         = 0x002,   /* Application kernel, user-defined or libraries. */
} CUDBGKernelTypeKernel types. ;

/*-------------------------- Physical Register Types -------------------------*/

typedef enum {
    REG_CLASS_INVALID                  = 0x000,   /* invalid register */
    REG_CLASS_REG_CC                   = 0x001,   /* Condition register */
    REG_CLASS_REG_PRED                 = 0x002,   /* Predicate register */
    REG_CLASS_REG_ADDR                 = 0x003,   /* Address register */
    REG_CLASS_REG_HALF                 = 0x004,   /* 16-bit register (Currently unused) */
    REG_CLASS_REG_FULL                 = 0x005,   /* 32-bit register */
    REG_CLASS_MEM_LOCAL                = 0x006,   /* register spilled in memory */
    REG_CLASS_LMEM_REG_OFFSET          = 0x007,   /* register at stack offset (ABI only) */
} CUDBGRegClassPhysical register types. ;

/*---------------------------- Application Events ----------------------------*/

typedef enum {
    CUDBG_EVENT_INVALID                = 0x000,   /* Invalid event */
    CUDBG_EVENT_ELF_IMAGE_LOADED       = 0x001,   /* ELF image for CUDA kernel(s) is ready */
    CUDBG_EVENT_KERNEL_READY           = 0x002,   /* A CUDA kernel is ready to be launched */
    CUDBG_EVENT_KERNEL_FINISHED        = 0x003,   /* A CUDA kernel has terminated */
    CUDBG_EVENT_INTERNAL_ERROR         = 0x004,   /* Unexpected error. The API may be unstable. */
    CUDBG_EVENT_CTX_PUSH               = 0x005,   /* A CUDA context has been pushed. */
    CUDBG_EVENT_CTX_POP                = 0x006,   /* A CUDA context has been popped. */
    CUDBG_EVENT_CTX_CREATE             = 0x007,   /* A CUDA context has been created and pushed. */
    CUDBG_EVENT_CTX_DESTROY            = 0x008,   /* A CUDA context has been, popped if pushed, then destroyed. */
    CUDBG_EVENT_TIMEOUT                = 0x009,   /* Nothing happened for a while. This is heartbeat event. */
    CUDBG_EVENT_ATTACH_COMPLETE        = 0x00a,   /* Attach complete. */
    CUDBG_EVENT_DETACH_COMPLETE        = 0x00b,   /* Detach complete. */
} CUDBGEventKindCUDA Kernel Events. ;

/*------------------------------- Kernel Origin ------------------------------*/

typedef enum {
    CUDBG_KNL_ORIGIN_CPU               = 0x000,   /* The kernel was launched from the CPU. */
    CUDBG_KNL_ORIGIN_GPU               = 0x001,   /* The kernel was launched from the GPU. */
} CUDBGKernelOriginKernel origin. ;

/*------------------------ Kernel Launch Notify Mode --------------------------*/

typedef enum {
    CUDBG_KNL_LAUNCH_NOTIFY_EVENT      = 0x000,   /* The kernel notifications generate events */
    CUDBG_KNL_LAUNCH_NOTIFY_DEFER      = 0x001,   /* The kernel notifications are deferred */
} CUDBGKernelLaunchNotifyModeKernel launch notification mode. ;

/*------------------------------ Code Address --------------------------------*/

/* Deprecated */
typedef struct {
    CUDBGEventKindCUDA Kernel Events.  kind;
    union cases30_st {
        struct elfImageLoaded30_st {
            char     *relocatedElfImage;
            char     *nonRelocatedElfImage;
            uint32_t  size;
        } elfImageLoaded;
        struct kernelReady30_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
        } kernelReady;
        struct kernelFinished30_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
        } kernelFinished;
    } cases;
} CUDBGEvent30;

/* Deprecated */
typedef struct {
    CUDBGEventKindCUDA Kernel Events.  kind;
    union cases32_st {
        struct elfImageLoaded32_st {
            char     *relocatedElfImage;
            char     *nonRelocatedElfImage;
            uint32_t  size;
            uint32_t  dev;
            uint64_t  context;
            uint64_t  module;
        } elfImageLoaded;
        struct kernelReady32_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
        } kernelReady;
        struct kernelFinished32_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
        } kernelFinished;
        struct contextPush32_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPush;
        struct contextPop32_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPop;
        struct contextCreate32_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextCreate;
        struct contextDestroy32_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextDestroy;
    } cases;
} CUDBGEvent32;

/* Deprecated */
typedef struct {
    CUDBGEventKindCUDA Kernel Events.  kind;
    union cases42_st {
        struct elfImageLoaded42_st {
            char     *relocatedElfImage;
            char     *nonRelocatedElfImage;
            uint32_t  size32;
            uint32_t  dev;
            uint64_t  context;
            uint64_t  module;
            uint64_t  size;
        } elfImageLoaded;
        struct kernelReady42_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
            CuDim3   gridDim;
            CuDim3   blockDim;
            CUDBGKernelTypeKernel types.  type;
        } kernelReady;
        struct kernelFinished42_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
        } kernelFinished;
        struct contextPush42_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPush;
        struct contextPop42_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPop;
        struct contextCreate42_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextCreate;
        struct contextDestroy42_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextDestroy;
    } cases;
} CUDBGEvent42;

typedef struct {
    CUDBGEventKindCUDA Kernel Events.  kind;
    union cases50_st {
        struct elfImageLoaded50_st {
            char     *relocatedElfImage;
            char     *nonRelocatedElfImage;
            uint32_t  size32;
            uint32_t  dev;
            uint64_t  context;
            uint64_t  module;
            uint64_t  size;
        } elfImageLoaded;
        struct kernelReady50_st{
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
            CuDim3   gridDim;
            CuDim3   blockDim;
            CUDBGKernelTypeKernel types.  type;
        } kernelReady;
        struct kernelFinished50_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
        } kernelFinished;
        struct contextPush50_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPush;
        struct contextPop50_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPop;
        struct contextCreate50_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextCreate;
        struct contextDestroy50_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextDestroy;
        struct internalError50_st {
            CUDBGResultResult values of all the API routines.  errorType;
        } internalError;
    } cases;
} CUDBGEvent50;

typedef struct {
    CUDBGEventKindCUDA Kernel Events.  kind;
    union cases_st {
        struct elfImageLoaded_st {
            char     *relocatedElfImage;
            char     *nonRelocatedElfImage;
            uint32_t  size32;
            uint32_t  dev;
            uint64_t  context;
            uint64_t  module;
            uint64_t  size;
        } elfImageLoaded;
        struct kernelReady_st{
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
            CuDim3   gridDim;
            CuDim3   blockDim;
            CUDBGKernelTypeKernel types.  type;
            uint64_t parentGridId;
            uint64_t gridId64;
            CUDBGKernelOriginKernel origin.  origin;
        } kernelReady;
        struct kernelFinished_st {
            uint32_t dev;
            uint32_t gridId;
            uint32_t tid;
            uint64_t context;
            uint64_t module;
            uint64_t function;
            uint64_t functionEntry;
            uint64_t gridId64;
        } kernelFinished;
        struct contextPush_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPush;
        struct contextPop_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextPop;
        struct contextCreate_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextCreate;
        struct contextDestroy_st {
            uint32_t dev;
            uint32_t tid;
            uint64_t context;
        } contextDestroy;
        struct internalError_st {
            CUDBGResultResult values of all the API routines.  errorType;
        } internalError;
    } cases;
} CUDBGEventEvent information container. ;

typedef struct {
    uint32_t tid;
} CUDBGEventCallbackData40Event information passed to callback set with setNotifyNewEventCallback function. ;

typedef struct {
    uint32_t tid;
    uint32_t timeout;
} CUDBGEventCallbackDataEvent information passed to callback set with setNotifyNewEventCallback function. ;

#pragma pack(push,1)
typedef struct {
    uint32_t dev;
    uint64_t gridId64;
    uint32_t tid;
    uint64_t context;
    uint64_t module;
    uint64_t function;
    uint64_t functionEntry;
    CuDim3   gridDim;
    CuDim3   blockDim;
    CUDBGKernelTypeKernel types.  type;
    uint64_t parentGridId;
    CUDBGKernelOriginKernel origin.  origin;
} CUDBGGridInfoGrid info. ;
#pragma pack(pop)

typedef void (*CUDBGNotifyNewEventCallback31function type of the function called to notify debugger of the presence of a new event in the event queue. )(void *data);
typedef void (*CUDBGNotifyNewEventCallback40)(CUDBGEventCallbackData40Event information passed to callback set with setNotifyNewEventCallback function.  *data);
typedef void (*CUDBGNotifyNewEventCallbackfunction type of the function called to notify debugger of the presence of a new event in the event queue. )(CUDBGEventCallbackDataEvent information passed to callback set with setNotifyNewEventCallback function.  *data);

/*-------------------------------- Exceptions ------------------------------*/

typedef enum {
    CUDBG_EXCEPTION_UNKNOWN = 0xFFFFFFFFU, // Force sizeof(CUDBGException_t)==4
    CUDBG_EXCEPTION_NONE = 0,
    CUDBG_EXCEPTION_LANE_ILLEGAL_ADDRESS = 1,
    CUDBG_EXCEPTION_LANE_USER_STACK_OVERFLOW = 2,
    CUDBG_EXCEPTION_DEVICE_HARDWARE_STACK_OVERFLOW = 3,
    CUDBG_EXCEPTION_WARP_ILLEGAL_INSTRUCTION = 4,
    CUDBG_EXCEPTION_WARP_OUT_OF_RANGE_ADDRESS = 5,
    CUDBG_EXCEPTION_WARP_MISALIGNED_ADDRESS = 6,
    CUDBG_EXCEPTION_WARP_INVALID_ADDRESS_SPACE = 7,
    CUDBG_EXCEPTION_WARP_INVALID_PC = 8,
    CUDBG_EXCEPTION_WARP_HARDWARE_STACK_OVERFLOW = 9,
    CUDBG_EXCEPTION_DEVICE_ILLEGAL_ADDRESS = 10,
    CUDBG_EXCEPTION_LANE_MISALIGNED_ADDRESS = 11,
    CUDBG_EXCEPTION_WARP_ASSERT = 12,
    CUDBG_EXCEPTION_LANE_SYSCALL_ERROR = 13,
    CUDBG_EXCEPTION_WARP_ILLEGAL_ADDRESS = 14,
} CUDBGException_tHarwdare Exception Types. ;

/*--------------------------------- Exports --------------------------------*/

typedef const struct CUDBGAPI_stThe CUDA debugger API routines.  *CUDBGAPI;

CUDBGResultResult values of all the API routines.  cudbgGetAPI(uint32_t major, uint32_t minor, uint32_t rev, CUDBGAPI *api);
CUDBGResultResult values of all the API routines.  cudbgGetAPIVersion(uint32_t *major, uint32_t *minor, uint32_t *rev);
CUDBGResultResult values of all the API routines.  cudbgMain(int apiClientPid, uint32_t apiClientRevision, int sessionId, int attachState,
                      int attachEventInitialized, int writeFd, int detachFd, int attachStubInUse,
                      int enablePreemptionDebugging);

struct CUDBGAPI_stThe CUDA debugger API routines.  {
    /* Initialization */
    CUDBGResultResult values of all the API routines.  (*initializeInitialize the API. )(void);
    CUDBGResultResult values of all the API routines.  (*finalizeFinalize the API and free all memory. )(void);

    /* Device Execution Control */
    CUDBGResultResult values of all the API routines.  (*suspendDeviceSuspends a running CUDA device. )(uint32_t dev);
    CUDBGResultResult values of all the API routines.  (*resumeDeviceResume a suspended CUDA device. )(uint32_t dev);
    CUDBGResultResult values of all the API routines.  (*singleStepWarp40Single step an individual warp on a suspended CUDA device. )(uint32_t dev, uint32_t sm, uint32_t wp);

    /* Breakpoints */
    CUDBGResultResult values of all the API routines.  (*setBreakpoint31Sets a breakpoint at the given instruction address. )(uint64_t addr);
    CUDBGResultResult values of all the API routines.  (*unsetBreakpoint31Unsets a breakpoint at the given instruction address. )(uint64_t addr);

    /* Device State Inspection */
    CUDBGResultResult values of all the API routines.  (*readGridId50Reads the CUDA grid index running on a valid warp. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *gridId);
    CUDBGResultResult values of all the API routines.  (*readBlockIdx32Reads the two-dimensional CUDA block index running on a valid warp. )(uint32_t dev, uint32_t sm, uint32_t wp, CuDim2 *blockIdx);
    CUDBGResultResult values of all the API routines.  (*readThreadIdxReads the CUDA thread index running on valid lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, CuDim3 *threadIdx);
    CUDBGResultResult values of all the API routines.  (*readBrokenWarpsReads the bitmask of warps that are at a breakpoint on a given SM. )(uint32_t dev, uint32_t sm, uint64_t *brokenWarpsMask);
    CUDBGResultResult values of all the API routines.  (*readValidWarpsReads the bitmask of valid warps on a given SM. )(uint32_t dev, uint32_t sm, uint64_t *validWarpsMask);
    CUDBGResultResult values of all the API routines.  (*readValidLanesReads the bitmask of valid lanes on a given warp. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *validLanesMask);
    CUDBGResultResult values of all the API routines.  (*readActiveLanesReads the bitmask of active lanes on a valid warp. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *activeLanesMask);
    CUDBGResultResult values of all the API routines.  (*readCodeMemoryReads content at address in the code memory segment. )(uint32_t dev, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readConstMemoryReads content at address in the constant memory segment. )(uint32_t dev, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readGlobalMemory31Reads content at address in the global memory segment. )(uint32_t dev, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readParamMemoryReads content at address in the param memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readSharedMemoryReads content at address in the shared memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readLocalMemoryReads content at address in the local memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readRegisterReads content of a hardware register. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t regno, uint32_t *val);
    CUDBGResultResult values of all the API routines.  (*readPCReads the PC on the given active lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *pc);
    CUDBGResultResult values of all the API routines.  (*readVirtualPCReads the virtual PC on the given active lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *pc);
    CUDBGResultResult values of all the API routines.  (*readLaneStatusReads the status of the given lane. For specific error values, use readLaneException. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, bool *error);

    /* Device State Alteration */
    CUDBGResultResult values of all the API routines.  (*writeGlobalMemory31Writes content to address in the global memory segment. )(uint32_t dev, uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writeParamMemoryWrites content to address in the param memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writeSharedMemoryWrites content to address in the shared memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writeLocalMemoryWrites content to address in the local memory segment. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writeRegisterWrites content to a hardware register. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t regno, uint32_t val);

    /* Grid Properties */
    CUDBGResultResult values of all the API routines.  (*getGridDim32Get the number of blocks in the given grid. )(uint32_t dev, uint32_t sm, uint32_t wp, CuDim2 *gridDim);
    CUDBGResultResult values of all the API routines.  (*getBlockDimGet the number of threads in the given block. )(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *blockDim);
    CUDBGResultResult values of all the API routines.  (*getTIDGet the ID of the Linux thread hosting the context of the grid. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *tid);
    CUDBGResultResult values of all the API routines.  (*getElfImage32Get the relocated or non-relocated ELF image and size for the grid on the given device. )(uint32_t dev, uint32_t sm, uint32_t wp, bool relocated, void **elfImage, uint32_t *size);

    /* Device Properties */
    CUDBGResultResult values of all the API routines.  (*getDeviceTypeGet the string description of the device. )(uint32_t dev, char *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*getSmTypeGet the SM type of the device. )(uint32_t dev, char *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*getNumDevicesGet the number of installed CUDA devices. )(uint32_t *numDev);
    CUDBGResultResult values of all the API routines.  (*getNumSMsGet the total number of SMs on the device. )(uint32_t dev, uint32_t *numSMs);
    CUDBGResultResult values of all the API routines.  (*getNumWarpsGet the number of warps per SM on the device. )(uint32_t dev, uint32_t *numWarps);
    CUDBGResultResult values of all the API routines.  (*getNumLanesGet the number of lanes per warp on the device. )(uint32_t dev, uint32_t *numLanes);
    CUDBGResultResult values of all the API routines.  (*getNumRegistersGet the number of registers per lane on the device. )(uint32_t dev, uint32_t *numRegs);

    /* DWARF-related routines */
    CUDBGResultResult values of all the API routines.  (*getPhysicalRegister30Get the physical register number(s) assigned to a virtual register name 'reg' at a given PC, if 'reg' is live at that PC. )(uint64_t pc, char *reg, uint32_t *buf, uint32_t sz, uint32_t *numPhysRegs, CUDBGRegClassPhysical register types.  *regClass);
    CUDBGResultResult values of all the API routines.  (*disassembleDisassemble instruction at instruction address. )(uint32_t dev, uint64_t addr, uint32_t *instSize, char *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*isDeviceCodeAddressDetermines whether a virtual address resides within device code. )(uintptr_t addr, bool *isDeviceAddress);
    CUDBGResultResult values of all the API routines.  (*lookupDeviceCodeSymbolDetermines whether a symbol represents a function in device code and returns its virtual address. )(char *symName, bool *symFound, uintptr_t *symAddr);

    /* Events */
    CUDBGResultResult values of all the API routines.  (*setNotifyNewEventCallback31Provides the API with the function to call to notify the debugger of a new application or device event. )(CUDBGNotifyNewEventCallback31function type of the function called to notify debugger of the presence of a new event in the event queue.  callback, void *data);
    CUDBGResultResult values of all the API routines.  (*getNextEvent30Copies the next available event in the event queue into 'event' and removes it from the queue. )(CUDBGEvent30 *event);
    CUDBGResultResult values of all the API routines.  (*acknowledgeEvent30Inform the debugger API that the event has been processed. )(CUDBGEvent30 *event);

    /* 3.1 Extensions */
    CUDBGResultResult values of all the API routines.  (*getGridAttributeGet the value of a grid attribute. )(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttributeQuery attribute.  attr, uint64_t *value);
    CUDBGResultResult values of all the API routines.  (*getGridAttributesGet several grid attribute values in a single API call. )(uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttributeValuePair *pairs, uint32_t numPairs);
    CUDBGResultResult values of all the API routines.  (*getPhysicalRegister40Get the physical register number(s) assigned to a virtual register name 'reg' at a given PC, if 'reg' is live at that PC. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t pc, char *reg, uint32_t *buf, uint32_t sz, uint32_t *numPhysRegs, CUDBGRegClassPhysical register types.  *regClass);
    CUDBGResultResult values of all the API routines.  (*readLaneExceptionReads the exception type for a given lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, CUDBGException_tHarwdare Exception Types.  *exception);
    CUDBGResultResult values of all the API routines.  (*getNextEvent32Copies the next available event in the event queue into 'event' and removes it from the queue. )(CUDBGEvent32 *event);
    CUDBGResultResult values of all the API routines.  (*acknowledgeEvents42Inform the debugger API that synchronous events have been processed. )(void);

    /* 3.1 - ABI */
    CUDBGResultResult values of all the API routines.  (*readCallDepth32Reads the call depth (number of calls) for a given warp. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t *depth);
    CUDBGResultResult values of all the API routines.  (*readReturnAddress32Reads the physical return address for a call level. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t level, uint64_t *ra);
    CUDBGResultResult values of all the API routines.  (*readVirtualReturnAddress32Reads the virtual return address for a call level. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t level, uint64_t *ra);

    /* 3.2 Extensions */
    CUDBGResultResult values of all the API routines.  (*readGlobalMemoryReads content at address in the global memory segment (entire 40-bit VA on Fermi+). )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writeGlobalMemoryWrites content to address in the global memory segment (entire 40-bit VA on Fermi+). )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readPinnedMemoryReads content at pinned address in system memory. )(uint64_t addr, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*writePinnedMemoryWrites content to pinned address in system memory. )(uint64_t addr, const void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*setBreakpointSets a breakpoint at the given instruction address for the given device. )(uint32_t dev, uint64_t addr);
    CUDBGResultResult values of all the API routines.  (*unsetBreakpointUnsets a breakpoint at the given instruction address for the given device. )(uint32_t dev, uint64_t addr);
    CUDBGResultResult values of all the API routines.  (*setNotifyNewEventCallback40Provides the API with the function to call to notify the debugger of a new application or device event. )(CUDBGNotifyNewEventCallback40 callback);

    /* 4.0 Extensions */
    CUDBGResultResult values of all the API routines.  (*getNextEvent42Copies the next available event in the event queue into 'event' and removes it from the queue. )(CUDBGEvent42 *event);
    CUDBGResultResult values of all the API routines.  (*readTextureMemoryRead the content of texture memory with given id and coords on sm_20 and lower. )(uint32_t devId, uint32_t vsm, uint32_t wp, uint32_t id, uint32_t dim, uint32_t *coords, void *buf, uint32_t sz);
    CUDBGResultResult values of all the API routines.  (*readBlockIdxReads the CUDA block index running on a valid warp. )(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *blockIdx);
    CUDBGResultResult values of all the API routines.  (*getGridDimGet the number of blocks in the given grid. )(uint32_t dev, uint32_t sm, uint32_t wp, CuDim3 *gridDim);
    CUDBGResultResult values of all the API routines.  (*readCallDepthReads the call depth (number of calls) for a given lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *depth);
    CUDBGResultResult values of all the API routines.  (*readReturnAddressReads the physical return address for a call level. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t level, uint64_t *ra);
    CUDBGResultResult values of all the API routines.  (*readVirtualReturnAddressReads the virtual return address for a call level. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t level, uint64_t *ra);
    CUDBGResultResult values of all the API routines.  (*getElfImageGet the relocated or non-relocated ELF image and size for the grid on the given device. )(uint32_t dev, uint32_t sm, uint32_t wp, bool relocated, void **elfImage, uint64_t *size);

    /* 4.1 Extensions */
    CUDBGResultResult values of all the API routines.  (*getHostAddrFromDeviceAddrgiven a device virtual address, return a corresponding system memory virtual address. )(uint32_t dev, uint64_t device_addr, uint64_t *host_addr);
    CUDBGResultResult values of all the API routines.  (*singleStepWarpSingle step an individual warp on a suspended CUDA device. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t *warpMask);
    CUDBGResultResult values of all the API routines.  (*setNotifyNewEventCallbackProvides the API with the function to call to notify the debugger of a new application or device event. )(CUDBGNotifyNewEventCallbackfunction type of the function called to notify debugger of the presence of a new event in the event queue.  callback);
    CUDBGResultResult values of all the API routines.  (*readSyscallCallDepthReads the call depth of syscalls for a given lane. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t *depth);

    /* 4.2 Extensions */
    CUDBGResultResult values of all the API routines.  (*readTextureMemoryBindlessRead the content of texture memory with given symtab index and coords on sm_30 and higher. )(uint32_t devId, uint32_t vsm, uint32_t wp, uint32_t texSymtabIndex, uint32_t dim, uint32_t *coords, void *buf, uint32_t sz);

    /* 5.0 Extensions */
    CUDBGResultResult values of all the API routines.  (*clearAttachStateClear attach-specific state prior to detach. )(void);
    CUDBGResultResult values of all the API routines.  (*getNextSyncEvent50)(CUDBGEvent50 *event);
    CUDBGResultResult values of all the API routines.  (*memcheckReadErrorAddressGet the address that memcheck detected an error on. )(uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint64_t *address, ptxStorageKind *storage);
    CUDBGResultResult values of all the API routines.  (*acknowledgeSyncEventsInform the debugger API that synchronous events have been processed. )(void);
    CUDBGResultResult values of all the API routines.  (*getNextAsyncEvent50Copies the next available event in the asynchronous event queue into 'event' and removes it from the queue. The asynchronous event queue is held separate from the normal event queue, and does not require acknowledgement from the debug client. )(CUDBGEvent50 *event);
    CUDBGResultResult values of all the API routines.  (*requestCleanupOnDetachRequest for cleanup of driver state when detaching. )(void);
    CUDBGResultResult values of all the API routines.  (*initializeAttachStubInitialize the attach stub. )(void);
    CUDBGResultResult values of all the API routines.  (*getGridStatus50Check whether the grid corresponding to the given gridId is still present on the device. )(uint32_t dev, uint32_t gridId, CUDBGGridStatusGrid status.  *status);

    /* 5.5 Extensions */
    CUDBGResultResult values of all the API routines.  (*getNextSyncEventCopies the next available event in the synchronous event queue into 'event' and removes it from the queue. )(CUDBGEventEvent information container.  *event);
    CUDBGResultResult values of all the API routines.  (*getNextAsyncEventCopies the next available event in the asynchronous event queue into 'event' and removes it from the queue. The asynchronous event queue is held separate from the normal event queue, and does not require acknowledgement from the debug client. )(CUDBGEventEvent information container.  *event);
    CUDBGResultResult values of all the API routines.  (*getGridInfoGet information about the specified grid. )(uint32_t dev, uint64_t gridId64, CUDBGGridInfoGrid info.  *gridInfo);
    CUDBGResultResult values of all the API routines.  (*readGridIdReads the 64-bit CUDA grid index running on a valid warp. )(uint32_t dev, uint32_t sm, uint32_t wp, uint64_t *gridId64);
    CUDBGResultResult values of all the API routines.  (*getGridStatusCheck whether the grid corresponding to the given gridId is still present on the device. )(uint32_t dev, uint64_t gridId64, CUDBGGridStatusGrid status.  *status);
    CUDBGResultResult values of all the API routines.  (*setKernelLaunchNotificationMode) (CUDBGKernelLaunchNotifyModeKernel launch notification mode.  mode);
    CUDBGResultResult values of all the API routines.  (*getDevicePCIBusInfo) (uint32_t devIdId, uint32_t *pciBusId, uint32_t *pciDevId);
};

#ifdef __cplusplus
}
#endif

#endif

Classes

struct 
The CUDA debugger API routines.
struct 
Event information container.
struct 
Event information passed to callback set with setNotifyNewEventCallback function.
struct 
Event information passed to callback set with setNotifyNewEventCallback function.
struct 
Grid info.

Typedefs

typedef void  
function type of the function called to notify debugger of the presence of a new event in the event queue.
typedef void  
function type of the function called to notify debugger of the presence of a new event in the event queue.

Enumerations

enum  {CUDBG_ATTR_GRID_LAUNCH_BLOCKING = 0x000, CUDBG_ATTR_GRID_TID = 0x001 }
Query attribute.
enum  {CUDBG_EVENT_INVALID = 0x000, CUDBG_EVENT_ELF_IMAGE_LOADED = 0x001, CUDBG_EVENT_KERNEL_READY = 0x002, CUDBG_EVENT_KERNEL_FINISHED = 0x003, CUDBG_EVENT_INTERNAL_ERROR = 0x004, CUDBG_EVENT_CTX_PUSH = 0x005, CUDBG_EVENT_CTX_POP = 0x006, CUDBG_EVENT_CTX_CREATE = 0x007, CUDBG_EVENT_CTX_DESTROY = 0x008, CUDBG_EVENT_TIMEOUT = 0x009, CUDBG_EVENT_ATTACH_COMPLETE = 0x00a, CUDBG_EVENT_DETACH_COMPLETE = 0x00b }
CUDA Kernel Events.
enum  {CUDBG_EXCEPTION_UNKNOWN = 0xFFFFFFFFU, CUDBG_EXCEPTION_NONE = 0, CUDBG_EXCEPTION_LANE_ILLEGAL_ADDRESS = 1, CUDBG_EXCEPTION_LANE_USER_STACK_OVERFLOW = 2, CUDBG_EXCEPTION_DEVICE_HARDWARE_STACK_OVERFLOW = 3, CUDBG_EXCEPTION_WARP_ILLEGAL_INSTRUCTION = 4, CUDBG_EXCEPTION_WARP_OUT_OF_RANGE_ADDRESS = 5, CUDBG_EXCEPTION_WARP_MISALIGNED_ADDRESS = 6, CUDBG_EXCEPTION_WARP_INVALID_ADDRESS_SPACE = 7, CUDBG_EXCEPTION_WARP_INVALID_PC = 8, CUDBG_EXCEPTION_WARP_HARDWARE_STACK_OVERFLOW = 9, CUDBG_EXCEPTION_DEVICE_ILLEGAL_ADDRESS = 10, CUDBG_EXCEPTION_LANE_MISALIGNED_ADDRESS = 11, CUDBG_EXCEPTION_WARP_ASSERT = 12, CUDBG_EXCEPTION_LANE_SYSCALL_ERROR = 13, CUDBG_EXCEPTION_WARP_ILLEGAL_ADDRESS = 14 }
Harwdare Exception Types.
enum  {CUDBG_GRID_STATUS_INVALID, CUDBG_GRID_STATUS_PENDING, CUDBG_GRID_STATUS_ACTIVE, CUDBG_GRID_STATUS_SLEEPING, CUDBG_GRID_STATUS_TERMINATED, CUDBG_GRID_STATUS_UNDETERMINED }
Grid status.
enum  {CUDBG_KNL_LAUNCH_NOTIFY_EVENT = 0x000, CUDBG_KNL_LAUNCH_NOTIFY_DEFER = 0x001 }
Kernel launch notification mode.
enum  {CUDBG_KNL_ORIGIN_CPU = 0x000, CUDBG_KNL_ORIGIN_GPU = 0x001 }
Kernel origin.
enum  {CUDBG_KNL_TYPE_UNKNOWN = 0x000, CUDBG_KNL_TYPE_SYSTEM = 0x001, CUDBG_KNL_TYPE_APPLICATION = 0x002 }
Kernel types.
enum  {REG_CLASS_INVALID = 0x000, REG_CLASS_REG_CC = 0x001, REG_CLASS_REG_PRED = 0x002, REG_CLASS_REG_ADDR = 0x003, REG_CLASS_REG_HALF = 0x004, REG_CLASS_REG_FULL = 0x005, REG_CLASS_MEM_LOCAL = 0x006, REG_CLASS_LMEM_REG_OFFSET = 0x007 }
Physical register types.
enum  {CUDBG_SUCCESS = 0x0000, CUDBG_ERROR_UNKNOWN = 0x0001, CUDBG_ERROR_BUFFER_TOO_SMALL = 0x0002, CUDBG_ERROR_UNKNOWN_FUNCTION = 0x0003, CUDBG_ERROR_INVALID_ARGS = 0x0004, CUDBG_ERROR_UNINITIALIZED = 0x0005, CUDBG_ERROR_INVALID_COORDINATES = 0x0006, CUDBG_ERROR_INVALID_MEMORY_SEGMENT = 0x0007, CUDBG_ERROR_INVALID_MEMORY_ACCESS = 0x0008, CUDBG_ERROR_MEMORY_MAPPING_FAILED = 0x0009, CUDBG_ERROR_INTERNAL = 0x000a, CUDBG_ERROR_INVALID_DEVICE = 0x000b, CUDBG_ERROR_INVALID_SM = 0x000c, CUDBG_ERROR_INVALID_WARP = 0x000d, CUDBG_ERROR_INVALID_LANE = 0x000e, CUDBG_ERROR_SUSPENDED_DEVICE = 0x000f, CUDBG_ERROR_RUNNING_DEVICE = 0x0010, CUDBG_ERROR_INVALID_ADDRESS = 0x0012, CUDBG_ERROR_INCOMPATIBLE_API = 0x0013, CUDBG_ERROR_INITIALIZATION_FAILURE = 0x0014, CUDBG_ERROR_INVALID_GRID = 0x0015, CUDBG_ERROR_NO_EVENT_AVAILABLE = 0x0016, CUDBG_ERROR_SOME_DEVICES_WATCHDOGGED = 0x0017, CUDBG_ERROR_ALL_DEVICES_WATCHDOGGED = 0x0018, CUDBG_ERROR_INVALID_ATTRIBUTE = 0x0019, CUDBG_ERROR_ZERO_CALL_DEPTH = 0x001a, CUDBG_ERROR_INVALID_CALL_LEVEL = 0x001b, CUDBG_ERROR_COMMUNICATION_FAILURE = 0x001c, CUDBG_ERROR_INVALID_CONTEXT = 0x001d, CUDBG_ERROR_ADDRESS_NOT_IN_DEVICE_MEM = 0x001e, CUDBG_ERROR_MEMORY_UNMAPPING_FAILED = 0x001f, CUDBG_ERROR_INCOMPATIBLE_DISPLAY_DRIVER = 0x0020, CUDBG_ERROR_INVALID_MODULE = 0x0021, CUDBG_ERROR_LANE_NOT_IN_SYSCALL = 0x0022, CUDBG_ERROR_MEMCHECK_NOT_ENABLED = 0x0023, CUDBG_ERROR_INVALID_ENVVAR_ARGS = 0x0024, CUDBG_ERROR_OS_RESOURCES = 0x0025, CUDBG_ERROR_FORK_FAILED = 0x0026, CUDBG_ERROR_NO_DEVICE_AVAILABLE = 0x0027 }
Result values of all the API routines.

Functions

CUDBGResult  ( uint32_t* major, uint32_t* minor, uint32_t* rev )
Get the API version supported by the CUDA driver.

Debugger API (PDF) - CUDA Toolkit v5.5 (older) - Last updated May 11, 2013 - Send Feedback