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
Houman Mirzaalian Dastjerdi
waLBerla
Commits
e5a2a091
Commit
e5a2a091
authored
Jun 15, 2018
by
Christian Godenschwager
Browse files
Remove constexpr for intel 16 compatibility
parent
22293d21
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lbm/list/List.h
View file @
e5a2a091
...
...
@@ -59,13 +59,13 @@ namespace lbm {
template
<
typename
Stencil
,
typename
Index_T
=
walberla
::
uint32_t
>
struct
LayoutAoS
{
constexpr
LayoutAoS
()
=
delete
;
LayoutAoS
()
=
delete
;
constexpr
static
uint_t
alignment
()
{
return
uint_t
(
1
);
}
constexpr
static
uint_t
numFluidCellsToAllocate
(
const
uint_t
numFluidCellsRequired
)
{
return
numFluidCellsRequired
;
}
static
uint_t
alignment
()
{
return
uint_t
(
1
);
}
static
uint_t
numFluidCellsToAllocate
(
const
uint_t
numFluidCellsRequired
)
{
return
numFluidCellsRequired
;
}
constexpr
static
Index_T
getPDFIdx
(
const
uint_t
idx
,
const
uint_t
f
,
const
uint_t
/*N*/
)
{
return
numeric_cast
<
Index_T
>
(
idx
*
Stencil
::
Size
+
f
);
}
constexpr
static
Index_T
getPullIdxIdx
(
const
uint_t
idx
,
const
stencil
::
Direction
d
,
const
uint_t
/*N*/
)
static
Index_T
getPDFIdx
(
const
uint_t
idx
,
const
uint_t
f
,
const
uint_t
/*N*/
)
{
return
numeric_cast
<
Index_T
>
(
idx
*
Stencil
::
Size
+
f
);
}
static
Index_T
getPullIdxIdx
(
const
uint_t
idx
,
const
stencil
::
Direction
d
,
const
uint_t
/*N*/
)
{
WALBERLA_ASSERT_UNEQUAL
(
d
,
stencil
::
C
);
WALBERLA_ASSERT_UNEQUAL
(
Stencil
::
idx
[
d
],
stencil
::
INVALID_DIR
);
...
...
@@ -73,10 +73,10 @@ struct LayoutAoS
const
uint_t
f
=
Stencil
::
idx
[
d
]
-
Stencil
::
noCenterFirstIdx
;
return
numeric_cast
<
Index_T
>
(
idx
*
(
Stencil
::
Size
-
Stencil
::
noCenterFirstIdx
)
+
f
);
}
constexpr
static
const
real_t
*&
incPtr
(
const
real_t
*&
p
)
{
p
+=
Stencil
::
Size
;
return
p
;
}
constexpr
static
real_t
*&
incPtr
(
real_t
*&
p
)
{
p
+=
Stencil
::
Size
;
return
p
;
}
static
const
real_t
*&
incPtr
(
const
real_t
*&
p
)
{
p
+=
Stencil
::
Size
;
return
p
;
}
static
real_t
*&
incPtr
(
real_t
*&
p
)
{
p
+=
Stencil
::
Size
;
return
p
;
}
constexpr
static
Index_T
&
incIdx
(
Index_T
&
idx
)
{
idx
+=
numeric_cast
<
Index_T
>
(
Stencil
::
Size
);
return
idx
;
}
static
Index_T
&
incIdx
(
Index_T
&
idx
)
{
idx
+=
numeric_cast
<
Index_T
>
(
Stencil
::
Size
);
return
idx
;
}
};
...
...
@@ -85,10 +85,10 @@ struct LayoutSoA
{
static_assert
(
(
(
ALIGNMENT
&
(
ALIGNMENT
-
uint_t
(
1
)
)
)
==
0
)
&&
(
ALIGNMENT
>=
uint_t
(
1
)
),
"The alignment for the SoA list layout has to a power of two!"
);
constexpr
LayoutSoA
()
=
delete
;
LayoutSoA
()
=
delete
;
constexpr
static
uint_t
alignment
()
{
return
ALIGNMENT
;
}
constexpr
static
uint_t
numFluidCellsToAllocate
(
const
uint_t
numFluidCellsRequired
)
static
uint_t
alignment
()
{
return
ALIGNMENT
;
}
static
uint_t
numFluidCellsToAllocate
(
const
uint_t
numFluidCellsRequired
)
{
uint_t
alignedStepSize
=
std
::
max
(
uint_t
(
1
),
alignment
()
/
sizeof
(
real_t
)
);
if
(
(
numFluidCellsRequired
%
alignedStepSize
)
==
0
)
...
...
@@ -97,8 +97,8 @@ struct LayoutSoA
return
(
numFluidCellsRequired
/
alignedStepSize
+
uint_t
(
1
)
)
*
alignedStepSize
;
}
constexpr
static
Index_T
getPDFIdx
(
const
uint_t
idx
,
const
uint_t
f
,
const
uint_t
N
)
{
return
numeric_cast
<
Index_T
>
(
f
*
N
+
idx
);
}
constexpr
static
Index_T
getPullIdxIdx
(
const
uint_t
idx
,
const
stencil
::
Direction
d
,
const
uint_t
N
)
static
Index_T
getPDFIdx
(
const
uint_t
idx
,
const
uint_t
f
,
const
uint_t
N
)
{
return
numeric_cast
<
Index_T
>
(
f
*
N
+
idx
);
}
static
Index_T
getPullIdxIdx
(
const
uint_t
idx
,
const
stencil
::
Direction
d
,
const
uint_t
N
)
{
WALBERLA_ASSERT_UNEQUAL
(
d
,
stencil
::
C
);
WALBERLA_ASSERT_UNEQUAL
(
Stencil
::
idx
[
d
],
stencil
::
INVALID_DIR
);
...
...
@@ -106,9 +106,9 @@ struct LayoutSoA
const
uint_t
f
=
Stencil
::
idx
[
d
]
-
Stencil
::
noCenterFirstIdx
;
return
numeric_cast
<
Index_T
>
(
f
*
N
+
idx
);
}
constexpr
static
const
real_t
*&
incPtr
(
const
real_t
*&
p
)
{
++
p
;
return
p
;
}
constexpr
static
real_t
*&
incPtr
(
real_t
*&
p
)
{
++
p
;
return
p
;
}
constexpr
static
Index_T
&
incIdx
(
Index_T
&
idx
)
{
++
idx
;
return
idx
;
}
static
const
real_t
*&
incPtr
(
const
real_t
*&
p
)
{
++
p
;
return
p
;
}
static
real_t
*&
incPtr
(
real_t
*&
p
)
{
++
p
;
return
p
;
}
static
Index_T
&
incIdx
(
Index_T
&
idx
)
{
++
idx
;
return
idx
;
}
};
struct
CellToIdxOrdering
...
...
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