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 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