Halide
|
#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< Task > | tasks |
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< ImageParam > | 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} |
const std::vector< Argument > | 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} |
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 |
Definition at line 24 of file simd_op_check.h.
Definition at line 58 of file simd_op_check.h.
|
inline |
Definition at line 60 of file simd_op_check.h.
References Halide::Target::NoAsserts, Halide::Target::NoBoundsQuery, Halide::Target::NoRuntime, target, and Halide::Target::with_feature().
|
virtualdefault |
|
inline |
Definition at line 69 of file simd_op_check.h.
References rng.
|
inlinevirtual |
Definition at line 73 of file simd_op_check.h.
References Halide::Target::arch, Halide::Target::ARMDotProd, Halide::Target::ARMFp16, Halide::Target::ARMv7s, Halide::Target::ARMv81a, 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::bits, Halide::Internal::WasmModule::can_jit_target(), 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().
|
inlinevirtual |
Definition at line 115 of file simd_op_check.h.
References arg_types, Halide::assembly, Halide::c_header, Halide::Func::compile_to(), Halide::Internal::get_output_info(), get_run_target(), Halide::object, output_directory, target, Halide::Target::to_string(), and wildcard_search().
Referenced by check_one().
|
inline |
Definition at line 151 of file simd_op_check.h.
Referenced by check(), wildcard_match(), and wildcard_search().
|
inline |
Definition at line 181 of file simd_op_check.h.
References wildcard_match().
|
inline |
Definition at line 186 of file simd_op_check.h.
References wildcard_match().
Referenced by compile_and_check().
|
inline |
Definition at line 190 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().
|
inline |
Definition at line 197 of file simd_op_check.h.
References Halide::absd(), Halide::Internal::IRHandle::accept(), Halide::Func::bound(), Halide::Internal::Call::call_type, can_run_code(), Halide::Func::clone_in(), compile_and_check(), Halide::Func::compute_at(), Halide::Func::compute_root(), Halide::Internal::Call::func, get_run_target(), H, Halide::Internal::Call::Halide, Halide::Internal::Function::has_update_definition(), image_params, Halide::Func::infer_input_bounds(), Halide::maximum(), setup_images(), Halide::Func::update(), Halide::Func::vectorize(), Halide::Internal::IRVisitor::visit(), W, Halide::RDom::x, and Halide::RDom::y.
Referenced by test_all().
|
inline |
Definition at line 314 of file simd_op_check.h.
References filter, tasks, and wildcard_match().
|
pure virtual |
Referenced by test_all().
|
inlinevirtual |
|
inlinevirtual |
Definition at line 341 of file simd_op_check.h.
References add_tests(), check_one(), get_run_target(), Halide::max(), Halide::Internal::Test::Sharder::should_run(), tasks, and Halide::Target::to_string().
|
inlinestatic |
Definition at line 368 of file simd_op_check.h.
References atoi(), and Halide::get_host_target().
|
staticconstexpr |
Definition at line 26 of file simd_op_check.h.
|
staticconstexpr |
Definition at line 27 of file simd_op_check.h.
|
staticconstexpr |
Definition at line 28 of file simd_op_check.h.
|
staticconstexpr |
Definition at line 29 of file simd_op_check.h.
|
staticconstexpr |
Definition at line 30 of file simd_op_check.h.
Definition at line 31 of file simd_op_check.h.
std::string Halide::SimdOpCheckTest::filter {"*"} |
Definition at line 33 of file simd_op_check.h.
Referenced by check().
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().
std::vector<Task> Halide::SimdOpCheckTest::tasks |
Definition at line 35 of file simd_op_check.h.
Referenced by check(), and test_all().
std::mt19937 Halide::SimdOpCheckTest::rng |
Definition at line 36 of file simd_op_check.h.
Referenced by set_seed().
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().
ImageParam Halide::SimdOpCheckTest::in_f32 {Float(32), 1, "in_f32"} |
Definition at line 40 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_f64 {Float(64), 1, "in_f64"} |
Definition at line 41 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_f16 {Float(16), 1, "in_f16"} |
Definition at line 42 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_bf16 {BFloat(16), 1, "in_bf16"} |
Definition at line 43 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_i8 {Int(8), 1, "in_i8"} |
Definition at line 44 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_u8 {UInt(8), 1, "in_u8"} |
Definition at line 45 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_i16 {Int(16), 1, "in_i16"} |
Definition at line 46 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_u16 {UInt(16), 1, "in_u16"} |
Definition at line 47 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_i32 {Int(32), 1, "in_i32"} |
Definition at line 48 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_u32 {UInt(32), 1, "in_u32"} |
Definition at line 49 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_i64 {Int(64), 1, "in_i64"} |
Definition at line 50 of file simd_op_check.h.
ImageParam Halide::SimdOpCheckTest::in_u64 {UInt(64), 1, "in_u64"} |
Definition at line 51 of file simd_op_check.h.
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().
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().
int Halide::SimdOpCheckTest::W |
Definition at line 55 of file simd_op_check.h.
Referenced by check_one().
int Halide::SimdOpCheckTest::H |
Definition at line 56 of file simd_op_check.h.
Referenced by check_one().