mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36011 Differential Revision: D20873430 Pulled By: malfet fbshipit-source-id: 8ffffd10ca0ff8bdab578a70a9b2b777aed985d0
23 lines
652 B
Python
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
|
|
)
|