Skip to content

Commit ebbf29a

Browse files
committed
add lumerical gpu toggle
1 parent fc9143d commit ebbf29a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gds_fdtd/lum_tools.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def make_sim_lum(
113113
z_span: float | None = None,
114114
field_monitor_axis: str | None = None,
115115
visualize: bool = True,
116+
gpu: bool = False,
116117
) -> dict[str, list[float]]:
117118

118119
# send component to lumerical instance
@@ -142,6 +143,13 @@ def make_sim_lum(
142143
z_max_bc=boundary,
143144
)
144145

146+
if gpu:
147+
lum.setnamed("FDTD", "express mode", True) # for GPU acceleration
148+
lum.run("FDTD", "GPU")
149+
else:
150+
lum.setnamed("FDTD", "express mode", False)
151+
lum.run()
152+
145153
lum.setglobalsource("wavelength start", wavl_min*1e-6)
146154
lum.setglobalsource("wavelength stop", wavl_max*1e-6)
147155
lum.setglobalmonitor("frequency points", wavl_pts)

0 commit comments

Comments
 (0)