Files
pytorch/third_party/sleef.bzl
George Gensure 447bcd341d Bazel build of pytorch with gating CI (#36011)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36011

Differential Revision: D20873430

Pulled By: malfet

fbshipit-source-id: 8ffffd10ca0ff8bdab578a70a9b2b777aed985d0
2020-04-06 22:50:33 -07:00

23 lines
652 B
Python

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
)