nvperfapi_system.h

Go to the documentation of this file.
00001 #ifndef NVPERFAPI_SYSTEM_H
00002 #define NVPERFAPI_SYSTEM_H
00003 
00004 /*
00005  * Copyright 2014-2017  NVIDIA Corporation.  All rights reserved.
00006  *
00007  * NOTICE TO USER:
00008  *
00009  * This source code is subject to NVIDIA ownership rights under U.S. and
00010  * international Copyright laws.
00011  *
00012  * This software and the information contained herein is PROPRIETARY and
00013  * CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
00014  * of a form of NVIDIA software license agreement.
00015  *
00016  * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
00017  * CODE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
00018  * IMPLIED WARRANTY OF ANY KIND.  NVIDIA DISCLAIMS ALL WARRANTIES WITH
00019  * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
00020  * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
00021  * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
00022  * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
00023  * OF USE, DATA OR PROFITS,  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00024  * OR OTHER TORTIOUS ACTION,  ARISING OUT OF OR IN CONNECTION WITH THE USE
00025  * OR PERFORMANCE OF THIS SOURCE CODE.
00026  *
00027  * U.S. Government End Users.   This source code is a "commercial item" as
00028  * that term is defined at  48 C.F.R. 2.101 (OCT 1995), consisting  of
00029  * "commercial computer  software"  and "commercial computer software
00030  * documentation" as such terms are  used in 48 C.F.R. 12.212 (SEPT 1995)
00031  * and is provided to the U.S. Government only as a commercial end item.
00032  * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
00033  * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
00034  * source code with only those rights set forth herein.
00035  *
00036  * Any use of this source code in individual and commercial software must
00037  * include, in the user documentation and internal comments to the code,
00038  * the above Disclaimer and U.S. Government End Users Notice.
00039  */
00040 
00041 #include "nvperfapi_common_types.h"
00042 
00043 
00044 #if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
00045 #pragma GCC visibility push(default)
00046 #endif
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 
00058 /***************************************************************************/
00072 NVPA_Status NVPA_Init(void);
00073 
00077 NVPA_Status NVPA_GetVersionNumber(int* major, int* minor, int* rev);
00078 
00083 NVPA_Status NVPA_D3D11_LoadDriver(void);
00084 
00089 NVPA_Status NVPA_D3D12_LoadDriver(void);
00090 
00096 NVPA_Status NVPA_OpenGL_LoadDriver(void);
00097 
00102 NVPA_Status NVPA_EGL_LoadDriver(void);
00103 
00109 NVPA_Status NVPA_CUDA_LoadDriver(void);
00110 
00113 typedef void (*NVPA_ErrorHandler)(NVPA_Status);
00114 
00130 NVPA_LOCAL
00131 NVPA_Status NVPA_SetErrorHandler(
00132     NVPA_ErrorHandler errorHandler
00133 );
00134 
00158 NVPA_LOCAL
00159 NVPA_Status NVPA_SetLibraryLoadPaths(size_t numPaths, const char** ppPaths);
00160 
00186 NVPA_LOCAL
00187 NVPA_Status NVPA_SetLibraryLoadPathsW(size_t numPaths, const wchar_t** ppwPaths);
00188 
00194 /***************************************************************************/
00201 NVPA_Status NVPA_GetNumDevices(
00202     size_t* pNumDevices
00203 );
00204 
00208 typedef enum NVPA_DeviceAttr
00209 {
00211     NVPA_DEVICE_ATTR_INVALID = 0,
00212 
00214     NVPA_DEVICE_ATTR_NUM_SM,
00215 
00217     NVPA_DEVICE_ATTR__COUNT
00218 } NVPA_DeviceAttr;
00219 
00222 NVPA_Status NVPA_Device_GetName(
00223     size_t deviceIndex,
00224     const char** ppDeviceName
00225 );
00226 
00232 NVPA_Status NVPA_Device_GetChipName(
00233     size_t deviceIndex,
00234     const char** ppChipName
00235 );
00236 
00239 NVPA_Status NVPA_Device_GetAttribute(
00240     size_t deviceIndex,
00241     NVPA_DeviceAttr attr,
00242     uint64_t* pValue
00243 );
00244 
00250 /***************************************************************************/
00262 NVPA_Status NVPA_D3D11_Register(
00263     struct ID3D11DeviceContext* pDeviceContext
00264 );
00265 
00271 NVPA_Status NVPA_D3D11_Unregister(
00272     struct ID3D11DeviceContext* pDeviceContext
00273 );
00274 
00277 NVPA_Status NVPA_D3D12_Queue_Register(
00278     struct ID3D12CommandQueue* pCommandQueue
00279 );
00280 
00286 NVPA_Status NVPA_D3D12_Queue_Unregister(
00287     struct ID3D12CommandQueue* pCommandQueue
00288 );
00289 
00296 NVPA_Status NVPA_D3D12_CommandList_Register(
00297     struct ID3D12GraphicsCommandList* pCommandList
00298 );
00299 
00305 NVPA_Status NVPA_D3D12_CommandList_Unregister(
00306     struct ID3D12GraphicsCommandList* pCommandList
00307 );
00308 
00313 NVPA_Status NVPA_OpenGL_Register(void);
00314 
00319 NVPA_Status NVPA_OpenGL_Unregister(void);
00320 
00325 NVPA_Status NVPA_EGL_Register(void);
00326 
00331 NVPA_Status NVPA_EGL_Unregister(void);
00332 
00337 #ifndef __cplusplus
00338 NVPA_Status NVPA_CUDA_Register(
00339     struct CUctx_st* ctx
00340 );
00341 #else
00342 NVPA_Status NVPA_CUDA_Register(struct CUctx_st* ctx = NULL);
00343 #endif
00344 
00349 #ifndef __cplusplus
00350 NVPA_Status NVPA_CUDA_Unregister(
00351     struct CUctx_st* ctx
00352 );
00353 #else
00354 NVPA_Status NVPA_CUDA_Unregister(struct CUctx_st* ctx = NULL);
00355 #endif
00356 
00362 /***************************************************************************/
00372 NVPA_Status NVPA_D3D11_GetConfig(
00373     struct ID3D11DeviceContext* pDeviceContext,
00374     const NVPA_Config** ppConfig
00375 );
00376 
00382 NVPA_Status NVPA_D3D12_Queue_GetConfig(
00383     struct ID3D12CommandQueue* pCommandQueue,
00384     const NVPA_Config** ppConfig
00385 );
00386 
00394 NVPA_Status NVPA_OpenGL_GetConfig(
00395     const NVPA_Config** ppConfig
00396 );
00397 
00405 NVPA_Status NVPA_EGL_GetConfig(
00406     const NVPA_Config** ppConfig
00407 );
00408 
00417 #ifndef __cplusplus
00418 NVPA_Status NVPA_CUDA_GetConfig(
00419     const NVPA_Config** ppConfig,
00420     struct CUctx_st* ctx
00421 );
00422 #else
00423 NVPA_Status NVPA_CUDA_GetConfig(const NVPA_Config** ppConfig, struct CUctx_st* ctx = NULL);
00424 #endif
00425 
00435 NVPA_Status NVPA_OpenGL_GetCurrentContext(
00436     void** ppGLContext
00437 );
00438 
00441 NVPA_Status NVPA_D3D11_GetSliDeviceCount(
00442     struct ID3D11DeviceContext* pDeviceContext,
00443     size_t* pSliDeviceCount
00444 );
00445 
00448 NVPA_Status NVPA_D3D12_Queue_GetSliDeviceCount(
00449     struct ID3D12CommandQueue* pCommandQueue,
00450     size_t* pSliDeviceCount
00451 );
00452 
00457 NVPA_Status NVPA_OpenGL_GetSliDeviceCount(
00458     size_t* pSliDeviceCount
00459 );
00460 
00465 NVPA_Status NVPA_EGL_GetSliDeviceCount(
00466     size_t* pSliDeviceCount
00467 );
00468 
00474 #ifndef __cplusplus
00475 NVPA_Status NVPA_CUDA_GetSliDeviceCount(
00476     size_t* pSliDeviceCount,
00477     struct CUctx_st* ctx
00478 );
00479 #else
00480 NVPA_Status NVPA_CUDA_GetSliDeviceCount(size_t* pSliDeviceCount, struct CUctx_st* ctx = NULL);
00481 #endif
00482 
00489 NVPA_Status NVPA_D3D11_GetDeviceIndex(
00490     struct ID3D11DeviceContext* pDeviceContext,
00491     size_t sliIndex,
00492     size_t* pDeviceIndex
00493 );
00494 
00501 NVPA_Status NVPA_D3D12_Queue_GetDeviceIndex(
00502     struct ID3D12CommandQueue* pCommandQueue,
00503     size_t sliIndex,
00504     size_t* pDeviceIndex
00505 );
00506 
00516 NVPA_Status NVPA_OpenGL_GetDeviceIndex(
00517     size_t sliIndex,
00518     size_t* pDeviceIndex
00519 );
00520 
00530 NVPA_Status NVPA_EGL_GetDeviceIndex(
00531     size_t sliIndex,
00532     size_t* pDeviceIndex
00533 );
00534 
00546 #ifndef __cplusplus
00547 NVPA_Status NVPA_CUDA_GetDeviceIndex(
00548     size_t sliIndex,
00549     size_t* pDeviceIndex,
00550     struct CUctx_st* ctx
00551 );
00552 #else
00553 NVPA_Status NVPA_CUDA_GetDeviceIndex(size_t sliIndex, size_t* pDeviceIndex, struct CUctx_st* ctx = NULL);
00554 #endif
00555 
00564 NVPA_Status NVPA_D3D11_Finish(
00565     struct ID3D11DeviceContext* pDeviceContext
00566 );
00567 
00576 NVPA_Status NVPA_D3D12_Queue_Finish(
00577     struct ID3D12CommandQueue* pCommandQueue
00578 );
00579 
00591 NVPA_Status NVPA_D3D12_CommandList_EnableAutoRangesDraw(
00592     struct ID3D12GraphicsCommandList* pCommandList,
00593     NVPA_Bool enable
00594 );
00595 
00605 NVPA_Status NVPA_D3D12_Queue_HandleProfilerEvents(
00606     struct ID3D12CommandQueue* pCommandQueue,
00607     uint64_t timeout,
00608     size_t numPasses,
00609     NVPA_GpuEventHandlingResult* pResult
00610 );
00611 
00622 NVPA_Status NVPA_OpenGL_Finish(void);
00623 
00634 NVPA_Status NVPA_EGL_Finish(void);
00635 
00646 #ifndef __cplusplus
00647 NVPA_Status NVPA_CUDA_Finish(
00648     struct CUctx_st* ctx
00649 );
00650 #else
00651 NVPA_Status NVPA_CUDA_Finish(struct CUctx_st* ctx = NULL);
00652 #endif
00653 
00659 #ifdef __cplusplus
00660 } /* extern "C" */
00661 #endif
00662 
00663 #if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
00664 #pragma GCC visibility pop
00665 #endif
00666 
00667 
00668 #endif /* NVPERFAPI_SYSTEM_H */

NVIDIA(R) PerfWorks SDK Documentation (c) 2015-2016. NVIDIA Corporation. All Rights Reserved.