Commit 87d0a28d authored by Martin Reinecke's avatar Martin Reinecke
Browse files

template tweaks

parent 2aa3f9c7
Pipeline #69745 passed with stages
in 8 minutes and 53 seconds
...@@ -19,12 +19,12 @@ python_module_link_args = [] ...@@ -19,12 +19,12 @@ python_module_link_args = []
if sys.platform == 'darwin': if sys.platform == 'darwin':
import distutils.sysconfig import distutils.sysconfig
extra_compile_args += ['--std=c++14', '--stdlib=libc++', '-mmacosx-version-min=10.9'] extra_compile_args += ['--std=c++17', '--stdlib=libc++', '-mmacosx-version-min=10.9']
vars = distutils.sysconfig.get_config_vars() vars = distutils.sysconfig.get_config_vars()
vars['LDSHARED'] = vars['LDSHARED'].replace('-bundle', '') vars['LDSHARED'] = vars['LDSHARED'].replace('-bundle', '')
python_module_link_args+=['-bundle'] python_module_link_args+=['-bundle']
else: else:
extra_compile_args += ['--std=c++14', '-march=native', '-O3', '-ffast-math'] extra_compile_args += ['--std=c++17', '-march=native', '-O3', '-ffast-math']
python_module_link_args += ['-march=native', '-Wl,-rpath,$ORIGIN', '-ffast-math'] python_module_link_args += ['-march=native', '-Wl,-rpath,$ORIGIN', '-ffast-math']
# if you don't want debugging info, add "-s" to python_module_link_args # if you don't want debugging info, add "-s" to python_module_link_args
......
...@@ -270,7 +270,7 @@ template<typename T, size_t ndim> class mav: public mav_info<ndim>, public membu ...@@ -270,7 +270,7 @@ template<typename T, size_t ndim> class mav: public mav_info<ndim>, public membu
T *d2 = vdata(); T *d2 = vdata();
if (contiguous()) if (contiguous())
{ {
for (auto &v: {d2, d2+size()}) for (auto v=d2; v!=d2+size(); ++v)
func(*v); func(*v);
return; return;
} }
......
...@@ -52,17 +52,17 @@ namespace mr { ...@@ -52,17 +52,17 @@ namespace mr {
namespace detail_simd { namespace detail_simd {
template<typename T> constexpr static const bool vectorizable = false; template<typename T> constexpr inline bool vectorizable = false;
template<> constexpr bool vectorizable<float> = true; template<> constexpr inline bool vectorizable<float> = true;
template<> constexpr bool vectorizable<double> = true; template<> constexpr inline bool vectorizable<double> = true;
template<> constexpr bool vectorizable<int8_t> = true; template<> constexpr inline bool vectorizable<int8_t> = true;
template<> constexpr bool vectorizable<uint8_t> = true; template<> constexpr inline bool vectorizable<uint8_t> = true;
template<> constexpr bool vectorizable<int16_t> = true; template<> constexpr inline bool vectorizable<int16_t> = true;
template<> constexpr bool vectorizable<uint16_t> = true; template<> constexpr inline bool vectorizable<uint16_t> = true;
template<> constexpr bool vectorizable<int32_t> = true; template<> constexpr inline bool vectorizable<int32_t> = true;
template<> constexpr bool vectorizable<uint32_t> = true; template<> constexpr inline bool vectorizable<uint32_t> = true;
template<> constexpr bool vectorizable<int64_t> = true; template<> constexpr inline bool vectorizable<int64_t> = true;
template<> constexpr bool vectorizable<uint64_t> = true; template<> constexpr inline bool vectorizable<uint64_t> = true;
template<typename T, size_t reglen> constexpr size_t vlen template<typename T, size_t reglen> constexpr size_t vlen
= vectorizable<T> ? reglen/sizeof(T) : 1; = vectorizable<T> ? reglen/sizeof(T) : 1;
......
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