Skip to content

Commit

Permalink
Symlink hermetic cuda headers to permit clang cuda version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tchatow authored Sep 6, 2024
1 parent 0eafcf4 commit 6d2b56a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def _create_symlinks(repository_ctx, local_path, dirs):
dir,
)

def _create_cuda_header_symlinks(repository_ctx):
if repository_ctx.name == "cuda_nvcc":
repository_ctx.symlink("../cuda_cudart/include/cuda.h", "include/cuda.h")

def use_local_path(repository_ctx, local_path, dirs):
# buildifier: disable=function-docstring-args
"""Creates repository using local redistribution paths."""
Expand Down Expand Up @@ -295,6 +299,7 @@ def _use_downloaded_cuda_redistribution(repository_ctx):
lib_name_to_version_dict,
major_version,
)
_create_cuda_header_symlinks(repository_ctx)
repository_ctx.file("version.txt", major_version)

def _cuda_repo_impl(repository_ctx):
Expand Down

0 comments on commit 6d2b56a

Please sign in to comment.