-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bazel-contrib:main' into aarch64Support
- Loading branch information
Showing
15 changed files
with
135 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.3.2 | ||
6.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("//cuda/private:rules/cuda_library.bzl", _cuda_library = "cuda_library") | ||
|
||
def cuda_binary(name, **attrs): | ||
"""Wrapper to ensure the binary is compiled with the CUDA compiler.""" | ||
cuda_library_only_attrs = ["deps", "srcs", "hdrs"] | ||
|
||
# https://bazel.build/reference/be/common-definitions?hl=en#common-attributes-binaries | ||
cc_binary_only_attrs = ["args", "env", "output_licenses"] | ||
|
||
cuda_library_name = "_" + name | ||
|
||
_cuda_library( | ||
name = cuda_library_name, | ||
**{k: v for k, v in attrs.items() if k not in cc_binary_only_attrs} | ||
) | ||
|
||
native.cc_binary( | ||
name = name, | ||
deps = [cuda_library_name], | ||
**{k: v for k, v in attrs.items() if k not in cuda_library_only_attrs} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mkdocs-material==9.4.2 | ||
mkdocs-material==9.5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
load("@rules_cuda//cuda:defs.bzl", "cuda_binary", "cuda_test") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cuda_binary( | ||
name = "main", | ||
srcs = ["main.cu"], | ||
) | ||
|
||
cuda_test( | ||
name = "test", | ||
srcs = ["main.cu"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <cstdio> | ||
|
||
#define CUDA_CHECK(expr) \ | ||
do { \ | ||
cudaError_t err = (expr); \ | ||
if (err != cudaSuccess) { \ | ||
fprintf(stderr, "CUDA Error Code : %d\n Error String: %s\n", \ | ||
err, cudaGetErrorString(err)); \ | ||
exit(err); \ | ||
} \ | ||
} while (0) | ||
|
||
__global__ void kernel() { | ||
printf("cuda kernel called!\n"); | ||
} | ||
|
||
void launch() { | ||
kernel<<<1, 1>>>(); | ||
CUDA_CHECK(cudaGetLastError()); | ||
CUDA_CHECK(cudaDeviceSynchronize()); | ||
} | ||
|
||
int main() { | ||
launch(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters