From d15ab7fa4be5635f0375f226fda57ed34144bfb1 Mon Sep 17 00:00:00 2001 From: Vertexwahn Date: Sun, 9 Jun 2024 18:48:33 +0200 Subject: [PATCH] Fix spelling --- README.md | 7 +++---- cuda/private/actions/dlink.bzl | 2 +- cuda/private/providers.bzl | 6 +++--- cuda/private/repositories.bzl | 2 +- cuda/private/rules/cuda_library.bzl | 4 ++-- cuda/private/rules/flags.bzl | 2 +- cuda/private/toolchain_config_lib.bzl | 8 ++++---- tests/toolchain_config_lib/toolchain_config_lib_test.bzl | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index aaaa07be..7bf4c185 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ register_detected_cuda_toolchains() ``` **NOTE**: the use of `register_detected_cuda_toolchains` depends on the environment variable `CUDA_PATH`. You must also -ensure the host compiler is available. On windows, this means that you will also need to set the environment variable +ensure the host compiler is available. On Windows, this means that you will also need to set the environment variable `BAZEL_VC` properly. [`detect_cuda_toolkit`](https://github.com/bazel-contrib/rules_cuda/blob/5633f0c0f7/cuda/private/repositories.bzl#L28-L58) @@ -33,8 +33,7 @@ determains how the toolchains are detected. - `cuda_library`: Can be used to compile and create static library for CUDA kernel code. The resulting targets can be consumed by [C/C++ Rules](https://bazel.build/reference/be/c-cpp#rules). -- `cuda_objects`: If you don't understand what _device link_ means, you must never use it. This rule produce incomplete - object files that can only be consumed by `cuda_library`. It is created for relocatable device code and device link +- `cuda_objects`: If you don't understand what _device link_ means, you must never use it. This rule produces incomplete object files that can only be consumed by `cuda_library`. It is created for relocatable device code and device link time optimization source files. ### Flags @@ -45,7 +44,7 @@ Some flags are defined in [cuda/BUILD.bazel](cuda/BUILD.bazel). To use them, for bazel build --@rules_cuda//cuda:archs=compute_61:compute_61,sm_61 ``` -In `.bazelrc` file, you can define shortcut alias for the flag, for example: +In `.bazelrc` file, you can define a shortcut alias for the flag, for example: ``` # Convenient flag shortcuts. diff --git a/cuda/private/actions/dlink.bzl b/cuda/private/actions/dlink.bzl index e176ed15..41a7180a 100644 --- a/cuda/private/actions/dlink.bzl +++ b/cuda/private/actions/dlink.bzl @@ -109,7 +109,7 @@ def _wrapper_device_link( actions = ctx.actions pic_suffix = "_pic" if pic else "" - # Device-link to cubins for each gpu architecture. The stage1 compiled PTX is embeded in the object files. + # Device-link to cubins for each gpu architecture. The stage1 compiled PTX is embedded in the object files. # We don't need to do any thing about it, presumably. register_h = None cubins = [] diff --git a/cuda/private/providers.bzl b/cuda/private/providers.bzl index cdd49ef2..d2332987 100644 --- a/cuda/private/providers.bzl +++ b/cuda/private/providers.bzl @@ -23,7 +23,7 @@ cuda_archs = [ ] Stage2ArchInfo = provider( - """Provides the information of how the stage 2 complation is carried out. + """Provides the information of how the stage 2 compilation is carried out. One and only one of `virtual`, `gpu` and `lto` must be set to True. For example, if `arch` is set to `80` and `virtual` is `True`, then a ptx embedding process is carried out for `compute_80`. Multiple `Stage2ArchInfo` can be used for specifying how a stage 1 result is @@ -66,9 +66,9 @@ if merged a single depset. "defines": "A depset of strings. It is used for the compilation during device linking.", # direct only: "objects": "A depset of objects. Direct artifacts of the rule.", # but not rdc and pic - "pic_objects": "A depset of position indepentent code objects. Direct artifacts of the rule.", # but not rdc + "pic_objects": "A depset of position independent code objects. Direct artifacts of the rule.", # but not rdc "rdc_objects": "A depset of relocatable device code objects. Direct artifacts of the rule.", # but not pic - "rdc_pic_objects": "A depset of relocatable device code and position indepentent code objects. Direct artifacts of the rule.", + "rdc_pic_objects": "A depset of relocatable device code and position independent code objects. Direct artifacts of the rule.", # transitive archive only (cuda_objects): "archive_objects": "A depset of rdc objects. cuda_objects only. Gathered from the transitive dependencies for archiving.", "archive_pic_objects": "A depset of rdc pic objects. cuda_objects only. Gathered from the transitive dependencies for archiving.", diff --git a/cuda/private/repositories.bzl b/cuda/private/repositories.bzl index 5cfacbb4..fc04d0fc 100644 --- a/cuda/private/repositories.bzl +++ b/cuda/private/repositories.bzl @@ -48,7 +48,7 @@ def detect_cuda_toolkit(repository_ctx): if ptxas_path: # ${CUDA_PATH}/bin/ptxas - # Some distributions instead put CUDA binaries in a seperate path + # Some distributions instead put CUDA binaries in a separate path # Manually check and redirect there when necessary alternative = repository_ctx.path("/usr/lib/nvidia-cuda-toolkit/bin/nvcc") if str(ptxas_path) == "/usr/bin/ptxas" and alternative.exists: diff --git a/cuda/private/rules/cuda_library.bzl b/cuda/private/rules/cuda_library.bzl index 433fea26..867402f4 100644 --- a/cuda/private/rules/cuda_library.bzl +++ b/cuda/private/rules/cuda_library.bzl @@ -70,7 +70,7 @@ def _cuda_library_impl(ctx): rdc_objects = depset(transitive = [rdc_objects, rdc_dlink_output]) rdc_pic_objects = depset(transitive = [rdc_pic_objects, rdc_pic_dlink_output]) - # objects to archive: objects directly outputed by this rule and all objects transitively from deps, + # objects to archive: objects directly outputted by this rule and all objects transitively from deps, # take use_rdc=True and non-pic as an example: # rdc_objects: produce with this rule, thus it must be archived in the library produced by this rule # archive_rdc_objects: propagate from other `cuda_objects`, so this rule is in charge of archiving them @@ -155,7 +155,7 @@ cuda_library = rule( "alwayslink": attr.bool(default = False), "rdc": attr.bool( default = False, - doc = ("Whether to perform device linking for relocateable device code. " + + doc = ("Whether to perform device linking for relocatable device code. " + "Transitive deps that contain device code must all either be cuda_objects or cuda_library(rdc = True)."), ), "includes": attr.string_list(doc = "List of include dirs to be added to the compile line."), diff --git a/cuda/private/rules/flags.bzl b/cuda/private/rules/flags.bzl index 14e4da4e..0c5b9c74 100644 --- a/cuda/private/rules/flags.bzl +++ b/cuda/private/rules/flags.bzl @@ -9,7 +9,7 @@ def _cuda_archs_flag_impl(ctx): cuda_archs_flag = rule( doc = """A build setting for specifying cuda archs to compile for. -To retain the flexiblity of NVCC, the [extended notation](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#extended-notation) is adopted. +To retain the flexibility of NVCC, the [extended notation](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#extended-notation) is adopted. When passing cuda_archs from commandline, its spec grammar is as follows: diff --git a/cuda/private/toolchain_config_lib.bzl b/cuda/private/toolchain_config_lib.bzl index 7fab584b..9fafd867 100644 --- a/cuda/private/toolchain_config_lib.bzl +++ b/cuda/private/toolchain_config_lib.bzl @@ -243,7 +243,7 @@ def _eval_flag_group_impl(stack, ret, fg, var, eval_iterations, _parse_flag_cach ret[-2].extend(ret[-1]) ret.pop() # The return space is deallocated. stack.pop() # The stack frame is useless anymore, - continue #### and there is no need to procees the current stack frame any further + continue #### and there is no need to process the current stack frame any further stack[-1][-1] = True # mark entered = True @@ -275,7 +275,7 @@ def _eval_flag_group_impl(stack, ret, fg, var, eval_iterations, _parse_flag_cach _eval_flags_or_flag_groups(stack, ret, fg, var, recursion_depth, _parse_flag_cache) if len(stack) != 0: - fail("flag_group evaluation imcomplete") + fail("flag_group evaluation incomplete") return ret def eval_flag_group(fg, value, max_eval_iterations = 65536, _parse_flag_cache = None): @@ -402,7 +402,7 @@ def _enable_all_implied(info): to_enable.extend([new_name for new_name in reversed(info.selectables_info.implies[name])]) if len(to_enable) != 0: - fail("_enable_all_implied imcomplete") + fail("_enable_all_implied incomplete") def _is_implied_by_enabled_activatable(info, name): for implied_by in info.selectables_info.implied_by.get(name, []): @@ -476,7 +476,7 @@ def _check_activatable(info, to_check): to_check.extend(reversed(info.selectables_info.implied_by.get(name, []))) if len(to_check) != 0: - fail("_check_activatable imcomplete") + fail("_check_activatable incomplete") def _disable_unsupported_activatables(info): enabled = [k for k, v in reversed(info.enabled.items()) if v == True] diff --git a/tests/toolchain_config_lib/toolchain_config_lib_test.bzl b/tests/toolchain_config_lib/toolchain_config_lib_test.bzl index 315cfb1a..7d18ebbb 100644 --- a/tests/toolchain_config_lib/toolchain_config_lib_test.bzl +++ b/tests/toolchain_config_lib/toolchain_config_lib_test.bzl @@ -83,8 +83,8 @@ def _parse_flag_cache_test_impl(ctx): asserts.equals(env, {"v": [0]}, f1.expandables) asserts.equals(env, ["v"], cache[flag_str].chunks) asserts.equals(env, {"v": [0]}, cache[flag_str].expandables) - f1.chunks.append("modifed") - f1.expandables["v"].append("modifed") + f1.chunks.append("modified") + f1.expandables["v"].append("modified") asserts.equals(env, ["v"], cache[flag_str].chunks) asserts.equals(env, {"v": [0]}, cache[flag_str].expandables) f2 = parse_flag(flag_str, cache = cache)