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

Pepper CL_API_CALL in a few more places (patch by Christoph Gohlke)

parent 3610ca3e
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -9,7 +9,7 @@ class _CLObjOutArg : public OutArg { ...@@ -9,7 +9,7 @@ class _CLObjOutArg : public OutArg {
typedef typename CLObj::cl_type CLType; typedef typename CLObj::cl_type CLType;
clobj_t *const m_ret; clobj_t *const m_ret;
CLType m_clobj; CLType m_clobj;
cl_int (*m_release)(CLType); cl_int (CL_API_CALL *m_release)(CLType);
const char *m_name; const char *m_name;
std::tuple<T...> m_t1; std::tuple<T...> m_t1;
template<int... S> template<int... S>
...@@ -20,7 +20,7 @@ class _CLObjOutArg : public OutArg { ...@@ -20,7 +20,7 @@ class _CLObjOutArg : public OutArg {
} }
public: public:
PYOPENCL_INLINE PYOPENCL_INLINE
_CLObjOutArg(clobj_t *ret, cl_int (*release)(CLType), _CLObjOutArg(clobj_t *ret, cl_int (CL_API_CALL *release)(CLType),
const char *name, T... t1) noexcept const char *name, T... t1) noexcept
: m_ret(ret), m_clobj(nullptr), m_release(release), : m_ret(ret), m_clobj(nullptr), m_release(release),
m_name(name), m_t1(t1...) m_name(name), m_t1(t1...)
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
template<typename CLObj, typename... T> template<typename CLObj, typename... T>
static PYOPENCL_INLINE _CLObjOutArg<CLObj, T...> static PYOPENCL_INLINE _CLObjOutArg<CLObj, T...>
make_cloutarg(clobj_t *ret, cl_int (*release)(typename CLObj::cl_type), make_cloutarg(clobj_t *ret, cl_int (CL_API_CALL *release)(typename CLObj::cl_type),
const char *name, T... t1) const char *name, T... t1)
{ {
return _CLObjOutArg<CLObj, T...>(ret, release, name, t1...); return _CLObjOutArg<CLObj, T...>(ret, release, name, t1...);
...@@ -74,7 +74,7 @@ make_cloutarg(clobj_t *ret, cl_int (*release)(typename CLObj::cl_type), ...@@ -74,7 +74,7 @@ make_cloutarg(clobj_t *ret, cl_int (*release)(typename CLObj::cl_type),
template<typename T, typename... ArgTypes, typename... ArgTypes2> template<typename T, typename... ArgTypes, typename... ArgTypes2>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE pyopencl_buf<T> PYOPENCL_USE_RESULT static PYOPENCL_INLINE pyopencl_buf<T>
get_vec_info(cl_int (*func)(ArgTypes...), const char *name, get_vec_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,
ArgTypes2&&... args) ArgTypes2&&... args)
{ {
size_t size = 0; size_t size = 0;
...@@ -129,7 +129,7 @@ convert_opaque_array_info(T &&buf) ...@@ -129,7 +129,7 @@ convert_opaque_array_info(T &&buf)
template<typename CLObj, typename... ArgTypes, typename... ArgTypes2> template<typename CLObj, typename... ArgTypes, typename... ArgTypes2>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info
get_opaque_info(cl_int (*func)(ArgTypes...), const char *name, get_opaque_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,
ArgTypes2&&... args) ArgTypes2&&... args)
{ {
typename CLObj::cl_type param_value; typename CLObj::cl_type param_value;
...@@ -151,7 +151,7 @@ get_opaque_info(cl_int (*func)(ArgTypes...), const char *name, ...@@ -151,7 +151,7 @@ get_opaque_info(cl_int (*func)(ArgTypes...), const char *name,
template<typename... ArgTypes, typename... ArgTypes2> template<typename... ArgTypes, typename... ArgTypes2>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info
get_str_info(cl_int (*func)(ArgTypes...), const char *name, get_str_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,
ArgTypes2&&... args) ArgTypes2&&... args)
{ {
size_t size; size_t size;
...@@ -170,7 +170,7 @@ get_str_info(cl_int (*func)(ArgTypes...), const char *name, ...@@ -170,7 +170,7 @@ get_str_info(cl_int (*func)(ArgTypes...), const char *name,
template<typename T, typename... ArgTypes, typename... ArgTypes2> template<typename T, typename... ArgTypes, typename... ArgTypes2>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info
get_int_info(cl_int (*func)(ArgTypes...), const char *name, get_int_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,
const char *tpname, ArgTypes2&&... args) const char *tpname, ArgTypes2&&... args)
{ {
T value; T value;
...@@ -190,7 +190,7 @@ get_int_info(cl_int (*func)(ArgTypes...), const char *name, ...@@ -190,7 +190,7 @@ get_int_info(cl_int (*func)(ArgTypes...), const char *name,
template<typename T, typename CLType, typename... ArgTypes> template<typename T, typename CLType, typename... ArgTypes>
PYOPENCL_USE_RESULT static PYOPENCL_INLINE T* PYOPENCL_USE_RESULT static PYOPENCL_INLINE T*
convert_obj(cl_int (*clRelease)(CLType), const char *name, CLType cl_obj, convert_obj(cl_int (CL_API_CALL *clRelease)(CLType), const char *name, CLType cl_obj,
ArgTypes&&... args) ArgTypes&&... args)
{ {
try { try {
......
...@@ -45,7 +45,7 @@ create_from_gl_texture(const context *ctx, cl_mem_flags flags, ...@@ -45,7 +45,7 @@ create_from_gl_texture(const context *ctx, cl_mem_flags flags,
} }
#endif #endif
typedef cl_int (*clEnqueueGLObjectFunc)(cl_command_queue, cl_uint, typedef cl_int (CL_API_CALL *clEnqueueGLObjectFunc)(cl_command_queue, cl_uint,
const cl_mem*, cl_uint, const cl_mem*, cl_uint,
const cl_event*, cl_event*); const cl_event*, cl_event*);
......
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