OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
opennn::Backend Class Reference

Process-wide singleton that owns the thread pool and the cuBLAS/cuDNN handles. More...

#include <tensor_utilities.h>

Public Member Functions

ThreadPoolDevice * get_thread_pool_device ()
 Returns the Eigen ThreadPoolDevice used for CPU tensor evaluations.
 
void set_threads_number (int num_threads)
 Reconfigures the underlying thread pool to use num_threads workers.
 

Static Public Member Functions

static Backendinstance ()
 Returns the global Backend instance.
 
static cublasHandle_t get_cublas_handle ()
 Shared cuBLAS handle for legacy GEMM calls.
 
static cublasLtHandle_t get_cublas_lt_handle ()
 Shared cuBLASLt handle for batched/tuned GEMMs.
 
static cudnnHandle_t get_cudnn_handle ()
 Shared cuDNN handle.
 
static cudaStream_t get_compute_stream ()
 Default CUDA stream used by the compute backend.
 
static cudnnOpTensorDescriptor_t get_operator_sum_descriptor ()
 cuDNN op-tensor descriptor configured for elementwise sum.
 

Detailed Description

Process-wide singleton that owns the thread pool and the cuBLAS/cuDNN handles.

Member Function Documentation

◆ get_compute_stream()

static cudaStream_t opennn::Backend::get_compute_stream ( )
inlinestatic

Default CUDA stream used by the compute backend.

◆ get_cublas_handle()

static cublasHandle_t opennn::Backend::get_cublas_handle ( )
inlinestatic

Shared cuBLAS handle for legacy GEMM calls.

◆ get_cublas_lt_handle()

static cublasLtHandle_t opennn::Backend::get_cublas_lt_handle ( )
inlinestatic

Shared cuBLASLt handle for batched/tuned GEMMs.

◆ get_cudnn_handle()

static cudnnHandle_t opennn::Backend::get_cudnn_handle ( )
inlinestatic

Shared cuDNN handle.

◆ get_operator_sum_descriptor()

static cudnnOpTensorDescriptor_t opennn::Backend::get_operator_sum_descriptor ( )
inlinestatic

cuDNN op-tensor descriptor configured for elementwise sum.

◆ get_thread_pool_device()

ThreadPoolDevice * opennn::Backend::get_thread_pool_device ( )

Returns the Eigen ThreadPoolDevice used for CPU tensor evaluations.

◆ instance()

static Backend & opennn::Backend::instance ( )
static

Returns the global Backend instance.

◆ set_threads_number()

void opennn::Backend::set_threads_number ( int num_threads)

Reconfigures the underlying thread pool to use num_threads workers.