Skip to content

Commit

Permalink
Fix clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh committed Jun 3, 2024
1 parent 5d7bb2a commit bf6823c
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions test_conformance/conversions/conversions_data_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ struct DataInitBase : public DataInitInfo
virtual void conv_array(void *out, void *in, size_t n) {}
virtual void conv_array_sat(void *out, void *in, size_t n) {}
virtual void init(const cl_uint &, const cl_uint &) {}
virtual void set_allow_zero_array(uint8_t *allow, void *out, void *in, size_t n) {}
virtual void set_allow_zero_array(uint8_t *allow, void *out, void *in,
size_t n)
{}
};

template <typename InType, typename OutType, bool InFP, bool OutFP>
Expand Down Expand Up @@ -135,7 +137,9 @@ struct DataInfoSpec : public DataInitBase
}

void init(const cl_uint &, const cl_uint &) override;
void set_allow_zero_array(uint8_t *allow, void *out, void *in, size_t n) override {
void set_allow_zero_array(uint8_t *allow, void *out, void *in,
size_t n) override
{
for (size_t i = 0; i < n; i++)
set_allow_zero(&allow[i], &((OutType *)out)[i], &((InType *)in)[i]);
}
Expand Down Expand Up @@ -731,26 +735,23 @@ void DataInfoSpec<InType, OutType, InFP, OutFP>::set_allow_zero(uint8_t *allow,
OutType *out,
InType *in)
{
// from double
if (std::is_same<InType, cl_double>::value)
*allow |= IsDoubleSubnormal(*in);
// from float
if (std::is_same<InType, cl_float>::value)
*allow |= IsFloatSubnormal(*in);
// from half
if (is_in_half())
*allow |= IsHalfSubnormal(*in);

// handle the cases that the converted result is subnormal
// from double
if (std::is_same<OutType, cl_double>::value)
*allow |= IsDoubleSubnormal(*out);
// from float
if (std::is_same<OutType, cl_float>::value)
*allow |= IsFloatSubnormal(*out);
// from half
if (is_out_half())
*allow |= IsHalfSubnormal(*out);
// from double
if (std::is_same<InType, cl_double>::value)
*allow |= IsDoubleSubnormal(*in);
// from float
if (std::is_same<InType, cl_float>::value) *allow |= IsFloatSubnormal(*in);
// from half
if (is_in_half()) *allow |= IsHalfSubnormal(*in);

// handle the cases that the converted result is subnormal
// from double
if (std::is_same<OutType, cl_double>::value)
*allow |= IsDoubleSubnormal(*out);
// from float
if (std::is_same<OutType, cl_float>::value)
*allow |= IsFloatSubnormal(*out);
// from half
if (is_out_half()) *allow |= IsHalfSubnormal(*out);
}

template <typename InType, typename OutType, bool InFP, bool OutFP>
Expand Down

0 comments on commit bf6823c

Please sign in to comment.