numba-dpex icon indicating copy to clipboard operation
numba-dpex copied to clipboard

Issues when enabling Mandelbrot

Open mingjie-intel opened this issue 1 year ago • 3 comments

This is used to track issues during enabling Mandelbrot test case.

  • [ ] #1013
  • [ ] CFD pass to support function calls inside a dpjit function.
  • [ ] Calling dpjit within dpjit #989

Reproducers are attached.

mingjie-intel avatar Apr 20 '23 15:04 mingjie-intel

Reproducer for dpnp.asarray:

import dpnp
from numba_dpex import dpjit

@dpjit
def foo(a):
    b=dpnp.asarray([0.1,0.2,0.3])
    a=b
    
a=dpnp.empty(3) 
foo(a)
print(a)  

mingjie-intel avatar Apr 20 '23 15:04 mingjie-intel

Reproducer for CFD pass to support functions.

import dpnp
import numba
from numba_dpex import dpjit


def mandel(x, y):
    return x+y

@dpjit
def mandelbrot():
    c1 = dpnp.ones(10)
    c2 = dpnp.ones(10)

    for i in numba.prange(10):
        intensity = mandel(c1[i], c2[i])

mandelbrot()

mingjie-intel avatar Apr 20 '23 16:04 mingjie-intel

Reproducer for Calling dpjit within dpjit.

import dpnp
import numba
from numba_dpex import dpjit

@dpjit
def mandel(x, y):
    return x+y

@dpjit
def mandelbrot():
    c1 = dpnp.ones(10)
    c2 = dpnp.ones(10)

    for i in numba.prange(10):
        intensity = mandel(c1[i], c2[i])

mandelbrot()

mingjie-intel avatar Apr 20 '23 16:04 mingjie-intel