Skip to content

Commit

Permalink
Add errors for save_to_disk == False
Browse files Browse the repository at this point in the history
  • Loading branch information
waltsims committed Dec 27, 2023
1 parent 51da4cd commit e2b4c7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kwave/kspaceFirstOrder2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,20 @@ def kspaceFirstOrder2D(
# start the timer and store the start time
TicToc.tic()

if execution_options.is_gpu_simulation:
assert simulation_options.save_to_disk, 'GPU simulation requires saving to disk'
else:
# Currently we only support binary execution, meaning all simulations must be saved to disk.
assert simulation_options.save_to_disk, 'CPU simulation requires saving to disk'

k_sim = kWaveSimulation(
kgrid=kgrid,
source=source,
sensor=sensor,
medium=medium,
simulation_options=simulation_options
)

k_sim.input_checking('kspaceFirstOrder2D')

# =========================================================================
Expand Down
6 changes: 6 additions & 0 deletions kwave/kspaceFirstOrder3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ def kspaceFirstOrder3D(
# start the timer and store the start time
TicToc.tic()

if execution_options.is_gpu_simulation:
assert simulation_options.save_to_disk, 'GPU simulation requires saving to disk'
else:
# Currently we only support binary execution, meaning all simulations must be saved to disk.
assert simulation_options.save_to_disk, 'CPU simulation requires saving to disk'

k_sim = kWaveSimulation(
kgrid=kgrid,
source=source,
Expand Down

0 comments on commit e2b4c7e

Please sign in to comment.