__may_alias__ Class — pytorch Architecture
Architecture documentation for the __may_alias__ class in vec256_float_vsx.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/cpu/vec/vec256/vsx/vec256_float_vsx.h lines 16–66
template <>
class Vectorized<float> {
private:
union {
struct {
vfloat32 _vec0;
vfloat32 _vec1;
};
struct {
vbool32 _vecb0;
vbool32 _vecb1;
};
} __attribute__((__may_alias__));
public:
using value_type = float;
using vec_internal_type = vfloat32;
using vec_internal_mask_type = vbool32;
using size_type = int;
static constexpr size_type size() {
return 8;
}
Vectorized() {}
C10_ALWAYS_INLINE Vectorized(vfloat32 v) : _vec0{v}, _vec1{v} {}
C10_ALWAYS_INLINE Vectorized(vbool32 vmask) : _vecb0{vmask}, _vecb1{vmask} {}
C10_ALWAYS_INLINE Vectorized(vfloat32 v1, vfloat32 v2)
: _vec0{v1}, _vec1{v2} {}
C10_ALWAYS_INLINE Vectorized(vbool32 v1, vbool32 v2)
: _vecb0{v1}, _vecb1{v2} {}
C10_ALWAYS_INLINE Vectorized(float scalar)
: _vec0{vec_splats(scalar)}, _vec1{vec_splats(scalar)} {}
C10_ALWAYS_INLINE Vectorized(
float scalar1,
float scalar2,
float scalar3,
float scalar4,
float scalar5,
float scalar6,
float scalar7,
float scalar8)
: _vec0{vfloat32{scalar1, scalar2, scalar3, scalar4}},
_vec1{vfloat32{scalar5, scalar6, scalar7, scalar8}} {}
C10_ALWAYS_INLINE const vec_internal_type& vec0() const {
return _vec0;
}
C10_ALWAYS_INLINE const vec_internal_type& vec1() const {
return _vec1;
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free