Skip to content

refactor: Convert all variable/function names to snake_case - #9

Closed
ChaoZheng109 wants to merge 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:runtime-snake
Closed

refactor: Convert all variable/function names to snake_case#9
ChaoZheng109 wants to merge 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:runtime-snake

Conversation

@ChaoZheng109

Copy link
Copy Markdown
Collaborator

Normalize naming convention across the codebase to follow snake_case standard for all variables, function parameters, and function names.

Changes:

  • Runtime struct: functionBinAddr → function_bin_addr, scheCpuNum → sche_cpu_num
  • DeviceRunner: blockDim_ → block_dim_, deviceId_ → device_id_, etc.
  • Method parameters: Converted CamelCase to snake_case (e.g., hostDeviceArgs → host_device_args)
  • Local variables: Converted CamelCase to snake_case
  • Comments: Updated references to use new snake_case names
  • DeviceArgs struct: aicpuSoBin → aicpu_so_bin, aicpuSoLen → aicpu_so_len
  • KernelArgs struct: deviceArgs → device_args

Affected files:

  • src/runtime/runtime/runtime.h (.2 fields)
  • src/runtime/runtime/runtime.cpp (3 usages)
  • src/platform/a2a3/common/kernel_args.h (1 field)
  • src/platform/a2a3/host/devicerunner.h (19 parameters + 10 members)
  • src/platform/a2a3/host/devicerunner.cpp (20 usages)
  • src/platform/a2a3/host/memoryallocator.cpp (1 variable)
  • src/platform/a2a3/host/pto_runtime_c_api.cpp (2 variables)
  • src/runtime/aicore/aicore_executor.cpp (5 usages in comments/code)
  • src/runtime/aicpu/aicpu_executor.cpp (2 usages)

Total changes: 45 identifiers across 9 files

@ChaoZheng109
ChaoZheng109 force-pushed the runtime-snake branch 2 times, most recently from f5db6eb to 40d476e Compare January 29, 2026 02:05
Normalize naming convention across the entire codebase:
- Variables: CamelCase → snake_case (80+ identifiers)
- Functions: CamelCase → snake_case (40+ functions)
- Struct members: CamelCase → snake_case (20+ fields)
- Method names: PascalCase → snake_case (30+ methods)

Affected components:
- Runtime class (function_bin_addr, sche_cpu_num, etc.)
- DeviceRunner class (get(), run(), all members)
- CoreFunctionBinCache (data_size, num_kernels, methods)
- AICPU/AICore executors (init, run, deinit, etc.)
- Device logging functions (is_log_enable_*, init_log_switch)
- C API functions and Python bindings

All changes verified with successful compilation and tests.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant