Fix order in preamble
@@ -36,7 +36,7 @@ gcd = core.create_ufunc(
''')
-_lcm_preamble = '''
+_lcm_preamble = _gcd_preamble + '''
template <typename T> inline __device__ T lcm(T in0, T in1) {
T r = gcd(in0, in1);
if (r == 0)
@@ -46,7 +46,7 @@ template <typename T> inline __device__ T lcm(T in0, T in1) {
return -r;
return r;
}
-''' + _gcd_preamble
+'''
lcm = core.create_ufunc(
'cupy_lcm',
