Skip to content
Snippets Groups Projects
kernel.h 1.12 KiB
Newer Older
  • Learn to ignore specific revisions
  • #include "error.h"
    
    #ifndef __PYOPENCL_KERNEL_H
    #define __PYOPENCL_KERNEL_H
    
    namespace pyopencl {
    
    class device;
    
    // {{{ kernel
    
    
    Yichao Yu's avatar
    Yichao Yu committed
    extern template class clobj<cl_kernel>;
    
    extern template void print_arg<cl_kernel>(std::ostream&,
                                              const cl_kernel&, bool);
    extern template void print_buf<cl_kernel>(std::ostream&, const cl_kernel*,
                                              size_t, ArgType, bool, bool);
    
    class kernel : public clobj<cl_kernel> {
    public:
        PYOPENCL_DEF_CL_CLASS(KERNEL);
        PYOPENCL_INLINE
        kernel(cl_kernel knl, bool retain)
            : clobj(knl)
        {
            if (retain) {
                pyopencl_call_guarded(clRetainKernel, this);
            }
        }
        ~kernel();
        generic_info get_info(cl_uint param) const;
    
        PYOPENCL_USE_RESULT generic_info
        get_work_group_info(cl_kernel_work_group_info param,
                            const device *dev) const;
    
    
    Yichao Yu's avatar
    Yichao Yu committed
    #if PYOPENCL_CL_VERSION >= 0x1020
        PYOPENCL_USE_RESULT generic_info
        get_arg_info(cl_uint idx, cl_kernel_arg_info param) const;
    #endif
    
    extern template void print_clobj<kernel>(std::ostream&, const kernel*);