Revision 2b3aaa8d6a5bb54a3da4e32395bb80ca09b4e4b3 authored by xndcn on 08 January 2021, 19:46:56 UTC, committed by GitHub on 08 January 2021, 19:46:56 UTC
* Add max threads checking for Metal Originally, this checking will be asserted by Metal API Validation in Xcode, otherwise the program will crash or output wrong results. * Disable the max threads checking for Metal in non-debug runtime * Disable error/metal_threads_too_large test for non-OSX target
1 parent 081f472
EliminateBoolVectors.h
#ifndef HALIDE_IR_ELIMINATE_BOOL_VECTORS_H
#define HALIDE_IR_ELIMINATE_BOOL_VECTORS_H
/** \file
* Method to eliminate vectors of booleans from IR.
*/
#include "Expr.h"
namespace Halide {
namespace Internal {
/** Some targets treat vectors of bools as integers of the same type that the
* boolean operation is being used to operate on. For example, instead of
* select(i1x8, u16x8, u16x8), the target would prefer to see select(u16x8,
* u16x8, u16x8), where the first argument is a vector of integers representing
* a mask. This pass converts vectors of bools to vectors of integers to meet
* this requirement. This is done by injecting intrinsics to convert bools to
* architecture-specific masks, and using a select_mask instrinsic instead of a
* Select node. This also converts any intrinsics that operate on vectorized
* conditions to a *_mask equivalent (if_then_else, require). Because the masks
* are architecture specific, they may not be stored or loaded. On Stores, the
* masks are converted to UInt(8) with a value of 0 or 1, which is our canonical
* in-memory representation of a bool. */
///@{
Stmt eliminate_bool_vectors(const Stmt &s);
Expr eliminate_bool_vectors(const Expr &s);
///@}
/** If a type is a boolean vector, find the type that it has been
* changed to by eliminate_bool_vectors. */
inline Type eliminated_bool_type(Type bool_type, Type other_type) {
if (bool_type.is_vector() && bool_type.bits() == 1) {
bool_type = bool_type.with_code(Type::Int).with_bits(other_type.bits());
}
return bool_type;
}
} // namespace Internal
} // namespace Halide
#endif
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...