aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/sca
diff options
context:
space:
mode:
authorTomáš Jusko2023-09-20 13:00:51 +0200
committerTomáš Jusko2023-09-20 13:00:51 +0200
commit8c8fe5766959d7794f7bdb2c32ede45f49130c15 (patch)
treeccd96c9358e4df175aa8a63d8c20bcd60c4b252f /pyecsca/sca
parent80f834f8b27d04a41974cec545a1f280f26f0698 (diff)
downloadpyecsca-8c8fe5766959d7794f7bdb2c32ede45f49130c15.tar.gz
pyecsca-8c8fe5766959d7794f7bdb2c32ede45f49130c15.tar.zst
pyecsca-8c8fe5766959d7794f7bdb2c32ede45f49130c15.zip
Added GPUTraceManager init docstring. Changed total memory to available memory
Diffstat (limited to 'pyecsca/sca')
-rw-r--r--pyecsca/sca/stacked_traces/combine.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pyecsca/sca/stacked_traces/combine.py b/pyecsca/sca/stacked_traces/combine.py
index 7cf4691..608547d 100644
--- a/pyecsca/sca/stacked_traces/combine.py
+++ b/pyecsca/sca/stacked_traces/combine.py
@@ -106,6 +106,15 @@ class GPUTraceManager(BaseTraceManager):
chunk_size: Optional[int] = None,
chunk_memory_ratio: Optional[float] = None,
stream_count: Optional[int] = None) -> None:
+ """
+ :param traces: Stacked traces on which to operate.
+ :param tpb: Threads per block to use for GPU operations.
+ :param chunk: Whether to chunk the traces.
+ :param chunk_size: Number of samples to use for chunking.
+ Chunks will be `chunk_size` x `trace_count`.
+ :param chunk_memory_ratio: Part of available memory to use for chunking.
+ :param stream_count: Number of streams to use for chunking.
+ """
self._check_init_args(chunk_size,
chunk_memory_ratio,
tpb)
@@ -208,7 +217,7 @@ class GPUTraceManager(BaseTraceManager):
assert chunk_item_count is not None
element_size = item_size * chunk_item_count
- mem_size = cuda.current_context().get_memory_info().total
+ mem_size = cuda.current_context().get_memory_info().free
return int(
chunk_memory_ratio * mem_size / element_size)