服务#

服务函数在以下文件中定义

  • C / C++ 头文件: include/nvpl_blas_service.h

  • Fortran 接口: include/nvpl_blas_service.fi

版本信息#

nvpl_blas_get_version()#

  • C / C++

    int nvpl_blas_get_version()#
  • Fortran

    integer*4 function nvpl_blas_get_version()
    

以以下格式返回库版本: NVPL_BLAS_VERSION_MAJOR * 10000 + NVPL_BLAS_VERSION_MINOR * 100 + NVPL_BLAS_VERSION_PATCH

线程控制#

nvpl_blas_get_max_threads()#

  • C / C++

    int nvpl_blas_get_max_threads()#
  • Fortran

    integer*4 function nvpl_blas_get_max_threads()
    

返回 NVPL BLAS 可用于并行化的线程数。

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
    

设置 NVPL BLAS 应使用的线程数。

  • 默认值:0。

  • 使用 0 以遵循线程运行时默认值。负数 nthr 将被忽略。

  • 该函数对于顺序库无效。

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
    

设置从当前线程调用库时,库应使用的(线程)本地线程数。当库从可能需要不同嵌套线程行为的不同线程调用时,此函数很有用。

  • 默认值:0。

  • 使用 0 以遵循全局设置。负数 nthr_local 将被忽略。

  • 此函数优先于 nvpl_blas_set_num_threads()

  • 该函数对于顺序库无效。

建议在使用后重置线程本地线程数。

返回 nthr_local 的先前值。