Service

The service functions are defined in the following files:

  • C / C++ header: include/nvpl_blas_service.h

  • Fortran interface: include/nvpl_blas_service.fi

Version Information

nvpl_blas_get_version()

  • C / C++

    int nvpl_blas_get_version()
  • Fortran

    integer*4 function nvpl_blas_get_version()
    

Returns the library version in the following format: NVPL_BLAS_VERSION_MAJOR * 10000 + NVPL_BLAS_VERSION_MINOR * 100 + NVPL_BLAS_VERSION_PATCH.

Threading Control

nvpl_blas_get_max_threads()

  • C / C++

    int nvpl_blas_get_max_threads()
  • Fortran

    integer*4 function nvpl_blas_get_max_threads()
    

Returns the number of threads available for NVPL BLAS to use for parallelization.

nvpl_blas_set_num_threads()

  • C / C++

    void nvpl_blas_set_num_threads(int nthr)
  • Fortran

    subroutine nvpl_blas_set_num_threads(nthr)
    integer*4 nthr
    

Sets the number of threads that NVPL BLAS should use.

  • Default: 0.

  • Use 0 to follow the threading runtime defaults. Negative nthr is ignored.

  • The function has no effect for sequential library.

nvpl_blas_set_num_threads_local()

  • C / C++

    int nvpl_blas_set_num_threads_local(int nthr_local)
  • Fortran

    subroutine nvpl_blas_set_num_threads_local(nthr_local)
    integer*4 nthr_local
    

Sets the (thread) local number of threads that the library should use when called from the current thread. This function is useful when the library is called from different threads which might require different nested threading behavior.

  • Default: 0.

  • Use 0 to follow the global settings. Negative nthr_local is ignored.

  • This function takes precedence over nvpl_blas_set_num_threads().

  • The function has no effect for sequential library.

It is advised to reset the thread-local number of threads after use.

Returns the previous value of nthr_local.