Skip to content

Commit

Permalink
Transonic-Pythran
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Feb 14, 2024
1 parent 2687683 commit ca4dcd6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ venv/*

*build/*
**/__pythran__
**/__python__
**/__numba__
.tox/*

*.so
Expand Down
4 changes: 4 additions & 0 deletions fluidimage/calcul/interpolate/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ py.install_sources(
subdir: 'fluidimage/calcul/interpolate'
)

run_command(['transonic', '--meson', '--backend', backend, 'thin_plate_spline.py'], check: true)

foreach be : backends
subdir('__' + be + '__')
endforeach
7 changes: 7 additions & 0 deletions fluidimage/calcul/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ py.install_sources(

subdir('interpolate')
subdir('plot_evaluate_subpix')

run_command(['transonic', '--meson', '--backend', backend, 'correl.py', 'subpix.py'], check: true)

foreach be : backends
subdir('__' + be + '__')
endforeach

8 changes: 4 additions & 4 deletions fluidimage/topologies/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
def cpu1(array1: A, array2: A, nloops: int = 10):
a = np.arange(10000000 // nloops)
result = a
for i in range(nloops):
for _ in range(nloops):
result += a**3 + a**2 + 2

for i in range(nloops):
for _ in range(nloops):
array1 = array1 * array2
return (array1, array1)

Expand All @@ -39,10 +39,10 @@ def cpu1(array1: A, array2: A, nloops: int = 10):
def cpu2(array1: A, array2: A, nloops: int = 10):
a = np.arange(10000000 // nloops)
result = a
for i in range(nloops):
for _ in range(nloops):
result += a**3 + a**2 + 2

for i in range(nloops):
for _ in range(nloops):
array1 = np.multiply(array1, array2)
return array1

Expand Down
4 changes: 4 additions & 0 deletions fluidimage/topologies/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ py.install_sources(
subdir: 'fluidimage/topologies'
)

run_command(['transonic', '--meson', '--backend', backend, 'example.py'], check: true)

foreach be : backends
subdir('__' + be + '__')
endforeach

0 comments on commit ca4dcd6

Please sign in to comment.