File tree Expand file tree Collapse file tree 4 files changed +19
-21
lines changed
extensions/ufunc/elementwise_functions
kernels/elementwise_functions Expand file tree Collapse file tree 4 files changed +19
-21
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,6 @@ struct OutputType
95
95
T2,
96
96
std::int64_t ,
97
97
std::int64_t >,
98
- td_ns::BinaryTypeMapResultEntry<T1,
99
- std::uint64_t ,
100
- T2,
101
- std::int64_t ,
102
- std::uint64_t >,
103
- td_ns::BinaryTypeMapResultEntry<T1,
104
- std::int64_t ,
105
- T2,
106
- std::uint64_t ,
107
- std::int64_t >,
108
98
td_ns::DefaultResultEntry<void >>::result_type;
109
99
};
110
100
Original file line number Diff line number Diff line change @@ -95,16 +95,6 @@ struct OutputType
95
95
T2,
96
96
std::int64_t ,
97
97
std::int64_t >,
98
- td_ns::BinaryTypeMapResultEntry<T1,
99
- std::uint64_t ,
100
- T2,
101
- std::int64_t ,
102
- std::uint64_t >,
103
- td_ns::BinaryTypeMapResultEntry<T1,
104
- std::int64_t ,
105
- T2,
106
- std::uint64_t ,
107
- std::int64_t >,
108
98
td_ns::DefaultResultEntry<void >>::result_type;
109
99
};
110
100
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ struct GcdFunctor
38
38
39
39
resT operator ()(const argT1 &in1, const argT2 &in2) const
40
40
{
41
+ static_assert (std::is_same_v<argT1, argT2>,
42
+ " Input types are expected to be the same" );
43
+
41
44
return oneapi::dpl::gcd (in1, in2);
42
45
}
43
46
};
Original file line number Diff line number Diff line change @@ -38,7 +38,22 @@ struct LcmFunctor
38
38
39
39
resT operator ()(const argT1 &in1, const argT2 &in2) const
40
40
{
41
- return oneapi::dpl::lcm (in1, in2);
41
+ static_assert (std::is_same_v<argT1, argT2>,
42
+ " Input types are expected to be the same" );
43
+
44
+ if (in1 == 0 || in2 == 0 )
45
+ return 0 ;
46
+
47
+ resT res = in1 / oneapi::dpl::gcd (in1, in2) * in2;
48
+ if constexpr (std::is_signed_v<argT1>) {
49
+ if (res < 0 ) {
50
+ return -res;
51
+ }
52
+ }
53
+ return res;
54
+
55
+ // TODO: undo the w/a once ONEDPL-1320 is resolved
56
+ // return oneapi::dpl::lcm(in1, in2);
42
57
}
43
58
};
44
59
} // namespace dpnp::kernels::lcm
You can’t perform that action at this time.
0 commit comments