Commit 57561d08 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

MRUTIL_ -> DUCC0_

parent 7579a1ea
......@@ -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>
......
......@@ -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);
......
......@@ -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);
......
#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>
......
......@@ -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>
......
......@@ -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>
{
......
......@@ -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{};
......
......@@ -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,...) \
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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());
......
......@@ -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>
......
......@@ -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>
......
......@@ -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
......
......@@ -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>
......
#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
......@@ -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 {
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment