Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
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, const std::vector< Argument > &arg_types, 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 int | image_param_alignment ()
int | num_worker_threads () const
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< Task > | tasks
Target | target
int | W
int | H
int | rng_seed

## 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 72 of file simd_op_check.h.

## Member Typedef Documentation

## ◆ Sharder

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

Definition at line 92 of file simd_op_check.h.

## Constructor & Destructor Documentation

## ◆ SimdOpCheckTest()

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

Definition at line 94 of file simd_op_check.h.

References Halide::Target::NoAsserts, Halide::Target::NoBoundsQuery, Halide::Target::NoRuntime, target, and Halide::Target::with_feature().

## ◆ ~SimdOpCheckTest()

virtual Halide::SimdOpCheckTest::~SimdOpCheckTest | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ set_seed()

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

Definition at line 103 of file simd_op_check.h.

References Halide::cast(), and rng_seed.

## ◆ can_run_code()

virtual bool Halide::SimdOpCheckTest::can_run_code | ( |  | ) | const
| inline virtual

Definition at line 107 of file simd_op_check.h.

References Halide::Target::arch, Halide::Target::ARMDotProd, Halide::Target::ARMFp16, Halide::Target::ARMv7s, Halide::Target::ARMv81a, Halide::Target::ARMv82a, Halide::Target::ARMv83a, Halide::Target::ARMv84a, Halide::Target::ARMv85a, Halide::Target::ARMv86a, Halide::Target::ARMv87a, Halide::Target::ARMv88a, Halide::Target::ARMv89a, Halide::Target::ARMv8a, Halide::Target::AVX, Halide::Target::AVX2, Halide::Target::AVX512, Halide::Target::AVX512_Cannonlake, Halide::Target::AVX512_KNL, Halide::Target::AVX512_SapphireRapids, Halide::Target::AVX512_Skylake, Halide::Target::AVX512_Zen4, Halide::Target::AVX512_Zen5, Halide::Target::AVXVNNI, Halide::Target::bits, Halide::Internal::WasmModule::can_jit_target(), Halide::cast(), Halide::Target::F16C, Halide::Target::FMA, Halide::Target::FMA4, Halide::get_host_target(), Halide::Target::has_feature(), Halide::Target::NoNEON, Halide::Target::os, Halide::Target::POWER_ARCH_2_07, Halide::Target::RVV, Halide::Target::SSE41, Halide::Target::SVE, Halide::Target::SVE2, target, Halide::Target::VSX, and Halide::Target::WebAssembly.

Referenced by check_one().

## ◆ compile_and_check()

virtual void Halide::SimdOpCheckTest::compile_and_check | ( | Func | error,
|  | const std::string & | op,
|  | const std::string & | name,
|  | int | vector_width,
|  | const std::vector< Argument > & | arg_types,
|  | std::ostringstream & | error_msg
| ) |  |
| inline virtual

Definition at line 161 of file simd_op_check.h.

References Halide::assembly, Halide::c_header, Halide::cast(), Halide::Func::compile_to(), Halide::Internal::get_output_info(), get_run_target(), Halide::llvm_assembly, Halide::object, output_directory, target, Halide::Target::to_string(), and wildcard_search().

Referenced by check_one().

## ◆ wildcard_match() [1/2]

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

Definition at line 203 of file simd_op_check.h.

References Halide::cast(), and wildcard_match().

Referenced by check(), wildcard_match(), 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 233 of file simd_op_check.h.

References Halide::cast(), and wildcard_match().

## ◆ wildcard_search()

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

Definition at line 238 of file simd_op_check.h.

References Halide::cast(), and wildcard_match().

Referenced by compile_and_check().

## ◆ get_run_target()

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

Definition at line 242 of file simd_op_check.h.

References Halide::Target::NoAsserts, Halide::Target::NoBoundsQuery, Halide::Target::NoRuntime, target, and Halide::Target::without_feature().

Referenced by check_one(), compile_and_check(), and test_all().

## ◆ check_one()

TestResult Halide::SimdOpCheckTest::check_one | ( | const std::string & | op,
|  | const std::string & | name,
|  | int | vector_width,
|  | Expr | e
| ) |  |
| inline

Definition at line 249 of file simd_op_check.h.

References Halide::absd(), Halide::Internal::IRHandle::accept(), Halide::Internal::Call::args, Halide::BFloat(), Halide::Func::bound(), Halide::Internal::Call::call_type, can_run_code(), Halide::cast(), compile_and_check(), Halide::Func::compile_to_assembly(), Halide::Func::compile_to_callable(), Halide::Func::compute_root(), Halide::Float(), Halide::Internal::Call::func, get_run_target(), H, Halide::Internal::Call::Halide, Halide::Internal::Function::has_update_definition(), image_param_alignment(), Halide::Int(), Halide::Type::is_int_or_uint(), Halide::Runtime::Buffer< T, Dims, InClassDimStorage >::make_scalar(), Halide::maximum(), Halide::Internal::ConstantInterval::min, Halide::Internal::Function::mutate(), Halide::Internal::Call::name, output_directory, rng_seed, Halide::Internal::StageSchedule::rvars(), Halide::Internal::Definition::schedule(), Halide::Param< T >::set(), target, Halide::Internal::BaseExprNode::type, Halide::UInt(), Halide::Internal::Function::update(), Halide::Func::vectorize(), Halide::Internal::IRMutator::visit(), Halide::Internal::IRVisitor::visit(), W, and Halide::Internal::FunctionPtr::weak.

## ◆ check()

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

Definition at line 461 of file simd_op_check.h.

References Halide::cast(), filter, tasks, and wildcard_match().

## ◆ add_tests()

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

Referenced by test_all().

## ◆ image_param_alignment()

virtual int Halide::SimdOpCheckTest::image_param_alignment | ( |  | ) |
| inline virtual

Definition at line 478 of file simd_op_check.h.

Referenced by check_one().

## ◆ num_worker_threads()

int Halide::SimdOpCheckTest::num_worker_threads | ( |  | ) | const
| inline

Definition at line 482 of file simd_op_check.h.

References Halide::Internal::get_env_variable().

Referenced by test_all().

## ◆ test_all()

virtual bool Halide::SimdOpCheckTest::test_all | ( |  | ) |
| inline virtual

Definition at line 489 of file simd_op_check.h.

References add_tests(), Halide::cast(), get_run_target(), num_worker_threads(), and tasks.

## ◆ main()

template<typename SIMDOpCheckT >

static int Halide::SimdOpCheckTest::main | ( | int | argc,
|  | char ** | argv,
|  | const std::vector< Target > & | targets_to_test
| ) |  |
| inline static

Definition at line 528 of file simd_op_check.h.

References atoi(), Halide::cast(), Halide::compile_standalone_runtime(), Halide::get_host_target(), and getenv().

## Member Data Documentation

## ◆ max_i8

constexpr int Halide::SimdOpCheckTest::max_i8 = 127
| static constexpr

Definition at line 74 of file simd_op_check.h.

## ◆ max_i16

constexpr int Halide::SimdOpCheckTest::max_i16 = 32767
| static constexpr

Definition at line 75 of file simd_op_check.h.

## ◆ max_i32

constexpr int Halide::SimdOpCheckTest::max_i32 = 0x7fffffff
| static constexpr

Definition at line 76 of file simd_op_check.h.

## ◆ max_u8

constexpr int Halide::SimdOpCheckTest::max_u8 = 255
| static constexpr

Definition at line 77 of file simd_op_check.h.

## ◆ max_u16

constexpr int Halide::SimdOpCheckTest::max_u16 = 65535
| static constexpr

Definition at line 78 of file simd_op_check.h.

## ◆ max_u32

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

Definition at line 79 of file simd_op_check.h.

## ◆ filter

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

Definition at line 81 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 82 of file simd_op_check.h.

Referenced by check_one(), and compile_and_check().

## ◆ tasks

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

Definition at line 83 of file simd_op_check.h.

Referenced by check(), and test_all().

## ◆ target

Target Halide::SimdOpCheckTest::target

Definition at line 85 of file simd_op_check.h.

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

## ◆ W

int Halide::SimdOpCheckTest::W

Definition at line 87 of file simd_op_check.h.

Referenced by check_one().

## ◆ H

int Halide::SimdOpCheckTest::H

Definition at line 88 of file simd_op_check.h.

Referenced by check_one().

## ◆ rng_seed

int Halide::SimdOpCheckTest::rng_seed

Definition at line 90 of file simd_op_check.h.

Referenced by check_one(), and set_seed().

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

- test/correctness/simd_op_check.h