forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsleef.bzl
More file actions
22 lines (18 loc) · 652 Bytes
/
sleef.bzl
File metadata and controls
22 lines (18 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
load("@rules_cc//cc:defs.bzl", "cc_library")
# This macro provides for generating both "sleef<foo>" and
# "sleefdet<foo>" libraries for a given set of code. The difference is
# that the "det" libraries get compiled with "-DDETERMINISTIC=1".
def sleef_cc_library(name, copts, **kwargs):
cc_library(
name = name,
copts = copts,
**kwargs
)
prefix = "sleef"
if not name.startswith(prefix):
fail("name {} does not start with {}".format(repr(name), repr(prefix)))
cc_library(
name = name.replace(prefix, prefix + "det", 1),
copts = copts + ["-DDETERMINISTIC=1"],
**kwargs
)