Skip to content
Snippets Groups Projects
Commit d19d94cf authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Use correct CL API calling convention for function pointers (reported by Christoph Gohlke)

parent 7a9da07c
No related branches found
No related tags found
No related merge requests found
...@@ -227,7 +227,7 @@ make_clargpack(Types&&... args) ...@@ -227,7 +227,7 @@ make_clargpack(Types&&... args)
template<typename... ArgTypes2, typename... ArgTypes> template<typename... ArgTypes2, typename... ArgTypes>
static PYOPENCL_INLINE void static PYOPENCL_INLINE void
call_guarded(cl_int (*func)(ArgTypes...), const char *name, ArgTypes2&&... args) call_guarded(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name, ArgTypes2&&... args)
{ {
auto argpack = make_clargpack(std::forward<ArgTypes2>(args)...); auto argpack = make_clargpack(std::forward<ArgTypes2>(args)...);
cl_int status_code = argpack.clcall(func, name); cl_int status_code = argpack.clcall(func, name);
...@@ -239,7 +239,7 @@ call_guarded(cl_int (*func)(ArgTypes...), const char *name, ArgTypes2&&... args) ...@@ -239,7 +239,7 @@ call_guarded(cl_int (*func)(ArgTypes...), const char *name, ArgTypes2&&... args)
template<typename T, typename... ArgTypes, typename... ArgTypes2> template<typename T, typename... ArgTypes, typename... ArgTypes2>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE T PYOPENCL_USE_RESULT static PYOPENCL_INLINE T
call_guarded(T (*func)(ArgTypes...), const char *name, ArgTypes2&&... args) call_guarded(T (CL_API_CALL *func)(ArgTypes...), const char *name, ArgTypes2&&... args)
{ {
cl_int status_code = CL_SUCCESS; cl_int status_code = CL_SUCCESS;
auto status_arg = buf_arg(status_code); auto status_arg = buf_arg(status_code);
...@@ -264,7 +264,7 @@ cleanup_print_error(cl_int status_code, const char *name) noexcept ...@@ -264,7 +264,7 @@ cleanup_print_error(cl_int status_code, const char *name) noexcept
template<typename... ArgTypes, typename... ArgTypes2> template<typename... ArgTypes, typename... ArgTypes2>
static PYOPENCL_INLINE void static PYOPENCL_INLINE void
call_guarded_cleanup(cl_int (*func)(ArgTypes...), const char *name, call_guarded_cleanup(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,
ArgTypes2&&... args) ArgTypes2&&... args)
{ {
auto argpack = make_clargpack(std::forward<ArgTypes2>(args)...); auto argpack = make_clargpack(std::forward<ArgTypes2>(args)...);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment