File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -224,11 +224,18 @@ class BlockSizeOrigin(Origin):
224
224
block_size_idx : int
225
225
226
226
def host_str (self ) -> str :
227
+ """
228
+ Get the host-side string representation of a block size variable.
229
+ If the block size variable was not created (e.g., block size == 1),
230
+ return the literal '1'.
231
+ """
227
232
from .device_function import DeviceFunction
228
233
229
- host_str = DeviceFunction .current ().block_size_var (self .block_size_idx )
230
- assert host_str is not None
231
- return host_str
234
+ # Look up the block size variable name; if not set (e.g., size==1), use literal 1
235
+ var = DeviceFunction .current ().block_size_var (self .block_size_idx )
236
+ if var is None :
237
+ return "1"
238
+ return var
232
239
233
240
234
241
@dataclasses .dataclass
You can’t perform that action at this time.
0 commit comments