#include <vector>
#include <glog/logging.h>
#include <folly/Memory.h>
#include <folly/gen/Base.h>
#include <folly/gen/ParallelMap.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
TEST |
( |
Pmap |
, |
|
|
InfiniteEquivalent |
|
|
) |
| |
Definition at line 29 of file ParallelMapTest.cpp.
References folly::gen::as(), EXPECT_EQ, folly::gen::map(), folly::gen::pmap(), folly::gen::seq(), folly::gen::until(), and x.
35 |
map([](
int x) {
return x *
x; })
36 |
until([](
int x) {
return x > 1000 * 1000; })
37 |
as<std::vector<int>>();
41 |
pmap([](
int x) {
return x *
x; }, 4)
42 |
until([](
int x) {
return x > 1000 * 1000; })
43 |
as<std::vector<int>>();
54 |
map([](
int x) {
return x *
x; })
55 |
as<std::vector<int>>();
59 |
pmap([](
int x) {
return x *
x; }, 4)
60 |
as<std::vector<int>>();
#define EXPECT_EQ(val1, val2)
Gen seq(Value first, Value last)
Until until(Predicate pred=Predicate())
PMap pmap(Predicate pred=Predicate(), size_t nThreads=0)
Definition at line 67 of file ParallelMapTest.cpp.
References folly::gen::as(), EXPECT_EQ, folly::gen::map(), folly::gen::pmap(), folly::gen::seq(), folly::gen::until(), and x.
73 |
map([](
int x) {
return x *
x; })
74 |
until([](
int) {
return true; })
75 |
as<std::vector<int>>();
79 |
pmap([](
int x) {
return x *
x; }, 4)
80 |
until([](
int) {
return true; })
81 |
as<std::vector<int>>();
93 |
map([](
int x) {
return x *
x; })
94 |
as<std::vector<int>>();
98 |
pmap([](
int x) {
return x *
x; }, 4)
99 |
as<std::vector<int>>();
#define EXPECT_EQ(val1, val2)
Gen seq(Value first, Value last)
Until until(Predicate pred=Predicate())
PMap pmap(Predicate pred=Predicate(), size_t nThreads=0)
Definition at line 107 of file ParallelMapTest.cpp.
References EXPECT_EQ, folly::gen::map(), folly::gen::pmap(), folly::gen::seq(), folly::gen::sum, folly::gen::take(), and x.
113 |
map([](
int x) {
return std::make_unique<int>(
x); })
114 |
map([](std::unique_ptr<int> x) {
115 return std::make_unique<int>(*x * *
x); })
116 |
map([](std::unique_ptr<int> x) {
return *
x; })
122 |
pmap([](
int x) {
return std::make_unique<int>(
x); })
123 |
pmap([](std::unique_ptr<int> x) {
124 return std::make_unique<int>(*x * *
x); })
125 |
pmap([](std::unique_ptr<int> x) {
return *
x; })
138 |
map([](
int x) {
return std::make_unique<int>(
x); })
139 |
map([](std::unique_ptr<int> x) {
140 return std::make_unique<int>(*x * *
x); })
141 |
map([](std::unique_ptr<int> x) {
return *
x; })
146 |
pmap([](
int x) {
return std::make_unique<int>(
x); })
147 |
pmap([](std::unique_ptr<int> x) {
148 return std::make_unique<int>(*x * *
x); })
149 |
pmap([](std::unique_ptr<int> x) {
return *
x; })
std::atomic< int64_t > sum(0)
#define EXPECT_EQ(val1, val2)
Gen seq(Value first, Value last)
detail::Take take(Number count)
PMap pmap(Predicate pred=Predicate(), size_t nThreads=0)