MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / free

Method free

python/cutlass_cppgen/backend/arguments.py:120–136  ·  view source on GitHub ↗

Frees allocated device-side memory

(self)

Source from the content-addressed store, hash-verified

118 self.free()
119
120 def free(self):
121 """
122 Frees allocated device-side memory
123 """
124 # Free any device memory allocated manually
125 if not cutlass_cppgen.use_rmm:
126 for name, buf in self.buffers.items():
127 if isinstance(buf, DevicePtrWrapper):
128 err, = cudart.cudaFree(buf.ptr)
129 if err != cudart.cudaError_t.cudaSuccess:
130 raise RuntimeError(f"cudaFree failed with error {err}")
131
132 if hasattr(self, "workspace_buffer") and isinstance(self.workspace_buffer, DevicePtrWrapper):
133 err, = cudart.cudaFree(self.workspace_buffer.ptr)
134 if err != cudart.cudaError_t.cudaSuccess:
135 raise RuntimeError(f"cudaFree failed with error {err}")
136 del self.workspace_buffer

Callers 3

syncMethod · 0.95
runMethod · 0.45
runMethod · 0.45

Calls

no outgoing calls

Tested by 1

runMethod · 0.36