From f85f511a38e369a15359a0756512e69ad4cfcac0 Mon Sep 17 00:00:00 2001 From: Harri Nieminen Date: Wed, 12 Apr 2023 07:18:46 +0300 Subject: [PATCH] amd: fix typos in code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Reviewed-by: Marek Olšák Part-of: --- src/amd/common/ac_debug.c | 2 +- src/amd/common/ac_debug.h | 2 +- src/amd/common/sid.h | 2 +- src/amd/compiler/aco_register_allocation.cpp | 46 ++++++++++---------- src/amd/llvm/ac_llvm_helper.cpp | 2 +- src/amd/llvm/ac_llvm_util.c | 2 +- src/amd/llvm/ac_llvm_util.h | 2 +- src/amd/vulkan/bvh/ploc_internal.comp | 20 ++++----- src/amd/vulkan/radv_debug.c | 8 ++-- src/amd/vulkan/radv_shader.c | 4 +- src/gallium/drivers/radeonsi/si_debug.c | 4 +- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c index bf108fcc486..9c0d9436f48 100644 --- a/src/amd/common/ac_debug.c +++ b/src/amd/common/ac_debug.c @@ -689,7 +689,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw, const int *trace_ids, unsign * \param old_dmesg_timestamp previous dmesg timestamp parsed at init time * \param out_addr detected VM fault addr */ -bool ac_vm_fault_occured(enum amd_gfx_level gfx_level, uint64_t *old_dmesg_timestamp, +bool ac_vm_fault_occurred(enum amd_gfx_level gfx_level, uint64_t *old_dmesg_timestamp, uint64_t *out_addr) { #ifdef _WIN32 diff --git a/src/amd/common/ac_debug.h b/src/amd/common/ac_debug.h index ffbc06bc036..4664f02a00b 100644 --- a/src/amd/common/ac_debug.h +++ b/src/amd/common/ac_debug.h @@ -68,7 +68,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw, const int *trace_ids, unsign const char *name, enum amd_gfx_level gfx_level, enum radeon_family family, ac_debug_addr_callback addr_callback, void *addr_callback_data); -bool ac_vm_fault_occured(enum amd_gfx_level gfx_level, uint64_t *old_dmesg_timestamp, +bool ac_vm_fault_occurred(enum amd_gfx_level gfx_level, uint64_t *old_dmesg_timestamp, uint64_t *out_addr); unsigned ac_get_wave_info(enum amd_gfx_level gfx_level, diff --git a/src/amd/common/sid.h b/src/amd/common/sid.h index 11b5aa424d7..5bc60316c82 100644 --- a/src/amd/common/sid.h +++ b/src/amd/common/sid.h @@ -358,7 +358,7 @@ #define CIK_SDMA_COPY_SUB_OPCODE_T2T_SUB_WINDOW 0x6 #define CIK_SDMA_OPCODE_WRITE 0x2 #define SDMA_WRITE_SUB_OPCODE_LINEAR 0x0 -#define SDMA_WRTIE_SUB_OPCODE_TILED 0x1 +#define SDMA_WRITE_SUB_OPCODE_TILED 0x1 #define CIK_SDMA_OPCODE_INDIRECT_BUFFER 0x4 #define CIK_SDMA_PACKET_FENCE 0x5 #define CIK_SDMA_PACKET_TRAP 0x6 diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index ed05b3454ae..ca9b8702419 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2415,8 +2415,8 @@ init_reg_file(ra_ctx& ctx, const std::vector& live_out_per_block, Block& void get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) { - std::vector> phi_ressources; - std::unordered_map temp_to_phi_ressources; + std::vector> phi_resources; + std::unordered_map temp_to_phi_resources; for (auto block_rit = ctx.program->blocks.rbegin(); block_rit != ctx.program->blocks.rend(); block_rit++) { @@ -2477,10 +2477,10 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) live.erase(def.tempId()); /* mark last-seen phi operand */ std::unordered_map::iterator it = - temp_to_phi_ressources.find(def.tempId()); - if (it != temp_to_phi_ressources.end() && - def.regClass() == phi_ressources[it->second][0].regClass()) { - phi_ressources[it->second][0] = def.getTemp(); + temp_to_phi_resources.find(def.tempId()); + if (it != temp_to_phi_resources.end() && + def.regClass() == phi_resources[it->second][0].regClass()) { + phi_resources[it->second][0] = def.getTemp(); /* try to coalesce phi affinities with parallelcopies */ Operand op = Operand(); switch (instr->opcode) { @@ -2514,8 +2514,8 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) } if (op.isTemp() && op.isFirstKillBeforeDef() && def.regClass() == op.regClass()) { - phi_ressources[it->second].emplace_back(op.getTemp()); - temp_to_phi_ressources[op.tempId()] = it->second; + phi_resources[it->second].emplace_back(op.getTemp()); + temp_to_phi_resources[op.tempId()] = it->second; } } } @@ -2532,16 +2532,16 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) assert(instr->definitions[0].isTemp()); std::unordered_map::iterator it = - temp_to_phi_ressources.find(instr->definitions[0].tempId()); - unsigned index = phi_ressources.size(); + temp_to_phi_resources.find(instr->definitions[0].tempId()); + unsigned index = phi_resources.size(); std::vector* affinity_related; - if (it != temp_to_phi_ressources.end()) { + if (it != temp_to_phi_resources.end()) { index = it->second; - phi_ressources[index][0] = instr->definitions[0].getTemp(); - affinity_related = &phi_ressources[index]; + phi_resources[index][0] = instr->definitions[0].getTemp(); + affinity_related = &phi_resources[index]; } else { - phi_ressources.emplace_back(std::vector{instr->definitions[0].getTemp()}); - affinity_related = &phi_ressources.back(); + phi_resources.emplace_back(std::vector{instr->definitions[0].getTemp()}); + affinity_related = &phi_resources.back(); } for (const Operand& op : instr->operands) { @@ -2549,7 +2549,7 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) affinity_related->emplace_back(op.getTemp()); if (block.kind & block_kind_loop_header) continue; - temp_to_phi_ressources[op.tempId()] = index; + temp_to_phi_resources[op.tempId()] = index; } } } @@ -2568,25 +2568,25 @@ get_affinities(ra_ctx& ctx, std::vector& live_out_per_block) continue; /* create an (empty) merge-set for the phi-related variables */ - auto it = temp_to_phi_ressources.find(phi->definitions[0].tempId()); - unsigned index = phi_ressources.size(); - if (it == temp_to_phi_ressources.end()) { - temp_to_phi_ressources[phi->definitions[0].tempId()] = index; - phi_ressources.emplace_back(std::vector{phi->definitions[0].getTemp()}); + auto it = temp_to_phi_resources.find(phi->definitions[0].tempId()); + unsigned index = phi_resources.size(); + if (it == temp_to_phi_resources.end()) { + temp_to_phi_resources[phi->definitions[0].tempId()] = index; + phi_resources.emplace_back(std::vector{phi->definitions[0].getTemp()}); } else { index = it->second; } for (unsigned i = 1; i < phi->operands.size(); i++) { const Operand& op = phi->operands[i]; if (op.isTemp() && op.isKill() && op.regClass() == phi->definitions[0].regClass()) { - temp_to_phi_ressources[op.tempId()] = index; + temp_to_phi_resources[op.tempId()] = index; } } } } } /* create affinities */ - for (std::vector& vec : phi_ressources) { + for (std::vector& vec : phi_resources) { for (unsigned i = 1; i < vec.size(); i++) if (vec[i].id() != vec[0].id()) ctx.assignments[vec[i].id()].affinity = vec[0].id(); diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp index 9d831f37a65..1b89f90b4da 100644 --- a/src/amd/llvm/ac_llvm_helper.cpp +++ b/src/amd/llvm/ac_llvm_helper.cpp @@ -93,7 +93,7 @@ bool ac_is_llvm_processor_supported(LLVMTargetMachineRef tm, const char *process return TM->getMCSubtargetInfo()->isCPUStringValid(processor); } -void ac_reset_llvm_all_options_occurences() +void ac_reset_llvm_all_options_occurrences() { cl::ResetAllOptionOccurrences(); } diff --git a/src/amd/llvm/ac_llvm_util.c b/src/amd/llvm/ac_llvm_util.c index 9ac51025f4d..1fc5ea8f170 100644 --- a/src/amd/llvm/ac_llvm_util.c +++ b/src/amd/llvm/ac_llvm_util.c @@ -59,7 +59,7 @@ static void ac_init_llvm_target(void) #endif }; - ac_reset_llvm_all_options_occurences(); + ac_reset_llvm_all_options_occurrences(); LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL); ac_llvm_run_atexit_for_destructors(); diff --git a/src/amd/llvm/ac_llvm_util.h b/src/amd/llvm/ac_llvm_util.h index 6ff98c8a370..a5d14316c32 100644 --- a/src/amd/llvm/ac_llvm_util.h +++ b/src/amd/llvm/ac_llvm_util.h @@ -80,7 +80,7 @@ LLVMTargetRef ac_get_llvm_target(const char *triple); const char *ac_get_llvm_processor_name(enum radeon_family family); void ac_llvm_run_atexit_for_destructors(void); bool ac_is_llvm_processor_supported(LLVMTargetMachineRef tm, const char *processor); -void ac_reset_llvm_all_options_occurences(); +void ac_reset_llvm_all_options_occurrences(); void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes); void ac_add_attr_alignment(LLVMValueRef val, uint64_t bytes); bool ac_is_sgpr_param(LLVMValueRef param); diff --git a/src/amd/vulkan/bvh/ploc_internal.comp b/src/amd/vulkan/bvh/ploc_internal.comp index 253f26200ae..67c987e44e9 100644 --- a/src/amd/vulkan/bvh/ploc_internal.comp +++ b/src/amd/vulkan/bvh/ploc_internal.comp @@ -178,9 +178,9 @@ load_id(VOID_REF ids, uint32_t iter, uint32_t index) void load_bounds(VOID_REF ids, uint32_t iter, uint32_t task_index, uint32_t lds_base, - uint32_t neigbourhood_overlap, uint32_t search_bound) + uint32_t neighbourhood_overlap, uint32_t search_bound) { - for (uint32_t i = task_index - 2 * neigbourhood_overlap; i < search_bound; + for (uint32_t i = task_index - 2 * neighbourhood_overlap; i < search_bound; i += gl_WorkGroupSize.x) { uint32_t id = load_id(ids, iter, i); if (id == RADV_BVH_INVALID_NODE) @@ -269,30 +269,30 @@ main(void) /* Find preferred partners and merge them */ PHASE (args.header) { uint32_t base_index = task_index - gl_LocalInvocationID.x; - uint32_t neigbourhood_overlap = min(PLOC_NEIGHBOURHOOD, base_index); - uint32_t double_neigbourhood_overlap = min(2 * PLOC_NEIGHBOURHOOD, base_index); + uint32_t neighbourhood_overlap = min(PLOC_NEIGHBOURHOOD, base_index); + uint32_t double_neighbourhood_overlap = min(2 * PLOC_NEIGHBOURHOOD, base_index); /* Upper bound to where valid nearest node indices are written. */ uint32_t write_bound = min(current_task_count, base_index + gl_WorkGroupSize.x + PLOC_NEIGHBOURHOOD); /* Upper bound to where valid nearest node indices are searched. */ uint32_t search_bound = min(current_task_count, base_index + gl_WorkGroupSize.x + 2 * PLOC_NEIGHBOURHOOD); - uint32_t lds_base = base_index - double_neigbourhood_overlap; + uint32_t lds_base = base_index - double_neighbourhood_overlap; - load_bounds(src_ids, iter, task_index, lds_base, neigbourhood_overlap, search_bound); + load_bounds(src_ids, iter, task_index, lds_base, neighbourhood_overlap, search_bound); for (uint32_t i = gl_LocalInvocationID.x; i < NUM_PLOC_LDS_ITEMS; i += gl_WorkGroupSize.x) nearest_neighbour_indices[i] = 0xFFFFFFFF; barrier(); - for (uint32_t i = task_index - double_neigbourhood_overlap; i < write_bound; + for (uint32_t i = task_index - double_neighbourhood_overlap; i < write_bound; i += gl_WorkGroupSize.x) { uint32_t right_bound = min(search_bound - 1 - i, PLOC_NEIGHBOURHOOD); uint32_t fallback_pair = i == 0 ? (i + 1) : (i - 1); uint32_t min_offset = encode_neighbour_offset(INFINITY, i, fallback_pair); - for (uint32_t j = max(i + 1, base_index - neigbourhood_overlap); j <= i + right_bound; + for (uint32_t j = max(i + 1, base_index - neighbourhood_overlap); j <= i + right_bound; ++j) { float sah = combined_node_cost(lds_base, i, j); @@ -301,7 +301,7 @@ main(void) min_offset = min(min_offset, i_encoded_offset); atomicMin(nearest_neighbour_indices[j - lds_base], j_encoded_offset); } - if (i >= base_index - neigbourhood_overlap) + if (i >= base_index - neighbourhood_overlap) atomicMin(nearest_neighbour_indices[i - lds_base], min_offset); } @@ -309,7 +309,7 @@ main(void) shared_aggregate_sum = 0; barrier(); - for (uint32_t i = task_index - neigbourhood_overlap; i < write_bound; + for (uint32_t i = task_index - neighbourhood_overlap; i < write_bound; i += gl_WorkGroupSize.x) { uint32_t left_bound = min(i, PLOC_NEIGHBOURHOOD); uint32_t right_bound = min(search_bound - 1 - i, PLOC_NEIGHBOURHOOD); diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index fb1331095d7..a956ab5574e 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -84,7 +84,7 @@ radv_init_trace(struct radv_device *device) if (!device->trace_id_ptr) return false; - ac_vm_fault_occured(device->physical_device->rad_info.gfx_level, &device->dmesg_timestamp, NULL); + ac_vm_fault_occurred(device->physical_device->rad_info.gfx_level, &device->dmesg_timestamp, NULL); return true; } @@ -690,7 +690,7 @@ radv_dump_umr_waves(struct radv_queue *queue, FILE *f) } static bool -radv_gpu_hang_occured(struct radv_queue *queue, enum amd_ip_type ring) +radv_gpu_hang_occurred(struct radv_queue *queue, enum amd_ip_type ring) { struct radeon_winsys *ws = queue->device->ws; @@ -709,10 +709,10 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs) ring = radv_queue_ring(queue); - bool hang_occurred = radv_gpu_hang_occured(queue, ring); + bool hang_occurred = radv_gpu_hang_occurred(queue, ring); bool vm_fault_occurred = false; if (queue->device->instance->debug_flags & RADV_DEBUG_VM_FAULTS) - vm_fault_occurred = ac_vm_fault_occured(device->physical_device->rad_info.gfx_level, + vm_fault_occurred = ac_vm_fault_occurred(device->physical_device->rad_info.gfx_level, &device->dmesg_timestamp, &addr); if (!hang_occurred && !vm_fault_occurred) return; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index c57e79c2ccb..a25a3a6955d 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -812,7 +812,7 @@ setup_ngg_lds_layout(struct radv_device *device, nir_shader *nir, struct radv_sh /* Get pervertex LDS usage. */ bool uses_instanceid = BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_INSTANCE_ID); - bool uses_primtive_id = + bool uses_primitive_id = BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_PRIMITIVE_ID); bool streamout_enabled = nir->xfb_info && device->physical_device->use_ngg_streamout; unsigned pervertex_lds_bytes = @@ -823,7 +823,7 @@ setup_ngg_lds_layout(struct radv_device *device, nir_shader *nir, struct radv_sh false, /* user edge flag */ info->has_ngg_culling, uses_instanceid, - uses_primtive_id); + uses_primitive_id); unsigned total_es_lds_bytes = pervertex_lds_bytes * max_vtx_in; scratch_lds_base = ALIGN(total_es_lds_bytes, 8u); diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index ac78dd7a7c2..70099644f40 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -1059,7 +1059,7 @@ void si_check_vm_faults(struct si_context *sctx, struct radeon_saved_cs *saved, uint64_t addr; char cmd_line[4096]; - if (!ac_vm_fault_occured(sctx->gfx_level, &sctx->dmesg_timestamp, &addr)) + if (!ac_vm_fault_occurred(sctx->gfx_level, &sctx->dmesg_timestamp, &addr)) return; f = dd_get_debug_file(false); @@ -1109,5 +1109,5 @@ void si_init_debug_functions(struct si_context *sctx) * only new messages will be checked for VM faults. */ if (sctx->screen->debug_flags & DBG(CHECK_VM)) - ac_vm_fault_occured(sctx->gfx_level, &sctx->dmesg_timestamp, NULL); + ac_vm_fault_occurred(sctx->gfx_level, &sctx->dmesg_timestamp, NULL); }