Skip to content

Expose create_buffer_gc in a header #680

@isuruf

Description

@isuruf

Is your feature request related to a problem? Please describe.
When using pyvkfft, vkfft calls clCreateBuffer which fails sometimes because it doesn't run the garbage collector.

Describe the solution you'd like
If we could have a header like below, we can include that in pyvkfft.

#include <CL/cl.h>

static inline pyopenclCreateBuffer(cl_context ctx,
      cl_mem_flags flags,
      size_t size,
      void *host_ptr,
      cl_int *status_code) {
    PYOPENCL_RETRY_IF_MEM_ERROR(
       clCreateBuffer(ctx, flags, size, host_ptr, status_code);
       if (*status_code != CL_SUCCESS)
           throw pyopencl::error("pyopenclCreateBuffer", *status_code);
    );
}

#define clCreateBuffer pyopenclCreateBuffer

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions