Cleaned up some timer issues

这个提交包含在:
Craig Warren
2022-02-24 17:18:33 +00:00
父节点 cc0e30900b
当前提交 2bb8a6984e

查看文件

@@ -21,8 +21,6 @@ from importlib import import_module
import gprMax.config as config import gprMax.config as config
import numpy as np import numpy as np
from .utilities.utilities import timer
class CFSParameter: class CFSParameter:
"""Individual CFS parameter (e.g. alpha, kappa, or sigma).""" """Individual CFS parameter (e.g. alpha, kappa, or sigma)."""
@@ -503,14 +501,6 @@ class OpenCLPML(PML):
def set_blocks_per_grid(): def set_blocks_per_grid():
pass pass
def set_wgs(self):
"""Set the workgroup size used for updating the PML field arrays
on a compute device.
"""
self.wgs = (((int(np.ceil(((self.EPhi1_dev.shape[1] + 1) *
(self.EPhi1_dev.shape[2] + 1) *
(self.EPhi1_dev.shape[3] + 1)) / self.G.tpb[0]))) * 256), 1, 1)
def get_update_funcs(): def get_update_funcs():
pass pass
@@ -518,7 +508,6 @@ class OpenCLPML(PML):
"""This functions updates electric field components with the PML """This functions updates electric field components with the PML
correction on the compute device. correction on the compute device.
""" """
start_time = timer()
event = self.update_electric_dev(np.int32(self.xs), event = self.update_electric_dev(np.int32(self.xs),
np.int32(self.xf), np.int32(self.xf),
np.int32(self.ys), np.int32(self.ys),
@@ -547,13 +536,12 @@ class OpenCLPML(PML):
self.ERF_dev, self.ERF_dev,
config.sim_config.dtypes['float_or_double'](self.d)) config.sim_config.dtypes['float_or_double'](self.d))
event.wait() event.wait()
self.compute_time += (timer() - start_time) self.compute_time += (event.profile.end - event.profile.start)*1e-9
def update_magnetic(self): def update_magnetic(self):
"""This functions updates magnetic field components with the PML """This functions updates magnetic field components with the PML
correction on the compute device. correction on the compute device.
""" """
start_time = timer()
event = self.update_magnetic_dev(np.int32(self.xs), event = self.update_magnetic_dev(np.int32(self.xs),
np.int32(self.xf), np.int32(self.xf),
np.int32(self.ys), np.int32(self.ys),
@@ -582,7 +570,7 @@ class OpenCLPML(PML):
self.HRF_dev, self.HRF_dev,
config.sim_config.dtypes['float_or_double'](self.d)) config.sim_config.dtypes['float_or_double'](self.d))
event.wait() event.wait()
self.compute_time += (timer() - start_time) self.compute_time += (event.profile.end - event.profile.start)*1e-9
def print_pml_info(G): def print_pml_info(G):