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