Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a0418cc8
authored
Jul 22, 2020
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compiler warnings.
parent
5978c910
Pipeline
#1590
passed with stages
in 4 minutes 46 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
22 deletions
+24
-22
app/benchmark_matrix_then_fft/main.cpp
+3
-3
app/context_switch/main.cpp
+2
-0
extern/benchmark_base/include/benchmark_base/matrix.h
+9
-9
lib/pls/include/pls/algorithms/for_each_impl.h
+4
-4
lib/pls/include/pls/pls.h
+4
-4
test/scheduling_lock_free_tests.cpp
+2
-2
No files found.
app/benchmark_matrix_then_fft/main.cpp
View file @
a0418cc8
...
...
@@ -45,9 +45,9 @@ int main(int argc, char **argv) {
fft
::
complex_vector
fft_data
(
fft_size
);
fft
::
complex_vector
fft_swap_array
(
fft_size
);
fft
::
fill_input
(
fft_data
);
matrix
::
matrix
<
double
>
matrix_a
{
settings
.
size_
};
matrix
::
matrix
<
double
>
matrix_b
{
settings
.
size_
};
matrix
::
matrix
<
double
>
matrix_result
{
settings
.
size_
};
matrix
::
matrix
<
double
>
matrix_a
{
matrix_size
};
matrix
::
matrix
<
double
>
matrix_b
{
matrix_size
};
matrix
::
matrix
<
double
>
matrix_result
{
matrix_size
};
if
(
settings
.
type_
==
benchmark_runner
::
benchmark_settings
::
ISOLATED
)
{
#if PLS_PROFILING_ENABLED
...
...
app/context_switch/main.cpp
View file @
a0418cc8
...
...
@@ -27,6 +27,7 @@ void custom_stack_callback(void *);
void
__attribute__
((
noinline
))
callback
()
{
static
volatile
int
tmp
;
tmp
=
0
;
// Force at least a single memory write
(
void
)
tmp
;
}
}
...
...
@@ -35,6 +36,7 @@ long measure_loop() {
volatile
int
tmp
;
for
(
unsigned
int
i
=
0
;
i
<
NUM_RUNS
;
i
++
)
{
tmp
=
0
;
(
void
)
tmp
;
}
auto
end_time
=
chrono
::
steady_clock
::
now
();
return
chrono
::
duration_cast
<
chrono
::
nanoseconds
>
(
end_time
-
start_time
).
count
();
...
...
extern/benchmark_base/include/benchmark_base/matrix.h
View file @
a0418cc8
...
...
@@ -29,36 +29,36 @@ class matrix {
}
explicit
matrix
(
size_t
size
)
:
size_
{
size
},
data_
(
size
*
size
)
{
for
(
in
t
i
=
0
;
i
<
size_
;
i
++
)
{
for
(
in
t
j
=
0
;
j
<
size_
;
j
++
)
{
for
(
size_
t
i
=
0
;
i
<
size_
;
i
++
)
{
for
(
size_
t
j
=
0
;
j
<
size_
;
j
++
)
{
data_at
(
i
,
j
)
=
i
;
}
}
}
virtual
void
multiply
(
const
matrix
<
T
>
&
a
,
const
matrix
<
T
>
&
b
)
{
for
(
in
t
i
=
0
;
i
<
size_
;
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
size_
;
i
++
)
{
multiply_column
(
i
,
a
,
b
);
}
}
protected
:
void
multiply_column
(
int
i
,
const
matrix
<
T
>
&
a
,
const
matrix
<
T
>
&
b
)
{
for
(
in
t
j
=
0
;
j
<
size_
;
++
j
)
{
for
(
size_
t
j
=
0
;
j
<
size_
;
++
j
)
{
data_at
(
i
,
j
)
=
0
;
}
for
(
in
t
k
=
0
;
k
<
size_
;
++
k
)
{
for
(
in
t
j
=
0
;
j
<
size_
;
++
j
)
{
for
(
size_
t
k
=
0
;
k
<
size_
;
++
k
)
{
for
(
size_
t
j
=
0
;
j
<
size_
;
++
j
)
{
data_at
(
i
,
j
)
+=
a
.
data_at
(
i
,
k
)
*
b
.
data_at
(
i
,
k
);
}
}
}
};
template
<
typename
T
,
int
SIZE
>
template
<
typename
T
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
strm
,
const
matrix
<
T
>
&
matrix
)
{
for
(
int
i
=
0
;
i
<
SIZE
;
i
++
)
{
for
(
int
j
=
0
;
j
<
SIZE
;
j
++
)
{
for
(
size_t
i
=
0
;
i
<
matrix
.
size_
;
i
++
)
{
for
(
size_t
j
=
0
;
j
<
matrix
.
size_
;
j
++
)
{
strm
<<
matrix
.
data_at
(
i
,
j
)
<<
"
\t
"
;
}
strm
<<
std
::
endl
;
...
...
lib/pls/include/pls/algorithms/for_each_impl.h
View file @
a0418cc8
...
...
@@ -13,10 +13,10 @@ template<typename RandomIt, typename Function>
static
void
for_each_iterator
(
const
RandomIt
first
,
const
RandomIt
last
,
const
Function
&
function
,
const
size_t
min_elements
)
{
const
long
min_elements
)
{
using
namespace
::
pls
::
internal
::
scheduling
;
const
long
num_elements
=
std
::
distance
(
first
,
last
);
const
auto
num_elements
=
std
::
distance
(
first
,
last
);
if
(
num_elements
<=
min_elements
)
{
// calculate last elements in loop to avoid overhead
for
(
auto
current
=
first
;
current
!=
last
;
current
++
)
{
...
...
@@ -45,10 +45,10 @@ template<typename Function>
static
void
for_each_range
(
const
long
first
,
const
long
last
,
const
Function
&
function
,
const
size_t
min_elements
)
{
const
long
min_elements
)
{
using
namespace
::
pls
::
internal
::
scheduling
;
const
long
num_elements
=
last
-
first
;
const
auto
num_elements
=
last
-
first
;
if
(
num_elements
<=
min_elements
)
{
// calculate last elements in loop to avoid overhead
for
(
auto
current
=
first
;
current
!=
last
;
current
++
)
{
...
...
lib/pls/include/pls/pls.h
View file @
a0418cc8
...
...
@@ -22,18 +22,18 @@ using internal::scheduling::scheduler;
using
internal
::
base
::
heap_stack_allocator
;
using
internal
::
base
::
mmap_stack_allocator
;
template
<
typename
Function
>
static
void
spawn
(
Function
&&
function
)
{
inline
void
spawn
(
Function
&&
function
)
{
scheduler
::
spawn
(
std
::
forward
<
Function
>
(
function
));
}
template
<
typename
Function
>
static
void
spawn_and_sync
(
Function
&&
function
)
{
inline
void
spawn_and_sync
(
Function
&&
function
)
{
scheduler
::
spawn_and_sync
(
std
::
forward
<
Function
>
(
function
));
}
static
void
sync
()
{
inline
void
sync
()
{
scheduler
::
sync
();
}
template
<
typename
Function
>
static
void
serial
(
Function
&&
function
)
{
inline
void
serial
(
Function
&&
function
)
{
scheduler
::
serial
(
std
::
forward
<
Function
>
(
function
));
}
...
...
test/scheduling_lock_free_tests.cpp
View file @
a0418cc8
...
...
@@ -100,9 +100,9 @@ TEST_CASE("external trading deque", "[internal/scheduling/lock_free/external_tra
scheduler
.
task_manager_for
(
1
).
get_task
(
3
)};
auto
&
thread_state_1
=
scheduler
.
thread_state_for
(
0
);
auto
&
task_manager_1
=
scheduler
.
thread_state_for
(
0
)
.
get_task_manager
();
auto
&
task_manager_1
=
thread_state_1
.
get_task_manager
();
auto
&
thread_state_2
=
scheduler
.
thread_state_for
(
1
);
auto
&
task_manager_2
=
scheduler
.
thread_state_for
(
1
)
.
get_task_manager
();
auto
&
task_manager_2
=
thread_state_2
.
get_task_manager
();
SECTION
(
"Must start empty"
)
{
REQUIRE
(
!
task_manager_1
.
pop_local_task
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment