From ff85992b1d918e832f643a0aba35b18462df6349 Mon Sep 17 00:00:00 2001 From: sbosse Date: Fri, 29 Nov 2024 16:59:48 +0100 Subject: [PATCH] Fri 29 Nov 2024 04:59:44 PM CET --- src/SimNDT/run_setup/runSimulator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/SimNDT/run_setup/runSimulator.py b/src/SimNDT/run_setup/runSimulator.py index 1c43d25..1317f4b 100644 --- a/src/SimNDT/run_setup/runSimulator.py +++ b/src/SimNDT/run_setup/runSimulator.py @@ -407,8 +407,14 @@ def read_simulation(sim_params): sim_order = sim_params["Simulation"]["Order"] # sim_device = sim_params["Simulation"]["Device"] + if "Device" in sim_params["Simulation"]: + sim_device=sim_params["Simulation"]["Device"] + else: + sim_device="CPU" + SimNDT_Simulation = Simulation(TimeScale=sim_time_scale, MaxFreq=sim_max_freq, PointCycle=sim_point_cycle, SimTime=sim_simulation_time, Order=sim_order) + SimNDT_Simulation.preferredDeviceType = sim_device print("Finished reading Simulation section.") print(repr(SimNDT_Simulation)) @@ -515,7 +521,7 @@ def SimulationSetup(Scenario, SimNDT_Mat_objs, SimNDT_Transd_objs, Simulation): platform_name = PlatformAndDevice[0].name device_name = PlatformAndDevice[1].name device_type = cl.device_type.to_string(PlatformAndDevice[1].type) - if device_type != 'GPU': + if device_type == Simulation.preferredDeviceType : preferred_platform = platform_name preferred_device = device_type break