Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
ducc
Commits
57561d08
Commit
57561d08
authored
Jun 10, 2020
by
Martin Reinecke
Browse files
MRUTIL_ -> DUCC0_
parent
7579a1ea
Changes
37
Hide whitespace changes
Inline
Side-by-side
python/alm.h
View file @
57561d08
...
...
@@ -5,8 +5,8 @@
* \author Martin Reinecke
*/
#ifndef
MRUTIL
_ALM_H
#define
MRUTIL
_ALM_H
#ifndef
DUCC0
_ALM_H
#define
DUCC0
_ALM_H
#if 1
#include <complex>
...
...
python/gridder_cxx.h
View file @
57561d08
...
...
@@ -536,7 +536,7 @@ template<typename T, typename T2=complex<T>> class Helper
public:
const
T2
*
p0r
;
T2
*
p0w
;
T
kernel
[
64
]
MRUTIL
_ALIGNED
(
64
);
T
kernel
[
64
]
DUCC0
_ALIGNED
(
64
);
static
constexpr
size_t
vlen
=
native_simd
<
T
>::
size
();
Helper
(
const
GridderConfig
&
gconf_
,
const
T2
*
grid_r_
,
T2
*
grid_w_
,
...
...
@@ -681,15 +681,15 @@ template<typename T, typename Serv> void x2grid_c
{
Helper
<
T
>
hlp
(
gconf
,
nullptr
,
grid
.
vdata
(),
locks
,
w0
,
dw
);
int
jump
=
hlp
.
lineJump
();
const
T
*
MRUTIL
_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
MRUTIL
_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
const
T
*
DUCC0
_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
DUCC0
_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
{
UVW
coord
=
srv
.
getCoord
(
ipart
);
auto
flip
=
coord
.
FixW
();
hlp
.
prep
(
coord
);
auto
*
MRUTIL
_RESTRICT
ptr
=
hlp
.
p0w
;
auto
*
DUCC0
_RESTRICT
ptr
=
hlp
.
p0w
;
auto
v
(
srv
.
getVis
(
ipart
));
if
(
do_w_gridding
)
v
*=
hlp
.
Wfac
();
if
(
flip
)
v
=
conj
(
v
);
...
...
@@ -729,8 +729,8 @@ template<typename T, typename Serv> void grid2x_c
{
Helper
<
T
>
hlp
(
gconf
,
grid
.
data
(),
nullptr
,
locks
,
w0
,
dw
);
int
jump
=
hlp
.
lineJump
();
const
T
*
MRUTIL
_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
MRUTIL
_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
const
T
*
DUCC0
_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
DUCC0
_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
{
...
...
@@ -738,7 +738,7 @@ template<typename T, typename Serv> void grid2x_c
auto
flip
=
coord
.
FixW
();
hlp
.
prep
(
coord
);
complex
<
T
>
r
=
0
;
const
auto
*
MRUTIL
_RESTRICT
ptr
=
hlp
.
p0r
;
const
auto
*
DUCC0
_RESTRICT
ptr
=
hlp
.
p0r
;
for
(
size_t
cu
=
0
;
cu
<
supp
;
++
cu
)
{
complex
<
T
>
tmp
(
0
);
...
...
python/totalconvolve.h
View file @
57561d08
...
...
@@ -3,8 +3,8 @@
* Author: Martin Reinecke
*/
#ifndef
MRUTIL
_INTERPOL_NG_H
#define
MRUTIL
_INTERPOL_NG_H
#ifndef
DUCC0
_INTERPOL_NG_H
#define
DUCC0
_INTERPOL_NG_H
#define SIMD_INTERPOL
#define SPECIAL_CASING
...
...
@@ -39,7 +39,7 @@ template<typename T, typename T0> aligned_array<T> alloc_tmp_conv
}
template
<
typename
Tplan
,
typename
T
,
typename
T0
,
typename
Exec
>
MRUTIL
_NOINLINE
void
general_convolve
(
const
fmav
<
T
>
&
in
,
fmav
<
T
>
&
out
,
DUCC0
_NOINLINE
void
general_convolve
(
const
fmav
<
T
>
&
in
,
fmav
<
T
>
&
out
,
const
size_t
axis
,
const
vector
<
T0
>
&
kernel
,
size_t
nthreads
,
const
Exec
&
exec
)
{
...
...
@@ -57,7 +57,7 @@ MRUTIL_NOINLINE void general_convolve(const fmav<T> &in, fmav<T> &out,
constexpr
auto
vlen
=
native_simd
<
T0
>::
size
();
auto
storage
=
alloc_tmp_conv
<
T
,
T0
>
(
in
,
axis
,
l_max
);
multi_iter
<
vlen
>
it
(
in
,
out
,
axis
,
sched
.
num_threads
(),
sched
.
thread_num
());
#ifndef
MRUTIL
_NO_SIMD
#ifndef
DUCC0
_NO_SIMD
if
(
vlen
>
1
)
while
(
it
.
remaining
()
>=
vlen
)
{
...
...
@@ -355,8 +355,8 @@ template<typename T> class Interpolator
}
#ifdef SIMD_INTERPOL
template
<
size_t
nv
,
size_t
nc
>
void
interpol_help0
(
const
T
*
MRUTIL
_RESTRICT
wt
,
const
T
*
MRUTIL
_RESTRICT
wp
,
const
native_simd
<
T
>
*
MRUTIL
_RESTRICT
p
,
size_t
d0
,
size_t
d1
,
const
native_simd
<
T
>
*
MRUTIL
_RESTRICT
psiarr2
,
mav
<
T
,
2
>
&
res
,
size_t
idx
)
const
template
<
size_t
nv
,
size_t
nc
>
void
interpol_help0
(
const
T
*
DUCC0
_RESTRICT
wt
,
const
T
*
DUCC0
_RESTRICT
wp
,
const
native_simd
<
T
>
*
DUCC0
_RESTRICT
p
,
size_t
d0
,
size_t
d1
,
const
native_simd
<
T
>
*
DUCC0
_RESTRICT
psiarr2
,
mav
<
T
,
2
>
&
res
,
size_t
idx
)
const
{
array
<
native_simd
<
T
>
,
nc
>
vv
;
for
(
auto
&
vvv
:
vv
)
vvv
=
0
;
...
...
@@ -378,8 +378,8 @@ template<typename T> class Interpolator
for
(
size_t
c
=
0
;
c
<
nc
;
++
c
)
res
.
v
(
idx
,
c
)
=
reduce
(
vv
[
c
],
std
::
plus
<>
());
}
template
<
size_t
nv
,
size_t
nc
>
void
deinterpol_help0
(
const
T
*
MRUTIL
_RESTRICT
wt
,
const
T
*
MRUTIL
_RESTRICT
wp
,
native_simd
<
T
>
*
MRUTIL
_RESTRICT
p
,
size_t
d0
,
size_t
d1
,
const
native_simd
<
T
>
*
MRUTIL
_RESTRICT
psiarr2
,
const
mav
<
T
,
2
>
&
data
,
size_t
idx
)
const
template
<
size_t
nv
,
size_t
nc
>
void
deinterpol_help0
(
const
T
*
DUCC0
_RESTRICT
wt
,
const
T
*
DUCC0
_RESTRICT
wp
,
native_simd
<
T
>
*
DUCC0
_RESTRICT
p
,
size_t
d0
,
size_t
d1
,
const
native_simd
<
T
>
*
DUCC0
_RESTRICT
psiarr2
,
const
mav
<
T
,
2
>
&
data
,
size_t
idx
)
const
{
array
<
native_simd
<
T
>
,
nc
>
vv
;
for
(
size_t
i
=
0
;
i
<
nc
;
++
i
)
vv
[
i
]
=
data
(
idx
,
i
);
...
...
src/mr_util/bindings/pybind_utils.h
View file @
57561d08
#ifndef
MRUTIL
_PYBIND_UTILS_H
#define
MRUTIL
_PYBIND_UTILS_H
#ifndef
DUCC0
_PYBIND_UTILS_H
#define
DUCC0
_PYBIND_UTILS_H
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
...
...
src/mr_util/infra/aligned_array.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_ALIGNED_ARRAY_H
#define
MRUTIL
_ALIGNED_ARRAY_H
#ifndef
DUCC0
_ALIGNED_ARRAY_H
#define
DUCC0
_ALIGNED_ARRAY_H
#include <cstdlib>
#include <memory>
...
...
src/mr_util/infra/communication.cc
View file @
57561d08
...
...
@@ -14,7 +14,7 @@ using namespace std;
void
assert_unequal
(
const
void
*
a
,
const
void
*
b
)
{
MR_assert
(
a
!=
b
,
"input and output buffers must not be identical"
);
}
#ifdef
MRUTIL
_USE_MPI
#ifdef
DUCC0
_USE_MPI
class
Typemap
:
public
TypeMapper
<
MPI_Datatype
>
{
...
...
src/mr_util/infra/communication.h
View file @
57561d08
...
...
@@ -21,13 +21,13 @@
* \author Martin Reinecke
*/
#ifndef
MRUTIL
_COMMUNICATION_H
#define
MRUTIL
_COMMUNICATION_H
#ifndef
DUCC0
_COMMUNICATION_H
#define
DUCC0
_COMMUNICATION_H
#define
MRUTIL
_USE_MPI
#define
DUCC0
_USE_MPI
#include <vector>
#ifdef
MRUTIL
_USE_MPI
#ifdef
DUCC0
_USE_MPI
#include <mpi.h>
#endif
...
...
@@ -52,7 +52,7 @@ class Communicator
{
public:
enum
redOp
{
Sum
,
Min
,
Max
,
Prod
};
#ifdef
MRUTIL
_USE_MPI
#ifdef
DUCC0
_USE_MPI
using
CommType
=
MPI_Comm
;
#else
using
CommType
=
struct
{};
...
...
src/mr_util/infra/error_handling.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_ERROR_HANDLING_H
#define
MRUTIL
_ERROR_HANDLING_H
#ifndef
DUCC0
_ERROR_HANDLING_H
#define
DUCC0
_ERROR_HANDLING_H
#include <sstream>
#include <exception>
...
...
@@ -32,9 +32,9 @@ namespace mr {
namespace
detail_error_handling
{
#if defined (__GNUC__)
#define
MRUTIL
_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__, __PRETTY_FUNCTION__)
#define
DUCC0
_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__, __PRETTY_FUNCTION__)
#else
#define
MRUTIL
_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__)
#define
DUCC0
_ERROR_HANDLING_LOC_ ::mr::detail_error_handling::CodeLocation(__FILE__, __LINE__)
#endif
// to be replaced with std::source_location once generally available
...
...
@@ -78,7 +78,7 @@ void streamDump__(::std::ostream &os, const T& value,
}
#endif
template
<
typename
...
Args
>
[[
noreturn
]]
void
MRUTIL
_NOINLINE
fail__
(
Args
&&
...
args
)
[[
noreturn
]]
void
DUCC0
_NOINLINE
fail__
(
Args
&&
...
args
)
{
::
std
::
ostringstream
msg
;
\
::
mr
::
detail_error_handling
::
streamDump__
(
msg
,
args
...);
\
...
...
@@ -87,7 +87,7 @@ template<typename ...Args>
#define MR_fail(...) \
do { \
::mr::detail_error_handling::fail__(
MRUTIL
_ERROR_HANDLING_LOC_, "\n", ##__VA_ARGS__, "\n"); \
::mr::detail_error_handling::fail__(
DUCC0
_ERROR_HANDLING_LOC_, "\n", ##__VA_ARGS__, "\n"); \
} while(0)
#define MR_assert(cond,...) \
...
...
src/mr_util/infra/mav.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_MAV_H
#define
MRUTIL
_MAV_H
#ifndef
DUCC0
_MAV_H
#define
DUCC0
_MAV_H
#include <cstdlib>
#include <array>
...
...
src/mr_util/infra/simd.h
View file @
57561d08
...
...
@@ -19,24 +19,24 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_SIMD_H
#define
MRUTIL
_SIMD_H
#ifndef
DUCC0
_SIMD_H
#define
DUCC0
_SIMD_H
// only enable SIMD support for gcc>=5.0 and clang>=5.0
#ifndef
MRUTIL
_NO_SIMD
#define
MRUTIL
_NO_SIMD
#ifndef
DUCC0
_NO_SIMD
#define
DUCC0
_NO_SIMD
#if defined(__clang__)
// AppleClang has their own version numbering
#ifdef __apple_build_version__
# if (__clang_major__ > 9) || (__clang_major__ == 9 && __clang_minor__ >= 1)
# undef
MRUTIL
_NO_SIMD
# undef
DUCC0
_NO_SIMD
# endif
#elif __clang_major__ >= 5
# undef
MRUTIL
_NO_SIMD
# undef
DUCC0
_NO_SIMD
#endif
#elif defined(__GNUC__)
#if __GNUC__>=5
#undef
MRUTIL
_NO_SIMD
#undef
DUCC0
_NO_SIMD
#endif
#endif
#endif
...
...
@@ -44,7 +44,7 @@
#include <cstdlib>
#include <cmath>
#include <algorithm>
#ifndef
MRUTIL
_NO_SIMD
#ifndef
DUCC0
_NO_SIMD
#include <x86intrin.h>
#endif
...
...
@@ -251,7 +251,7 @@ template<typename T> class helper_<T,1>
static
size_t
maskbits
(
Tm
v
)
{
return
v
;
}
};
#ifndef
MRUTIL
_NO_SIMD
#ifndef
DUCC0
_NO_SIMD
#if defined(__AVX512F__)
template
<
>
class
helper_
<
double
,
8
>
...
...
src/mr_util/infra/string_utils.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_STRING_UTILS_H
#define
MRUTIL
_STRING_UTILS_H
#ifndef
DUCC0
_STRING_UTILS_H
#define
DUCC0
_STRING_UTILS_H
#include <vector>
#include <map>
...
...
src/mr_util/infra/system.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_SYSTEM_H
#define
MRUTIL
_SYSTEM_H
#ifndef
DUCC0
_SYSTEM_H
#define
DUCC0
_SYSTEM_H
#include <string>
#include <cstdlib>
...
...
src/mr_util/infra/threading.cc
View file @
57561d08
...
...
@@ -21,7 +21,7 @@
#include "mr_util/infra/threading.h"
#ifndef
MRUTIL
_NO_THREADING
#ifndef
DUCC0
_NO_THREADING
#include <cstdlib>
#include <mutex>
#include <condition_variable>
...
...
@@ -38,7 +38,7 @@ namespace mr {
namespace
detail_threading
{
#ifndef
MRUTIL
_NO_THREADING
#ifndef
DUCC0
_NO_THREADING
static
const
size_t
max_threads_
=
std
::
max
<
size_t
>
(
1
,
std
::
thread
::
hardware_concurrency
());
...
...
src/mr_util/infra/threading.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Peter Bell, Max-Planck-Society
Authors: Peter Bell, Martin Reinecke */
#ifndef
MRUTIL
_THREADING_H
#define
MRUTIL
_THREADING_H
#ifndef
DUCC0
_THREADING_H
#define
DUCC0
_THREADING_H
#include <functional>
...
...
src/mr_util/infra/timers.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Authors: Peter Bell, Martin Reinecke */
#ifndef
MRUTIL
_TIMERS_H
#define
MRUTIL
_TIMERS_H
#ifndef
DUCC0
_TIMERS_H
#define
DUCC0
_TIMERS_H
#include <chrono>
#include <string>
...
...
src/mr_util/infra/transpose.h
View file @
57561d08
...
...
@@ -95,8 +95,8 @@ bool critical(ptrdiff_t s)
return
(
s
>
4096
)
&&
((
s
&
(
s
-
1
))
==
0
);
}
template
<
typename
T
,
typename
Func
>
void
sthelper2
(
const
T
*
MRUTIL
_RESTRICT
in
,
T
*
MRUTIL
_RESTRICT
out
,
size_t
s0
,
size_t
s1
,
ptrdiff_t
sti0
,
ptrdiff_t
sti1
,
template
<
typename
T
,
typename
Func
>
void
sthelper2
(
const
T
*
DUCC0
_RESTRICT
in
,
T
*
DUCC0
_RESTRICT
out
,
size_t
s0
,
size_t
s1
,
ptrdiff_t
sti0
,
ptrdiff_t
sti1
,
ptrdiff_t
sto0
,
ptrdiff_t
sto1
,
Func
func
)
{
if
((
sti0
<=
sti1
)
&&
(
sto0
<=
sto1
))
// no need to block
...
...
src/mr_util/infra/types.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_TYPES_H
#define
MRUTIL
_TYPES_H
#ifndef
DUCC0
_TYPES_H
#define
DUCC0
_TYPES_H
#include <typeinfo>
#include <typeindex>
...
...
src/mr_util/infra/useful_macros.h
View file @
57561d08
#ifndef
MRUTIL
_USEFUL_MACROS_H
#define
MRUTIL
_USEFUL_MACROS_H
#ifndef
DUCC0
_USEFUL_MACROS_H
#define
DUCC0
_USEFUL_MACROS_H
#if defined(__GNUC__)
#define
MRUTIL
_NOINLINE __attribute__((noinline))
#define
MRUTIL
_RESTRICT __restrict__
#define
MRUTIL
_ALIGNED(align) __attribute__ ((aligned(align)))
#define
MRUTIL
_PREFETCH_R(addr) __builtin_prefetch(addr);
#define
MRUTIL
_PREFETCH_W(addr) __builtin_prefetch(addr,1);
#define
DUCC0
_NOINLINE __attribute__((noinline))
#define
DUCC0
_RESTRICT __restrict__
#define
DUCC0
_ALIGNED(align) __attribute__ ((aligned(align)))
#define
DUCC0
_PREFETCH_R(addr) __builtin_prefetch(addr);
#define
DUCC0
_PREFETCH_W(addr) __builtin_prefetch(addr,1);
#elif defined(_MSC_VER)
#define
MRUTIL
_NOINLINE __declspec(noinline)
#define
MRUTIL
_RESTRICT __restrict
#define
MRUTIL
_ALIGNED(align)
#define
MRUTIL
_PREFETCH_R(addr)
#define
MRUTIL
_PREFETCH_W(addr)
#define
DUCC0
_NOINLINE __declspec(noinline)
#define
DUCC0
_RESTRICT __restrict
#define
DUCC0
_ALIGNED(align)
#define
DUCC0
_PREFETCH_R(addr)
#define
DUCC0
_PREFETCH_W(addr)
#else
#define
MRUTIL
_NOINLINE
#define
MRUTIL
_RESTRICT
#define
MRUTIL
_ALIGNED(align)
#define
MRUTIL
_PREFETCH_R(addr)
#define
MRUTIL
_PREFETCH_W(addr)
#define
DUCC0
_NOINLINE
#define
DUCC0
_RESTRICT
#define
DUCC0
_ALIGNED(align)
#define
DUCC0
_PREFETCH_R(addr)
#define
DUCC0
_PREFETCH_W(addr)
#endif
#endif
src/mr_util/math/cmplx.h
View file @
57561d08
...
...
@@ -19,8 +19,8 @@
/* Copyright (C) 2019-2020 Max-Planck-Society
Author: Martin Reinecke */
#ifndef
MRUTIL
_CMPLX_H
#define
MRUTIL
_CMPLX_H
#ifndef
DUCC0
_CMPLX_H
#define
DUCC0
_CMPLX_H
namespace
mr
{
...
...
src/mr_util/math/constants.h
View file @
57561d08
...
...
@@ -26,8 +26,8 @@
* Mathematical, physical and technical constants.
*/
#ifndef
MRUTIL
_CONSTANTS_H
#define
MRUTIL
_CONSTANTS_H
#ifndef
DUCC0
_CONSTANTS_H
#define
DUCC0
_CONSTANTS_H
namespace
mr
{
...
...
Prev
1
2
Next
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