Skip to content

Commit

Permalink
Set nvcc --generate-line-info when compilation_mode=fastbuild (#120)
Browse files Browse the repository at this point in the history
This makes the debug info for both host and device code the same
(i.e. --generate-line-info does for device code what -g1 does for
host code).

Change-Id: I9b3c9afad4b5c9275076fde4462225594c37304b
  • Loading branch information
garymm authored Jul 7, 2023
1 parent b5a3864 commit 039ee7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cuda/private/toolchain_configs/nvcc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _impl(ctx):
flag_sets = [
flag_set(
actions = [ACTION_NAMES.cuda_compile],
flag_groups = [flag_group(flags = ["-Xcompiler", "-g1"])],
flag_groups = [flag_group(flags = ["--generate-line-info", "-Xcompiler", "-g1"])],
),
],
provides = ["compilation_mode"],
Expand Down
5 changes: 4 additions & 1 deletion tests/flag/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ cuda_library_c_dbg_flag_test(
cuda_library_c_fastbuild_flag_test(
name = "cuda_library_c_fastbuild_flag_test",
action_mnemonic = "CudaCompile",
contain_flags = ["-g1"],
contain_flags = [
"--generate-line-info",
"-g1",
],
not_contain_flags = ["-DNDEBUG"],
target_compatible_with = ["@platforms//os:linux"],
target_under_test = "@rules_cuda_examples//basic:kernel",
Expand Down

0 comments on commit 039ee7b

Please sign in to comment.