18#include "../_cu_definitions/cu_types.h"
20#include "../_definitions/debugging.h"
21#include "../_cu_basic_algebra/cu_vector_operations.h"
22#include "../_cuda_utilities/cuda_api.h"
23#include "../_cu_arithmetics/cu_arithmetics.h"
33template <
typename DataType>
49template <
typename DataType>
96template <
typename DataType>
98 const DataType* known_parameters,
99 const DataType known_eigenvalue,
100 const DataType* inquiry_parameters)
const
102 ASSERT((this->eigenvalue_relation_known == 1),
103 "An eigenvalue relation is not known. This function should be "
104 "called only when the matrix B is a scalar multiple of the "
108 DataType inquiry_eigenvalue = \
109 cu_arithmetics::add<DataType>(
112 known_parameters[0]),
113 inquiry_parameters[0]
116 return inquiry_eigenvalue;
139template <
typename DataType>
141 const DataType* input_vector,
143 const DataType scale,
144 DataType* output_vector)
const
156 this->cublas_handle[device_id], input_vector, vector_size,
157 neg_scale, output_vector);
165#if defined(USE_CUDA_FP8_E5M2) && (USE_CUDA_FP8_E5M2 == 1)
169#if defined(USE_CUDA_FP8_E4M3) && (USE_CUDA_FP8_E4M3 == 1)
173#if defined(USE_CUDA_FP16) && (USE_CUDA_FP16 == 1)
177#if defined(USE_CUDA_BF16) && (USE_CUDA_BF16 == 1)
181#if defined(USE_CUDA_FP32) && (USE_CUDA_FP32 == 1)
185#if defined(USE_CUDA_FP64) && (USE_CUDA_FP64 == 1)
static int get_device()
Gets the current device in multi-gpu applications.
Base class for affine matrix functions of one parameter.
virtual ~cuAffineMatrixFunction()
Virtual destructor.
cuAffineMatrixFunction()
Constructor.
DataType get_eigenvalue(const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const
This function defines an analytic relationship between a given set of parameters and the correspondin...
void _add_scaled_vector(const DataType *input_vector, const LongIndexType vector_size, const DataType scale, DataType *output_vector) const
Performs the operation , where is an input vector scaled by and it the output vector.
static void subtract_scaled_vector(cublasHandle_t cublas_handle, const DataType *RESTRICT input_vector, const LongIndexType vector_size, const DataType scale, DataType *RESTRICT output_vector)
Subtracts the scaled input vector from the output vector.
#define ASSERT(condition, message)
__host__ __device__ DataType abs(const DataType x)
Absolute value of a floating point number.