Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cuda_core/cuda/core/system/_field_values.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cdef class FieldValue:
elif value_type == ValueType.UNSIGNED_LONG_LONG:
return int(value.ull_val[0])
elif value_type == ValueType.SIGNED_LONG_LONG:
return int(value.ll_val[0])
return int(value.sll_val[0])
elif value_type == ValueType.SIGNED_INT:
return int(value.si_val[0])
elif value_type == ValueType.UNSIGNED_SHORT:
Expand Down
13 changes: 13 additions & 0 deletions cuda_core/tests/system/test_system_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,19 @@ def test_field_values(subtests):
assert field_values[0].value <= old_value


@pytest.mark.agent_authored(model="gpt-5.6-sol")
def test_field_value_decodes_signed_long_long():
"""SIGNED_LONG_LONG decodes from nvmlValue_t.sll_val as a Python int."""
field_value = nvml.FieldValue()
field_value.nvml_return = int(nvml.Return.SUCCESS)
field_value.value_type = int(nvml.ValueType.SIGNED_LONG_LONG)
field_value.value.sll_val[0] = -45

value = _device.FieldValue(field_value).value
assert value == -45
assert type(value) is int


@pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows")
def test_get_all_devices_with_cpu_affinity(subtests):
for i in range(multiprocessing.cpu_count()):
Expand Down
Loading