From d8a3e0096e826135bbb96caa5900d2ffdf02b3b4 Mon Sep 17 00:00:00 2001 From: Ilham Variansyah Date: Thu, 15 Aug 2024 21:56:09 +0700 Subject: [PATCH] replace njit with cuda.jit --- mcdc/code_factory.py | 6 +++--- mcdc/main.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mcdc/code_factory.py b/mcdc/code_factory.py index 4d987bc4..1d5d5911 100644 --- a/mcdc/code_factory.py +++ b/mcdc/code_factory.py @@ -1,6 +1,6 @@ import numpy as np -from numba import njit +from numba import cuda, njit import mcdc.local as local import mcdc.type_ as type_ @@ -36,7 +36,7 @@ def local_array(dtype, size, target): def cpu(): return np.zeros(1, dtype=struct)[0] - @njit + @cuda.jit(device=True) def gpu(): return cuda.local.array(1, dtype=struct)[0] @@ -49,7 +49,7 @@ def local_object(dtype, target): def cpu(): return np.zeros(1, dtype=dtype)[0] - @njit + @cuda.jit(device=True) def gpu(): return cuda.local.array(1, dtype=dtype)[0] diff --git a/mcdc/main.py b/mcdc/main.py index e043c21a..5a216e94 100644 --- a/mcdc/main.py +++ b/mcdc/main.py @@ -384,7 +384,7 @@ def prepare(): type_.make_type_global(input_deck) kernel.adapt_rng(nb.config.DISABLE_JIT) - input_deck.setting['target'] = target + input_deck.setting["target"] = target code_factory.make_locals(input_deck) # =========================================================================