Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
16cb8b14
Commit
16cb8b14
authored
Dec 08, 2015
by
Matthieu Schaller
Browse files
Cleaned-up runner.h to avoid include problems in the standalone tests.
parent
3be87eb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
16cb8b14
...
...
@@ -51,16 +51,7 @@
#endif
#include
"runner_iact_grav.h"
/* Convert cell location to ID. */
#define cell_getid(cdim, i, j, k) \
((int)(k) + (cdim)[2] * ((int)(j) + (cdim)[1] * (int)(i)))
/* Histograms bins. */
long
long
int
runner_hist_bins
[
runner_hist_N
];
/* The counters. */
int
runner_counter
[
runner_counter_count
];
/* Orientation of the cell pairs */
const
float
runner_shift
[
13
*
3
]
=
{
5.773502691896258e-01
,
5.773502691896258e-01
,
5.773502691896258e-01
,
7.071067811865475e-01
,
7.071067811865475e-01
,
0
.
0
,
...
...
@@ -75,6 +66,8 @@ const float runner_shift[13 * 3] = {
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
,
7.071067811865475e-01
,
-
7.071067811865475e-01
,
0
.
0
,
0
.
0
,
1
.
0
,
};
/* Does the axis need flipping ? */
const
char
runner_flip
[
27
]
=
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
...
...
src/runner.h
View file @
16cb8b14
...
...
@@ -19,53 +19,12 @@
#ifndef SWIFT_RUNNER_H
#define SWIFT_RUNNER_H
/* Some standard headers. */
#include
<pthread.h>
/* Includes. */
#include
"cell.h"
#include
"inline.h"
/* Forward-declare the engine type to avoid cyclic header dependencies. */
struct
engine
;
/* Some constants/flags. */
#define runner_prefetch 0
/* SID stuff. */
extern
const
char
runner_flip
[];
/* Counters. */
enum
runner_counters
{
runner_counter_swap
=
0
,
runner_counter_stall
,
runner_counter_steal_stall
,
runner_counter_steal_empty
,
runner_counter_keep
,
runner_counter_iact
,
runner_counter_count
,
};
extern
int
runner_counter
[
runner_counter_count
];
/* Counter macros. */
#ifdef COUNTER
#define COUNT(c) (__sync_add_and_fetch(&runner_counter[c], 1))
#else
#define COUNT(c)
#endif
/* Histogram functions. */
#define runner_hist_a 1.0
#define runner_hist_b 100.0
#define runner_hist_N 99
extern
long
long
int
runner_hist_bins
[
runner_hist_N
];
#define runner_hist_hit(x) \
__sync_add_and_fetch( \
&runner_hist_bins[(int)fmax( \
0.0, fmin(runner_hist_N - 1, ((x) - runner_hist_a) / \
(runner_hist_b - runner_hist_a) * \
runner_hist_N))], \
1)
extern
const
float
runner_shift
[
13
*
3
];
extern
const
char
runner_flip
[
27
];
/* A struct representing a runner's thread and its data. */
struct
runner
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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