Skip to content

Commit b903b09

Browse files
author
Diptorup Deb
committed
Make the get_flattened_member_count public.
1 parent b17745c commit b903b09

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

numba_dpex/core/datamodel/models.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
)
2323

2424

25-
def _get_flattened_member_count(ty):
26-
"""Return the number of fields in an instance of a given StructModel."""
25+
def get_flattened_member_count(ty):
26+
"""Returns the number of fields in an instance of a given StructModel."""
27+
2728
flattened_member_count = 0
2829
members = ty._members
2930
for member in members:
@@ -109,7 +110,7 @@ def flattened_field_count(self):
109110
"""
110111
Return the number of fields in an instance of a USMArrayDeviceModel.
111112
"""
112-
return _get_flattened_member_count(self)
113+
return get_flattened_member_count(self)
113114

114115

115116
class USMArrayHostModel(StructModel):
@@ -143,7 +144,7 @@ def __init__(self, dmm, fe_type):
143144
@property
144145
def flattened_field_count(self):
145146
"""Return the number of fields in an instance of a USMArrayHostModel."""
146-
return _get_flattened_member_count(self)
147+
return get_flattened_member_count(self)
147148

148149

149150
class SyclQueueModel(StructModel):
@@ -223,7 +224,7 @@ def __init__(self, dmm, fe_type):
223224
@property
224225
def flattened_field_count(self):
225226
"""Return the number of fields in an instance of a RangeModel."""
226-
return _get_flattened_member_count(self)
227+
return get_flattened_member_count(self)
227228

228229

229230
class NdRangeModel(StructModel):
@@ -246,7 +247,7 @@ def __init__(self, dmm, fe_type):
246247
@property
247248
def flattened_field_count(self):
248249
"""Return the number of fields in an instance of a NdRangeModel."""
249-
return _get_flattened_member_count(self)
250+
return get_flattened_member_count(self)
250251

251252

252253
def _init_data_model_manager() -> datamodel.DataModelManager:

0 commit comments

Comments
 (0)