mirror of
https://github.com/amd/blis.git
synced 2026-05-04 14:31:12 +00:00
Introducing upgrated BLIS GTestSuite.
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
This commit is contained in:
55
gtestsuite/testinghelpers/inc/common/data_generators.h
Normal file
55
gtestsuite/testinghelpers/inc/common/data_generators.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user