Skip to content

Commit

Permalink
Fix pycuda templates to only load pycuda engines (#538)
Browse files Browse the repository at this point in the history
* load only pycuda engines in pycuda templates

* load only pycuda engines in more templates
  • Loading branch information
daurer authored Mar 5, 2024
1 parent cf77c69 commit eb76faa
Show file tree
Hide file tree
Showing 24 changed files with 44 additions and 124 deletions.
2 changes: 1 addition & 1 deletion templates/accelerate/ptypy_i13_AuStar_farfield_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/accelerate/ptypy_i13_AuStar_nearfield_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/accelerate/ptypy_id22ni_AuStar_focused_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import numpy as np
import tempfile
Expand Down
2 changes: 1 addition & 1 deletion templates/accelerate/ptypy_laser_logo_focused_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ptypy import utils as u
import ptypy.simulations as sim
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import pathlib
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion templates/accelerate/ptypy_minimal_prep_and_run_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_DM_ML_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_DM_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_DM_pycuda_nostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_EPIE_ML_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_EPIE_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_ML_ML_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_ML_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_RAAR_ML_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_RAAR_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/engines/pycuda/moonflower_SDR_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
2 changes: 1 addition & 1 deletion templates/live_processing/moonflower_DM_delayed_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ptypy.core import Ptycho
from ptypy import utils as u
import ptypy
ptypy.load_gpu_engines(arch="cuda")
ptypy.load_gpu_engines(arch="pycuda")

import tempfile
tmpdir = tempfile.gettempdir()
Expand Down
62 changes: 11 additions & 51 deletions templates/notebooks/moonflower_dm_pycuda.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"import ptypy\n",
Expand All @@ -27,25 +23,17 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# Import pycuda engines (DM, RAAR)\n",
"ptypy.load_gpu_engines(\"cuda\")"
"ptypy.load_gpu_engines(\"pycuda\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# create parameter tree\n",
Expand All @@ -55,11 +43,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# set verbose level to interactive\n",
Expand All @@ -69,11 +53,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# Nr. of frames in a block\n",
Expand All @@ -83,11 +63,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# set home path and io settings (no files saved)\n",
Expand All @@ -101,11 +77,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# max 200 frames (128x128px) of diffraction data\n",
Expand All @@ -125,11 +97,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# difference map reconstrucion engine\n",
Expand All @@ -144,11 +112,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"# prepare and run\n",
Expand All @@ -165,11 +129,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "python"
}
},
"metadata": {},
"outputs": [],
"source": [
"import ptypy.utils.plot_client as pc\n",
Expand Down
2 changes: 1 addition & 1 deletion templates/notebooks/moonflower_epie_pycuda.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"outputs": [],
"source": [
"# Import pycuda engines (DM, RAAR)\n",
"ptypy.load_gpu_engines(\"cuda\")"
"ptypy.load_gpu_engines(\"pycuda\")"
]
},
{
Expand Down
Loading

0 comments on commit eb76faa

Please sign in to comment.