Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support numpy.isnan and numpy.isnat in cuda.jit kernels #4333

Open
kkraus14 opened this issue Jul 17, 2019 · 0 comments
Open

Support numpy.isnan and numpy.isnat in cuda.jit kernels #4333

kkraus14 opened this issue Jul 17, 2019 · 0 comments
Assignees
Labels
CUDA CUDA related issue/PR feature_request good first issue A good issue for a first time contributor

Comments

@kkraus14
Copy link

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)
@sklam sklam added CUDA CUDA related issue/PR feature_request labels Jul 18, 2019
@sklam sklam self-assigned this Jul 18, 2019
@gmarkall gmarkall added the good first issue A good issue for a first time contributor label Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CUDA CUDA related issue/PR feature_request good first issue A good issue for a first time contributor
Projects
None yet
Development

No branches or pull requests

3 participants