MCPcopy Create free account
hub / github.com/KuangjuX/ncu-cli / build_kernel_data

Function build_kernel_data

src/parser.rs:58–123  ·  view source on GitHub ↗
(map: &HashMap<String, String>)

Source from the content-addressed store, hash-verified

56}
57
58fn build_kernel_data(map: &HashMap<String, String>) -> Result<KernelData> {
59 Ok(KernelData {
60 kernel_name: get_str(map, metrics::FUNCTION_NAME),
61 device_name: get_str(map, metrics::DEVICE_NAME),
62 grid_size: get_str(map, metrics::GRID_SIZE),
63 block_size: get_str(map, metrics::BLOCK_SIZE),
64 duration_us: get_f64(map, metrics::GPU_TIME_DURATION),
65
66 sm_throughput_pct: get_f64(map, metrics::SM_THROUGHPUT),
67 mem_throughput_pct: get_f64(map, metrics::MEM_THROUGHPUT),
68
69 l1_sectors_global_ld: get_f64(map, metrics::L1_SECTORS_GLOBAL_LD),
70 l1_requests_global_ld: get_f64(map, metrics::L1_REQUESTS_GLOBAL_LD),
71 l1_hit_rate_pct: get_f64(map, metrics::L1_HIT_RATE),
72 l2_hit_rate_pct: get_f64(map, metrics::L2_HIT_RATE),
73 l1_sectors_global_st: get_f64(map, metrics::L1_SECTORS_GLOBAL_ST),
74 l1_requests_global_st: get_f64(map, metrics::L1_REQUESTS_GLOBAL_ST),
75
76 shared_mem_bank_conflicts: get_f64(map, metrics::SHMEM_BANK_CONFLICTS),
77
78 local_mem_store_sectors: get_f64(map, metrics::LOCAL_MEM_STORE_SECTORS),
79 warps_active_pct: get_f64(map, metrics::WARPS_ACTIVE_PCT),
80
81 registers_per_thread: get_f64(map, metrics::REGISTERS_PER_THREAD),
82 shared_mem_per_block_kb: get_f64(map, metrics::SHARED_MEM_PER_BLOCK),
83 occupancy_limit_registers: get_f64(map, metrics::OCCUPANCY_LIMIT_REGISTERS),
84 occupancy_limit_shared_mem: get_f64(map, metrics::OCCUPANCY_LIMIT_SHARED_MEM),
85 occupancy_limit_warps: get_f64(map, metrics::OCCUPANCY_LIMIT_WARPS),
86 occupancy_limit_blocks: get_f64(map, metrics::OCCUPANCY_LIMIT_BLOCKS),
87 theoretical_occupancy_pct: get_f64(map, metrics::THEORETICAL_OCCUPANCY_PCT),
88
89 dram_read_gbytes: get_f64(map, metrics::DRAM_BYTES_READ),
90 dram_write_gbytes: get_f64(map, metrics::DRAM_BYTES_WRITE),
91 dram_throughput_pct: get_f64(map, metrics::DRAM_THROUGHPUT_PCT),
92
93 tensor_core_hmma_pct: get_f64(map, metrics::TENSOR_HMMA_PCT),
94
95 pipe_fma_pct: get_f64(map, metrics::PIPE_FMA_PCT),
96 pipe_alu_pct: get_f64(map, metrics::PIPE_ALU_PCT),
97 pipe_lsu_pct: get_f64(map, metrics::PIPE_LSU_PCT),
98 pipe_tensor_pct: get_f64(map, metrics::PIPE_TENSOR_PCT),
99 pipe_fma_fp16_pct: get_f64(map, metrics::PIPE_FMA_FP16_PCT),
100
101 avg_thread_executed: get_f64(map, metrics::AVG_THREAD_EXECUTED),
102 avg_thread_executed_true: get_f64(map, metrics::AVG_THREAD_EXECUTED_TRUE),
103
104 warps_eligible_per_cycle: get_f64(map, metrics::WARPS_ELIGIBLE_PER_CYCLE),
105
106 stall_long_scoreboard: get_f64(map, metrics::STALL_LONG_SCOREBOARD),
107 stall_short_scoreboard: get_f64(map, metrics::STALL_SHORT_SCOREBOARD),
108 stall_wait: get_f64(map, metrics::STALL_WAIT),
109 stall_sleeping: get_f64(map, metrics::STALL_SLEEPING),
110 stall_barrier: get_f64(map, metrics::STALL_BARRIER),
111 stall_mio_throttle: get_f64(map, metrics::STALL_MIO_THROTTLE),
112 stall_lg_throttle: get_f64(map, metrics::STALL_LG_THROTTLE),
113 stall_math_pipe_throttle: get_f64(map, metrics::STALL_MATH_PIPE_THROTTLE),
114 stall_drain: get_f64(map, metrics::STALL_DRAIN),
115 stall_not_selected: get_f64(map, metrics::STALL_NOT_SELECTED),

Callers 1

parse_ncu_csvFunction · 0.85

Calls 3

get_strFunction · 0.85
get_f64Function · 0.85
parse_arch_smFunction · 0.85

Tested by

no test coverage detected