Currently math.isnan is supported for checking for NaNs, but there's no way to check for NaTs easily short of viewing as an int64 and comparing to the minimum value (-9223372036854775808). Simple reproducer:
import numpy as np
from numba import cuda
test_in = cuda.to_device(np.array([1,None,3], dtype='datetime64[ms]'))
test_out = cuda.to_device(np.array([1,2,3]))
@cuda.jit
def test_datetime_nat(in_array, out_array):
i = cuda.grid(1)
if i < in_array.size:
if np.isnat(in_array[i]):
out_array[i] = 100
test_datetime_nat.forall(test_in.size)(test_in, test_out)
Currently math.isnan is supported for checking for
NaNs, but there's no way to check forNaTs easily short of viewing as an int64 and comparing to the minimum value (-9223372036854775808). Simple reproducer: