Skip to content

Commit

Permalink
Fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
Vertexwahn committed Jun 9, 2024
1 parent 3c258ec commit d15ab7f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cuda/private/actions/dlink.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
6 changes: 3 additions & 3 deletions cuda/private/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion cuda/private/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions cuda/private/rules/cuda_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."),
Expand Down
2 changes: 1 addition & 1 deletion cuda/private/rules/flags.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions cuda/private/toolchain_config_lib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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, []):
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions tests/toolchain_config_lib/toolchain_config_lib_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d15ab7f

Please sign in to comment.