你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Tidy memory info printing for OpenCL
这个提交包含在:
@@ -346,12 +346,12 @@ class ModelBuildRun:
|
|||||||
self.write_output_data()
|
self.write_output_data()
|
||||||
|
|
||||||
# Print information about memory usage and solving time for a model
|
# Print information about memory usage and solving time for a model
|
||||||
# Add a string on GPU memory usage if applicable
|
# Add a string on device (GPU) memory usage if applicable
|
||||||
mem_str = (
|
mem_str = ""
|
||||||
f" host + ~{humanize.naturalsize(solver.memused)} GPU"
|
if config.sim_config.general["solver"] == "cuda":
|
||||||
if config.sim_config.general["solver"] == "cuda"
|
mem_str = f" host + ~{humanize.naturalsize(solver.memused)} device"
|
||||||
else ""
|
elif config.sim_config.general["solver"] == "opencl":
|
||||||
)
|
mem_str = f" host + unknown for device"
|
||||||
|
|
||||||
logger.info(f"\nMemory used (estimated): " + f"~{humanize.naturalsize(self.p.memory_full_info().uss)}{mem_str}")
|
logger.info(f"\nMemory used (estimated): " + f"~{humanize.naturalsize(self.p.memory_full_info().uss)}{mem_str}")
|
||||||
logger.info(
|
logger.info(
|
||||||
|
@@ -1308,7 +1308,7 @@ class OpenCLUpdates:
|
|||||||
self.event_marker1.wait()
|
self.event_marker1.wait()
|
||||||
|
|
||||||
def calculate_memory_used(self, iteration):
|
def calculate_memory_used(self, iteration):
|
||||||
"""Calculates memory used on last iteration.
|
"""Calculates memory used on last iteration.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
iteration: int for iteration number.
|
iteration: int for iteration number.
|
||||||
@@ -1316,9 +1316,8 @@ class OpenCLUpdates:
|
|||||||
Returns:
|
Returns:
|
||||||
Memory (RAM) used on compute device.
|
Memory (RAM) used on compute device.
|
||||||
"""
|
"""
|
||||||
# if iteration == self.grid.iterations - 1:
|
# No clear way to determine memory used from PyOpenCL unlike PyCUDA.
|
||||||
# return self.drv.mem_get_info()[1] - self.drv.mem_get_info()[0]
|
pass
|
||||||
logger.debug("Look at memory estimate for pyopencl")
|
|
||||||
|
|
||||||
def calculate_solve_time(self):
|
def calculate_solve_time(self):
|
||||||
"""Calculates solving time for model."""
|
"""Calculates solving time for model."""
|
||||||
|
在新工单中引用
屏蔽一个用户