Skip to content

Commit

Permalink
Update reduction_template to use kapi.group_barrier
Browse files Browse the repository at this point in the history
  • Loading branch information
diptorupd committed Apr 3, 2024
1 parent e52b423 commit 1d84071
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import dpnp
from numba.core import compiler

import numba_dpex as dpex
import numba_dpex.kernel_api as kapi

from .kernel_template_iface import KernelTemplateInterface

Expand Down Expand Up @@ -112,7 +112,7 @@ def _generate_kernel_stub_as_string(self):
gufunc_txt += (
" stride0 = local_size0 // 2\n"
+ " while stride0 > 0:\n"
+ " dpex.barrier(dpex.LOCAL_MEM_FENCE)\n"
+ " kapi.group_barrier(group)\n"
+ " if local_id0 < stride0:\n"
)

Expand Down Expand Up @@ -158,7 +158,7 @@ def _generate_kernel_ir(self):
Returns: The Numba functionIR object for the compiled kernel_txt string.
"""
globls = {"dpnp": dpnp, "dpex": dpex}
globls = {"dpnp": dpnp, "kapi": kapi}
locls = {}
exec(self._kernel_txt, globls, locls)
kernel_fn = locls[self._kernel_name]
Expand Down Expand Up @@ -317,7 +317,7 @@ def _generate_kernel_ir(self):
"""

globls = {"dpnp": dpnp, "dpex": dpex}
globls = {"dpnp": dpnp, "kapi": kapi}
locls = {}
exec(self._kernel_txt, globls, locls)
kernel_fn = locls[self._kernel_name]
Expand Down

0 comments on commit 1d84071

Please sign in to comment.