Skip to content

Commit 26bed7a

Browse files
author
Kolkir
committed
Fix linux build
1 parent b287431 commit 26bed7a

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

‎include/cpptask/parallelreduce.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace cpptask
3737
namespace internal
3838
{
3939
template<class ReturnType, class Range, class ProcessFunction, class JoinFunction>
40-
typename ReturnType reduceFunc(ProcessFunction&& process, JoinFunction&& join, const Range& range, size_t depth, size_t width)
40+
ReturnType reduceFunc(ProcessFunction&& process, JoinFunction&& join, const Range& range, size_t depth, size_t width)
4141
{
4242
if (depth > 0) //we can split more
4343
{

‎include/cpptask/process_lock.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace cpptask
4040
process_lock(SyncPrimitive& _guard)
4141
: guardLock(_guard, std::defer_lock)
4242
{
43-
auto f = async(std::launch::async,
43+
auto f = cpptask::async(std::launch::async,
4444
[this]()
4545
{
4646
auto& manager = TaskManager::GetCurrent();

‎tests/process_lock_test.cpp‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ namespace
1010
{
1111
std::mutex guard;
1212

13-
void processFunc(CppTaskTestData::ArrayType& arr)
14-
{
15-
auto i = arr.begin();
16-
auto e = arr.end();
17-
for (; i != e; ++i)
18-
{
19-
CppTaskTestData::DoubleSqrt()(*i);
20-
}
21-
}
2213
void processFuncLock()
2314
{
2415
std::lock_guard<std::mutex> lock(guard);
@@ -60,4 +51,4 @@ TEST_F(CppTaskTest, ProcessLock_Parallel)
6051
f1.wait();
6152

6253
ASSERT_EQ(CppTaskTestData::instance().getResultArray(), testArray2);
63-
}
54+
}

‎tests/test_data.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CppTaskTestData
99
public:
1010
typedef std::vector<double> ArrayType;
1111

12-
const size_t N = 25000000;
12+
const int N = 25000000;
1313

1414
struct DoubleSqrt
1515
{
@@ -46,7 +46,7 @@ class CppTaskTestData
4646

4747
void init()
4848
{
49-
for (size_t i = 0; i < sum; ++i)
49+
for (int i = 0; i < sum; ++i)
5050
{
5151
testArray[i] = resultArray[i] = static_cast<double>(i);
5252
DoubleSqrt()(resultArray[i]);
@@ -57,9 +57,9 @@ class CppTaskTestData
5757
private:
5858

5959
CppTaskTestData()
60-
: sum(0)
61-
, testArray(N, 0)
60+
: testArray(N, 0)
6261
, resultArray(N, 0)
62+
, sum(0)
6363
{
6464
}
6565

0 commit comments

Comments
 (0)