CUBLAS Library
CUBLAS Library
CUBLAS Library
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CUDA<strong>CUBLAS</strong> <strong>Library</strong>Function cublasInit()cublasStatuscublasInit (void)initializes the <strong>CUBLAS</strong> library and must be called before any other<strong>CUBLAS</strong> API function is invoked. It allocates hardware resourcesnecessary for accessing the GPU.Return Values<strong>CUBLAS</strong>_STATUS_ALLOC_FAILED if resources could not be allocated<strong>CUBLAS</strong>_STATUS_SUCCESS if <strong>CUBLAS</strong> library initialized successfullyFunction cublasShutdown()cublasStatuscublasShutdown (void)releases CPU‐side resources used by the <strong>CUBLAS</strong> library. The releaseof GPU‐side resources may be deferred until the application shutsdown.Return Values<strong>CUBLAS</strong>_STATUS_NOT_INITIALIZED if <strong>CUBLAS</strong> library was not initialized<strong>CUBLAS</strong>_STATUS_SUCCESS <strong>CUBLAS</strong> library shut down successfullyFunction cublasGetError()cublasStatuscublasGetError (void)returns the last error that occurred on invocation of any of the<strong>CUBLAS</strong> core functions. While the <strong>CUBLAS</strong> helper functions returnstatus directly, the <strong>CUBLAS</strong> core functions do not, improvingcompatibility with those existing environments that do not expectBLAS functions to return status. Reading the error status viacublasGetError() resets the internal error state to<strong>CUBLAS</strong>_STATUS_SUCCESS.Function cublasAlloc()cublasStatuscublasAlloc (int n, int elemSize, void **devicePtr)8 PG-00000-002_V1.1NVIDIA