From 6ed68085d0e6acbfa19647ede8d3fbd4e053e879 Mon Sep 17 00:00:00 2001 From: Pradeep Date: Wed, 30 Apr 2025 09:51:11 +1000 Subject: [PATCH 1/2] initialize --- core/lls_core/tiling.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 core/lls_core/tiling.py diff --git a/core/lls_core/tiling.py b/core/lls_core/tiling.py new file mode 100644 index 0000000..3f42e91 --- /dev/null +++ b/core/lls_core/tiling.py @@ -0,0 +1,2 @@ +#Functions for tiling.. Could move functions into utils.py as well +#PLACEHOLDER \ No newline at end of file From 2220dda08d759a330657a7d9f2dea22e3d312140 Mon Sep 17 00:00:00 2001 From: Pradeep Rajasekhar Date: Tue, 12 Aug 2025 10:23:59 +1000 Subject: [PATCH 2/2] determine max memory --- core/lls_core/utils.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/lls_core/utils.py b/core/lls_core/utils.py index ad8f502..3f0a9b8 100644 --- a/core/lls_core/utils.py +++ b/core/lls_core/utils.py @@ -341,4 +341,18 @@ def convert_xyz_to_zyx_order(deskew_affine_transform:cle.AffineTransform3D): # Swap X and Z axes using numpy indexing xyz_to_zyx = [2, 1, 0, 3] zyx_tranform = deskew_affine_transform[xyz_to_zyx][:, xyz_to_zyx] - return zyx_tranform \ No newline at end of file + return zyx_tranform + +def get_max_allocation_size(): + """Returns maximum memory size for OpenCL device + Returns: + int: Maximum allocation size for OpenCL device + """ + import re + info = cle.cl_info() + match = re.search(r'MAX_MEM_ALLOC_SIZE:(\d+)', info) + if match: + return int(match.group(1)) + else: + logger.error("Could not find MAX_MEM_ALLOC_SIZE in OpenCL device info") + return None \ No newline at end of file