Halide
Halide::SimdOpCheckTest Class Referenceabstract

#include <simd_op_check.h>

Public Types

using Sharder = Halide::Internal::Test::Sharder
 

Public Member Functions

 SimdOpCheckTest (const Target t, int w, int h)
 
virtual ~SimdOpCheckTest ()=default
 
void set_seed (int seed)
 
virtual bool can_run_code () const
 
virtual void compile_and_check (Func error, const std::string &op, const std::string &name, int vector_width, std::ostringstream &error_msg)
 
bool wildcard_match (const char *p, const char *str) const
 
bool wildcard_match (const std::string &p, const std::string &str) const
 
bool wildcard_search (const std::string &p, const std::string &str) const
 
Target get_run_target () const
 
TestResult check_one (const std::string &op, const std::string &name, int vector_width, Expr e)
 
void check (std::string op, int vector_width, Expr e)
 
virtual void add_tests ()=0
 
virtual void setup_images ()
 
virtual bool test_all ()
 

Static Public Member Functions

template<typename SIMDOpCheckT >
static int main (int argc, char **argv, const std::vector< Target > &targets_to_test)
 

Public Attributes

const Expr max_u32 = UInt(32).max()
 
std::string filter {"*"}
 
std::string output_directory {Internal::get_test_tmp_dir()}
 
std::vector< Tasktasks
 
std::mt19937 rng
 
Target target
 
ImageParam in_f32 {Float(32), 1, "in_f32"}
 
ImageParam in_f64 {Float(64), 1, "in_f64"}
 
ImageParam in_f16 {Float(16), 1, "in_f16"}
 
ImageParam in_bf16 {BFloat(16), 1, "in_bf16"}
 
ImageParam in_i8 {Int(8), 1, "in_i8"}
 
ImageParam in_u8 {UInt(8), 1, "in_u8"}
 
ImageParam in_i16 {Int(16), 1, "in_i16"}
 
ImageParam in_u16 {UInt(16), 1, "in_u16"}
 
ImageParam in_i32 {Int(32), 1, "in_i32"}
 
ImageParam in_u32 {UInt(32), 1, "in_u32"}
 
ImageParam in_i64 {Int(64), 1, "in_i64"}
 
ImageParam in_u64 {UInt(64), 1, "in_u64"}
 
const std::vector< ImageParamimage_params {in_f32, in_f64, in_f16, in_bf16, in_i8, in_u8, in_i16, in_u16, in_i32, in_u32, in_i64, in_u64}
 
const std::vector< Argumentarg_types {in_f32, in_f64, in_f16, in_bf16, in_i8, in_u8, in_i16, in_u16, in_i32, in_u32, in_i64, in_u64}
 
int W
 
int H
 

Static Public Attributes

static constexpr int max_i8 = 127
 
static constexpr int max_i16 = 32767
 
static constexpr int max_i32 = 0x7fffffff
 
static constexpr int max_u8 = 255
 
static constexpr int max_u16 = 65535
 

Detailed Description

Definition at line 24 of file simd_op_check.h.

Member Typedef Documentation

◆ Sharder

Constructor & Destructor Documentation

◆ SimdOpCheckTest()

Halide::SimdOpCheckTest::SimdOpCheckTest ( const Target  t,
int  w,
int  h 
)
inline

◆ ~SimdOpCheckTest()

virtual Halide::SimdOpCheckTest::~SimdOpCheckTest ( )
virtualdefault

Member Function Documentation

◆ set_seed()

void Halide::SimdOpCheckTest::set_seed ( int  seed)
inline

Definition at line 69 of file simd_op_check.h.

References rng.

◆ can_run_code()

◆ compile_and_check()

virtual void Halide::SimdOpCheckTest::compile_and_check ( Func  error,
const std::string &  op,
const std::string &  name,
int  vector_width,
std::ostringstream &  error_msg 
)
inlinevirtual

◆ wildcard_match() [1/2]

bool Halide::SimdOpCheckTest::wildcard_match ( const char *  p,
const char *  str 
) const
inline

Definition at line 151 of file simd_op_check.h.

Referenced by check(), wildcard_match(), and wildcard_search().

◆ wildcard_match() [2/2]

bool Halide::SimdOpCheckTest::wildcard_match ( const std::string &  p,
const std::string &  str 
) const
inline

Definition at line 181 of file simd_op_check.h.

References wildcard_match().

◆ wildcard_search()

bool Halide::SimdOpCheckTest::wildcard_search ( const std::string &  p,
const std::string &  str 
) const
inline

Definition at line 186 of file simd_op_check.h.

References wildcard_match().

Referenced by compile_and_check().

◆ get_run_target()

Target Halide::SimdOpCheckTest::get_run_target ( ) const
inline

◆ check_one()

◆ check()

void Halide::SimdOpCheckTest::check ( std::string  op,
int  vector_width,
Expr  e 
)
inline

Definition at line 314 of file simd_op_check.h.

References filter, tasks, and wildcard_match().

◆ add_tests()

virtual void Halide::SimdOpCheckTest::add_tests ( )
pure virtual

Referenced by test_all().

◆ setup_images()

virtual void Halide::SimdOpCheckTest::setup_images ( )
inlinevirtual

Definition at line 331 of file simd_op_check.h.

References image_params.

Referenced by check_one().

◆ test_all()

virtual bool Halide::SimdOpCheckTest::test_all ( )
inlinevirtual

◆ main()

template<typename SIMDOpCheckT >
static int Halide::SimdOpCheckTest::main ( int  argc,
char **  argv,
const std::vector< Target > &  targets_to_test 
)
inlinestatic

Definition at line 368 of file simd_op_check.h.

References atoi(), and Halide::get_host_target().

Member Data Documentation

◆ max_i8

constexpr int Halide::SimdOpCheckTest::max_i8 = 127
staticconstexpr

Definition at line 26 of file simd_op_check.h.

◆ max_i16

constexpr int Halide::SimdOpCheckTest::max_i16 = 32767
staticconstexpr

Definition at line 27 of file simd_op_check.h.

◆ max_i32

constexpr int Halide::SimdOpCheckTest::max_i32 = 0x7fffffff
staticconstexpr

Definition at line 28 of file simd_op_check.h.

◆ max_u8

constexpr int Halide::SimdOpCheckTest::max_u8 = 255
staticconstexpr

Definition at line 29 of file simd_op_check.h.

◆ max_u16

constexpr int Halide::SimdOpCheckTest::max_u16 = 65535
staticconstexpr

Definition at line 30 of file simd_op_check.h.

◆ max_u32

const Expr Halide::SimdOpCheckTest::max_u32 = UInt(32).max()

Definition at line 31 of file simd_op_check.h.

◆ filter

std::string Halide::SimdOpCheckTest::filter {"*"}

Definition at line 33 of file simd_op_check.h.

Referenced by check().

◆ output_directory

std::string Halide::SimdOpCheckTest::output_directory {Internal::get_test_tmp_dir()}

Definition at line 34 of file simd_op_check.h.

Referenced by compile_and_check().

◆ tasks

std::vector<Task> Halide::SimdOpCheckTest::tasks

Definition at line 35 of file simd_op_check.h.

Referenced by check(), and test_all().

◆ rng

std::mt19937 Halide::SimdOpCheckTest::rng

Definition at line 36 of file simd_op_check.h.

Referenced by set_seed().

◆ target

Target Halide::SimdOpCheckTest::target

Definition at line 38 of file simd_op_check.h.

Referenced by can_run_code(), compile_and_check(), get_run_target(), and SimdOpCheckTest().

◆ in_f32

ImageParam Halide::SimdOpCheckTest::in_f32 {Float(32), 1, "in_f32"}

Definition at line 40 of file simd_op_check.h.

◆ in_f64

ImageParam Halide::SimdOpCheckTest::in_f64 {Float(64), 1, "in_f64"}

Definition at line 41 of file simd_op_check.h.

◆ in_f16

ImageParam Halide::SimdOpCheckTest::in_f16 {Float(16), 1, "in_f16"}

Definition at line 42 of file simd_op_check.h.

◆ in_bf16

ImageParam Halide::SimdOpCheckTest::in_bf16 {BFloat(16), 1, "in_bf16"}

Definition at line 43 of file simd_op_check.h.

◆ in_i8

ImageParam Halide::SimdOpCheckTest::in_i8 {Int(8), 1, "in_i8"}

Definition at line 44 of file simd_op_check.h.

◆ in_u8

ImageParam Halide::SimdOpCheckTest::in_u8 {UInt(8), 1, "in_u8"}

Definition at line 45 of file simd_op_check.h.

◆ in_i16

ImageParam Halide::SimdOpCheckTest::in_i16 {Int(16), 1, "in_i16"}

Definition at line 46 of file simd_op_check.h.

◆ in_u16

ImageParam Halide::SimdOpCheckTest::in_u16 {UInt(16), 1, "in_u16"}

Definition at line 47 of file simd_op_check.h.

◆ in_i32

ImageParam Halide::SimdOpCheckTest::in_i32 {Int(32), 1, "in_i32"}

Definition at line 48 of file simd_op_check.h.

◆ in_u32

ImageParam Halide::SimdOpCheckTest::in_u32 {UInt(32), 1, "in_u32"}

Definition at line 49 of file simd_op_check.h.

◆ in_i64

ImageParam Halide::SimdOpCheckTest::in_i64 {Int(64), 1, "in_i64"}

Definition at line 50 of file simd_op_check.h.

◆ in_u64

ImageParam Halide::SimdOpCheckTest::in_u64 {UInt(64), 1, "in_u64"}

Definition at line 51 of file simd_op_check.h.

◆ image_params

const std::vector<ImageParam> Halide::SimdOpCheckTest::image_params {in_f32, in_f64, in_f16, in_bf16, in_i8, in_u8, in_i16, in_u16, in_i32, in_u32, in_i64, in_u64}

Definition at line 53 of file simd_op_check.h.

Referenced by check_one(), and setup_images().

◆ arg_types

const std::vector<Argument> Halide::SimdOpCheckTest::arg_types {in_f32, in_f64, in_f16, in_bf16, in_i8, in_u8, in_i16, in_u16, in_i32, in_u32, in_i64, in_u64}

Definition at line 54 of file simd_op_check.h.

Referenced by compile_and_check().

◆ W

int Halide::SimdOpCheckTest::W

Definition at line 55 of file simd_op_check.h.

Referenced by check_one().

◆ H

int Halide::SimdOpCheckTest::H

Definition at line 56 of file simd_op_check.h.

Referenced by check_one().


The documentation for this class was generated from the following file: