mirror of
https://github.com/amd/blis.git
synced 2026-05-04 22:41:11 +00:00
Key features: - able to test both static and dynamic libraries - able to test BLAS, CBLAS and BLIS-typed interface - can use any CBLAS library for reference results - can build and/or run tests depending on the BLAS level or a specific API AMD-Internal: [CPUPL-2732] Change-Id: Ibe0d7938e06081526bbc54d3182ac7d17affdaf6
55 lines
2.0 KiB
C++
55 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <random>
|
|
#include "common/type_info.h"
|
|
|
|
namespace testinghelpers {
|
|
namespace datagenerators {
|
|
|
|
/***************************************************
|
|
* Random Generators
|
|
****************************************************/
|
|
/**
|
|
* @brief Returns a random int/float converted to an fp type (float, double, scomplex, dcomplex)
|
|
* that lies in the range [from, to].
|
|
*
|
|
* @param[in, out] alpha the random fp
|
|
*/
|
|
template<typename T>
|
|
void randomgenerators(int from, int to, T* alpha, char fp);
|
|
|
|
/**
|
|
* @brief Returns a random vector (float, double, scomplex, dcomplex)
|
|
* with elements that are integers or floats, depending on char, and follow a uniform distribution in the range [from, to].
|
|
* @param[in] n length of vector x
|
|
* @param[in] incx increments of vector x
|
|
* @param[in, out] x the random fp vector
|
|
* @param[in] fp if fp=='i' the elements will have random integer values.
|
|
* if fp=='f' the elements will have random float values.
|
|
*/
|
|
template<typename T>
|
|
void randomgenerators(int from, int to, gtint_t n, gtint_t incx, T* x, char fp);
|
|
|
|
template<typename T>
|
|
void randomgenerators(int from, int to, char storage, gtint_t m, gtint_t n, T* a, gtint_t lda, char fp);
|
|
|
|
template<typename T>
|
|
void randomgenerators(int from, int to, char storage, gtint_t m, gtint_t n, T* a, char transa, gtint_t lda, char fp);
|
|
|
|
template<typename T>
|
|
void randomgenerators(int from, int to, char storage, char uplo, gtint_t m,
|
|
T* a, gtint_t lda, char datatype);
|
|
} //end of namespace datagenerators
|
|
|
|
template<typename T>
|
|
std::vector<T> get_random_matrix(int from, int to, char storage, char trans, gtint_t m, gtint_t n,
|
|
gtint_t lda, char datatype);
|
|
|
|
template<typename T>
|
|
std::vector<T> get_random_matrix(int from, int to, char storage, char uplo, gtint_t k,
|
|
gtint_t lda, char datatype);
|
|
|
|
template<typename T>
|
|
std::vector<T> get_random_vector(int from, int to, gtint_t n, gtint_t incx, char datatype);
|
|
|
|
} //end of namespace testinghelpers
|