Skip to content

Commit

Permalink
Partial fix on __half.
Browse files Browse the repository at this point in the history
  • Loading branch information
aschaffer committed Jun 28, 2023
1 parent 5f02859 commit daa93c1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cunumeric/stat/histogram_template.inl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ using namespace legate;
template <VariantKind KIND, Type::Code CODE>
struct HistogramImplBody;

template <Type::Code CODE>
inline constexpr bool is_candidate =
(is_floating_point<CODE>::value) &&
(!std::is_same_v<typename LegateTypeOf<CODE>::type, __half>); // || is_integral<CODE>::value

template <VariantKind KIND>
struct HistogramImpl {
// for now, it has been decided to hardcode these types:
//
using BinType = double;
using WeightType = double;

template <
Type::Code CODE,
std::enable_if_t</*is_integral<CODE>::value ||*/ is_floating_point<CODE>::value>* = nullptr>
template <Type::Code CODE, std::enable_if_t<is_candidate<CODE>>* = nullptr>
void operator()(HistogramArgs& args) const
{
using VAL = legate_type_of<CODE>;
Expand All @@ -56,9 +59,7 @@ struct HistogramImpl {
src, src_rect, bins, bins_rect, weights, weights_rect, result, result_rect);
}

template <Type::Code CODE,
std::enable_if_t<
/*(!is_integral<CODE>::value) &&*/ (!is_floating_point<CODE>::value)>* = nullptr>
template <Type::Code CODE, std::enable_if_t<!is_candidate<CODE>>* = nullptr>
void operator()(HistogramArgs& args) const
{
assert(false);
Expand Down

0 comments on commit daa93c1

Please sign in to comment.