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
pypocketfft
Commits
188984a0
Commit
188984a0
authored
May 07, 2019
by
Martin Reinecke
Browse files
be totally standards compliant if vectorization is disabled
parent
1307970b
Changes
2
Hide whitespace changes
Inline
Side-by-side
pocketfft.cc
View file @
188984a0
...
...
@@ -41,26 +41,28 @@ template<typename T> struct arr
static
T
*
ralloc
(
size_t
num
)
{
if
(
num
==
0
)
return
nullptr
;
#ifdef POCKETFFT_NO_VECTORS
void
*
res
=
malloc
(
num
*
sizeof
(
T
));
if
(
!
res
)
throw
bad_alloc
();
#else
#if 0
return (T *)aligned_alloc(64,num*sizeof(T));
void *res = aligned_alloc(64,num*sizeof(T));
if (!res) throw bad_alloc();
#else
void
*
res
(
nullptr
);
if
(
num
>
0
)
if
(
posix_memalign
(
&
res
,
64
,
num
*
sizeof
(
T
))
!=
0
)
throw
bad_alloc
();
return
reinterpret_cast
<
T
*>
(
res
);
if
(
posix_memalign
(
&
res
,
64
,
num
*
sizeof
(
T
))
!=
0
)
throw
bad_alloc
();
#endif
#endif
return
reinterpret_cast
<
T
*>
(
res
);
}
static
void
dealloc
(
T
*
ptr
)
{
free
(
ptr
);
}
public:
arr
()
:
p
(
0
),
sz
(
0
)
{}
arr
(
size_t
n
)
:
p
(
ralloc
(
n
)),
sz
(
n
)
{
if
((
!
p
)
&&
(
n
!=
0
))
throw
bad_alloc
();
}
arr
(
size_t
n
)
:
p
(
ralloc
(
n
)),
sz
(
n
)
{}
arr
(
arr
&&
other
)
:
p
(
other
.
p
),
sz
(
other
.
sz
)
{
other
.
p
=
nullptr
;
other
.
sz
=
0
;
}
...
...
@@ -2065,6 +2067,7 @@ template<size_t N, typename Ti, typename To> class multi_iter
};
#ifndef POCKETFFT_NO_VECTORS
#if (defined(__AVX512F__))
#define HAVE_VECSUPPORT
constexpr
int
VBYTELEN
=
64
;
...
...
@@ -2075,6 +2078,7 @@ constexpr int VBYTELEN=32;
#define HAVE_VECSUPPORT
constexpr
int
VBYTELEN
=
16
;
#endif
#endif
#if defined(HAVE_VECSUPPORT)
template
<
typename
T
>
struct
VTYPE
{};
...
...
setup.py
View file @
188984a0
...
...
@@ -61,7 +61,7 @@ python_module_link_args = []
base_library_link_args
=
[]
if
sys
.
platform
==
'darwin'
:
extra_cc_compile_args
.
append
(
'--std=c++1
4
'
)
extra_cc_compile_args
.
append
(
'--std=c++1
1
'
)
extra_cc_compile_args
.
append
(
'--stdlib=libc++'
)
extra_compile_args
.
append
(
'-mmacosx-version-min=10.9'
)
...
...
@@ -73,7 +73,7 @@ if sys.platform == 'darwin':
else
:
extra_compile_args
+=
[
'-march=native'
,
'-O3'
,
'-Wfatal-errors'
,
'-Wno-ignored-attributes'
]
python_module_link_args
+=
[
'-march=native'
]
extra_cc_compile_args
.
append
(
'--std=c++1
4
'
)
extra_cc_compile_args
.
append
(
'--std=c++1
1
'
)
python_module_link_args
.
append
(
"-Wl,-rpath,$ORIGIN"
)
extra_cc_compile_args
=
extra_compile_args
+
extra_cc_compile_args
...
...
Write
Preview
Supports
Markdown
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