postgres=# create table test(iv1 interval);
postgres=# insert into test select '2016-05-10 04:38:35.562587'::timestamp - '2016-05-11 04:38:35.562587'::timestamp;
postgres=# set enable_seqscan = 0;
SET
postgres=# select -iv1 from test where iv1 < '0'::interval;
ERROR: xpu_timelib.cu:2782 interval out of range
HINT: device at GPU-0, function at pgfn_interval_um
postgres=# set enable_seqscan = 1;
SET
postgres=# select -iv1 from test where iv1 < '0'::interval;
?column?
----------
1 day
(1 row)
Thanks for your patch!
I could not remind why my previous implementation was different from the original interval_um() in PostgreSQL.
Your fix well follows the original behavior.
Reproduce steps: