Skip to content

Commit b39998c

Browse files
committed
Convert arguments to integers in _make
1 parent 73aea25 commit b39998c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/ninetoothed/build.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,7 @@ def _make(premake, config, caller, kernel_name, output_dir):
370370
combination |= compilation_configs
371371

372372
for name, value in combination.items():
373-
if isinstance(value, bool) or value is None:
374-
combination[name] = _MACRO_MAPPING[value][0]
375-
376-
if value in _DTYPE_MAPPING:
377-
combination[name] = _DTYPE_MAPPING[value]
373+
combination[name] = _arg_to_int(value)
378374

379375
kernel_name_ = f"{kernel_name}_{_generate_suffix(combination.values())}"
380376

@@ -426,6 +422,9 @@ def _generate_suffix(values):
426422

427423

428424
def _arg_to_int(arg):
425+
if isinstance(arg, bool) or arg is None:
426+
return _MACRO_MAPPING[arg][1]
427+
429428
if arg in _DTYPE_MAPPING:
430429
return tuple(_DTYPE_MAPPING.keys()).index(arg)
431430

0 commit comments

Comments
 (0)