2019-08-19 19:27:18 +02:00
|
|
|
#
|
|
|
|
# Copyright 2019 The Abseil Authors.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2019-08-16 16:38:13 +02:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|
|
|
|
2019-06-21 22:11:42 +02:00
|
|
|
# Internal-only implementation classes for Abseil Random
|
|
|
|
load(
|
|
|
|
"//absl:copts/configure_copts.bzl",
|
|
|
|
"ABSL_DEFAULT_COPTS",
|
|
|
|
"ABSL_DEFAULT_LINKOPTS",
|
|
|
|
"ABSL_RANDOM_RANDEN_COPTS",
|
|
|
|
"ABSL_TEST_COPTS",
|
|
|
|
"absl_random_randen_copts_init",
|
|
|
|
)
|
|
|
|
|
2019-06-25 03:35:20 +02:00
|
|
|
package(default_visibility = [
|
|
|
|
"//absl/random:__pkg__",
|
|
|
|
])
|
2019-06-21 22:11:42 +02:00
|
|
|
|
|
|
|
licenses(["notice"]) # Apache 2.0
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "traits",
|
|
|
|
hdrs = ["traits.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
visibility = [
|
|
|
|
"//absl/random:__pkg__",
|
|
|
|
],
|
|
|
|
deps = ["//absl/base:config"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "distribution_caller",
|
|
|
|
hdrs = ["distribution_caller.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
visibility = [
|
|
|
|
"//absl/random:__pkg__",
|
|
|
|
],
|
2019-12-12 19:36:03 +01:00
|
|
|
deps = ["//absl/base:config"],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "distributions",
|
2019-08-30 21:03:24 +02:00
|
|
|
hdrs = ["distributions.h"],
|
2019-06-21 22:11:42 +02:00
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":distribution_caller",
|
|
|
|
":traits",
|
|
|
|
":uniform_helper",
|
2019-09-09 17:20:10 +02:00
|
|
|
"//absl/base",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "fast_uniform_bits",
|
|
|
|
hdrs = [
|
|
|
|
"fast_uniform_bits.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
visibility = [
|
|
|
|
"//absl/random:__pkg__",
|
|
|
|
],
|
2019-12-12 19:36:03 +01:00
|
|
|
deps = ["//absl/base:config"],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "seed_material",
|
|
|
|
srcs = [
|
|
|
|
"seed_material.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"seed_material.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
2019-11-13 17:54:32 +01:00
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS + select({
|
|
|
|
"//absl:windows": ["-DEFAULTLIB:bcrypt.lib"],
|
|
|
|
"//conditions:default": [],
|
|
|
|
}),
|
2019-06-21 22:11:42 +02:00
|
|
|
deps = [
|
|
|
|
":fast_uniform_bits",
|
|
|
|
"//absl/base:core_headers",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings",
|
|
|
|
"//absl/types:optional",
|
|
|
|
"//absl/types:span",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "pool_urbg",
|
|
|
|
srcs = [
|
|
|
|
"pool_urbg.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"pool_urbg.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = select({
|
|
|
|
"//absl:windows": [],
|
|
|
|
"//conditions:default": ["-pthread"],
|
|
|
|
}) + ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":randen",
|
|
|
|
":seed_material",
|
|
|
|
":traits",
|
|
|
|
"//absl/base",
|
|
|
|
"//absl/base:config",
|
|
|
|
"//absl/base:core_headers",
|
|
|
|
"//absl/base:endian",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/random:seed_gen_exception",
|
|
|
|
"//absl/types:span",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "explicit_seed_seq",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = [
|
|
|
|
"explicit_seed_seq.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
2019-12-12 19:36:03 +01:00
|
|
|
deps = ["//absl/base:config"],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "sequence_urbg",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = [
|
|
|
|
"sequence_urbg.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
2019-12-12 19:36:03 +01:00
|
|
|
deps = ["//absl/base:config"],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "salted_seed_seq",
|
|
|
|
hdrs = [
|
|
|
|
"salted_seed_seq.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":seed_material",
|
|
|
|
"//absl/container:inlined_vector",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/types:optional",
|
|
|
|
"//absl/types:span",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "iostream_state_saver",
|
|
|
|
hdrs = ["iostream_state_saver.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/numeric:int128",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
name = "generate_real",
|
2019-06-21 22:11:42 +02:00
|
|
|
hdrs = [
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
"generate_real.h",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":fastmath",
|
|
|
|
":traits",
|
|
|
|
"//absl/base:bits",
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
"//absl/meta:type_traits",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "fastmath",
|
|
|
|
hdrs = [
|
|
|
|
"fastmath.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = ["//absl/base:bits"],
|
|
|
|
)
|
|
|
|
|
2019-10-17 00:51:11 +02:00
|
|
|
cc_library(
|
|
|
|
name = "wide_multiply",
|
|
|
|
hdrs = ["wide_multiply.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":traits",
|
|
|
|
"//absl/base:bits",
|
|
|
|
"//absl/base:config",
|
|
|
|
"//absl/numeric:int128",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-06-21 22:11:42 +02:00
|
|
|
cc_library(
|
|
|
|
name = "nonsecure_base",
|
|
|
|
hdrs = ["nonsecure_base.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":pool_urbg",
|
|
|
|
":salted_seed_seq",
|
|
|
|
":seed_material",
|
|
|
|
"//absl/base:core_headers",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/strings",
|
|
|
|
"//absl/types:optional",
|
|
|
|
"//absl/types:span",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "pcg_engine",
|
|
|
|
hdrs = ["pcg_engine.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":fastmath",
|
|
|
|
":iostream_state_saver",
|
|
|
|
"//absl/base:config",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/numeric:int128",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "randen_engine",
|
|
|
|
hdrs = ["randen_engine.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":iostream_state_saver",
|
|
|
|
":randen",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "platform",
|
|
|
|
hdrs = [
|
|
|
|
"randen_traits.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
textual_hdrs = [
|
|
|
|
"randen-keys.inc",
|
|
|
|
"platform.h",
|
|
|
|
],
|
2019-12-12 19:36:03 +01:00
|
|
|
deps = ["//absl/base:config"],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "randen",
|
|
|
|
srcs = [
|
|
|
|
"randen.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"randen.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":platform",
|
|
|
|
":randen_hwaes",
|
|
|
|
":randen_slow",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "randen_slow",
|
|
|
|
srcs = ["randen_slow.cc"],
|
|
|
|
hdrs = ["randen_slow.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":platform",
|
2019-12-12 19:36:03 +01:00
|
|
|
"//absl/base:config",
|
2019-12-02 19:41:53 +01:00
|
|
|
"//absl/base:core_headers",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
absl_random_randen_copts_init()
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "randen_hwaes",
|
|
|
|
srcs = [
|
|
|
|
"randen_detect.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"randen_detect.h",
|
|
|
|
"randen_hwaes.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":platform",
|
|
|
|
":randen_hwaes_impl",
|
2019-12-12 19:36:03 +01:00
|
|
|
"//absl/base:config",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# build with --save_temps to see assembly language output.
|
|
|
|
cc_library(
|
|
|
|
name = "randen_hwaes_impl",
|
|
|
|
srcs = [
|
|
|
|
"randen_hwaes.cc",
|
|
|
|
"randen_hwaes.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS + ABSL_RANDOM_RANDEN_COPTS + select({
|
|
|
|
"//absl:windows": [],
|
|
|
|
"//conditions:default": ["-Wno-pass-failed"],
|
|
|
|
}),
|
|
|
|
# copts in RANDEN_HWAES_COPTS can make this target unusable as a module
|
|
|
|
# leading to a Clang diagnostic. Furthermore, it only has a private header
|
|
|
|
# anyway and thus there wouldn't be any gain from using it as a module.
|
|
|
|
features = ["-header_modules"],
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
2019-08-15 19:06:39 +02:00
|
|
|
deps = [
|
|
|
|
":platform",
|
2019-12-12 19:36:03 +01:00
|
|
|
"//absl/base:config",
|
2019-08-15 19:06:39 +02:00
|
|
|
"//absl/base:core_headers",
|
|
|
|
],
|
2019-06-21 22:11:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "gaussian_distribution_gentables",
|
|
|
|
srcs = [
|
|
|
|
"gaussian_distribution_gentables.cc",
|
|
|
|
],
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
"//absl/base:core_headers",
|
|
|
|
"//absl/random:distributions",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "distribution_test_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = [
|
|
|
|
"chi_square.cc",
|
|
|
|
"distribution_test_util.cc",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"chi_square.h",
|
|
|
|
"distribution_test_util.h",
|
|
|
|
],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
2019-12-12 19:36:03 +01:00
|
|
|
"//absl/base:config",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/base:core_headers",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings",
|
|
|
|
"//absl/strings:str_format",
|
|
|
|
"//absl/types:span",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Common tags for tests, etc.
|
|
|
|
ABSL_RANDOM_NONPORTABLE_TAGS = [
|
|
|
|
"no_test_android_arm",
|
|
|
|
"no_test_android_arm64",
|
|
|
|
"no_test_android_x86",
|
|
|
|
"no_test_darwin_x86_64",
|
|
|
|
"no_test_ios_x86_64",
|
|
|
|
"no_test_loonix",
|
|
|
|
"no_test_msvc_x64",
|
|
|
|
"no_test_wasm",
|
|
|
|
]
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "traits_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["traits_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":traits",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
name = "generate_real_test",
|
2019-06-21 22:11:42 +02:00
|
|
|
size = "small",
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
srcs = [
|
|
|
|
"generate_real_test.cc",
|
|
|
|
],
|
2019-06-21 22:11:42 +02:00
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
":generate_real",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/base:bits",
|
|
|
|
"//absl/flags:flag",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "distribution_test_util_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["distribution_test_util_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":distribution_test_util",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "fastmath_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["fastmath_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":fastmath",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "explicit_seed_seq_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["explicit_seed_seq_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":explicit_seed_seq",
|
|
|
|
"//absl/random:seed_sequences",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "salted_seed_seq_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["salted_seed_seq_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":salted_seed_seq",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "chi_square_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = [
|
|
|
|
"chi_square_test.cc",
|
|
|
|
],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":distribution_test_util",
|
|
|
|
"//absl/base:core_headers",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "fast_uniform_bits_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = [
|
|
|
|
"fast_uniform_bits_test.cc",
|
|
|
|
],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":fast_uniform_bits",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-11-20 22:55:25 +01:00
|
|
|
cc_library(
|
|
|
|
name = "mocking_bit_gen_base",
|
|
|
|
hdrs = ["mocking_bit_gen_base.h"],
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
"//absl/random",
|
2020-01-07 15:56:49 +01:00
|
|
|
"//absl/strings",
|
2019-11-20 22:55:25 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "mock_overload_set",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["mock_overload_set.h"],
|
|
|
|
visibility = [
|
|
|
|
"//absl/random:__pkg__",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"//absl/random:mocking_bit_gen",
|
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-06-21 22:11:42 +02:00
|
|
|
cc_test(
|
|
|
|
name = "nonsecure_base_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = [
|
|
|
|
"nonsecure_base_test.cc",
|
|
|
|
],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":nonsecure_base",
|
|
|
|
"//absl/random",
|
|
|
|
"//absl/random:distributions",
|
|
|
|
"//absl/random:seed_sequences",
|
|
|
|
"//absl/strings",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "seed_material_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["seed_material_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":seed_material",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "pool_urbg_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = [
|
|
|
|
"pool_urbg_test.cc",
|
|
|
|
],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":pool_urbg",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"//absl/types:span",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "pcg_engine_test",
|
|
|
|
size = "medium", # Trying to measure accuracy.
|
|
|
|
srcs = ["pcg_engine_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
flaky = 1,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":explicit_seed_seq",
|
|
|
|
":pcg_engine",
|
|
|
|
"//absl/time",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "randen_engine_test",
|
2019-07-02 21:50:48 +02:00
|
|
|
size = "medium",
|
2019-06-21 22:11:42 +02:00
|
|
|
srcs = [
|
|
|
|
"randen_engine_test.cc",
|
|
|
|
],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":explicit_seed_seq",
|
|
|
|
":randen_engine",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings",
|
|
|
|
"//absl/time",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "randen_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["randen_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":randen",
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "randen_slow_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["randen_slow_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":randen_slow",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "randen_hwaes_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["randen_hwaes_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
tags = ABSL_RANDOM_NONPORTABLE_TAGS,
|
|
|
|
deps = [
|
|
|
|
":platform",
|
|
|
|
":randen_hwaes",
|
|
|
|
":randen_hwaes_impl", # build_cleaner: keep
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings:str_format",
|
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-10-17 00:51:11 +02:00
|
|
|
cc_test(
|
|
|
|
name = "wide_multiply_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["wide_multiply_test.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":wide_multiply",
|
|
|
|
"//absl/base:bits",
|
|
|
|
"//absl/numeric:int128",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-06-21 22:11:42 +02:00
|
|
|
cc_library(
|
|
|
|
name = "nanobenchmark",
|
|
|
|
srcs = ["nanobenchmark.cc"],
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
textual_hdrs = ["nanobenchmark.h"],
|
|
|
|
deps = [
|
|
|
|
":platform",
|
|
|
|
":randen_engine",
|
2019-12-02 19:41:53 +01:00
|
|
|
"//absl/base:core_headers",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "uniform_helper",
|
|
|
|
hdrs = ["uniform_helper.h"],
|
|
|
|
copts = ABSL_DEFAULT_COPTS,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
"//absl/meta:type_traits",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "nanobenchmark_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["nanobenchmark_test.cc"],
|
|
|
|
flaky = 1,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
tags = [
|
|
|
|
"benchmark",
|
|
|
|
"no_test_ios_x86_64",
|
|
|
|
"no_test_loonix", # Crashing.
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":nanobenchmark",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "randen_benchmarks",
|
|
|
|
size = "medium",
|
2020-03-03 20:22:10 +01:00
|
|
|
timeout = "long",
|
2019-06-21 22:11:42 +02:00
|
|
|
srcs = ["randen_benchmarks.cc"],
|
|
|
|
copts = ABSL_TEST_COPTS + ABSL_RANDOM_RANDEN_COPTS,
|
|
|
|
flaky = 1,
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
tags = ABSL_RANDOM_NONPORTABLE_TAGS + ["benchmark"],
|
|
|
|
deps = [
|
|
|
|
":nanobenchmark",
|
|
|
|
":platform",
|
|
|
|
":randen",
|
|
|
|
":randen_engine",
|
|
|
|
":randen_hwaes",
|
|
|
|
":randen_hwaes_impl",
|
|
|
|
":randen_slow",
|
2019-08-13 19:20:16 +02:00
|
|
|
"//absl/base:raw_logging_internal",
|
2019-06-21 22:11:42 +02:00
|
|
|
"//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "iostream_state_saver_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["iostream_state_saver_test.cc"],
|
|
|
|
linkopts = ABSL_DEFAULT_LINKOPTS,
|
|
|
|
deps = [
|
|
|
|
":iostream_state_saver",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|