Skip to content

Commit

Permalink
slots for Image, SVM
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Oct 5, 2024
1 parent f97160e commit 02f6918
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/wrap_cl_part_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@



void *dummy_fn() {}
void dummy_fn() {}
PyType_Slot slots[] = {
{Py_tp_init, (void*) dummy_fn},
{ 0, nullptr }
};

namespace pyopencl {
#if PYOPENCL_CL_VERSION >= 0x1020
Expand Down Expand Up @@ -100,7 +104,7 @@ void pyopencl_expose_part_2(py::module_ &m)

{
typedef image cls;
py::class_<cls, memory_object>(m, "Image", py::dynamic_attr())
py::class_<cls, memory_object>(m, "Image", py::dynamic_attr(), py::type_slots(slots))
.def(
"__init__",
[](
Expand Down Expand Up @@ -348,7 +352,7 @@ void pyopencl_expose_part_2(py::module_ &m)

{
typedef svm_arg_wrapper cls;
py::class_<cls, svm_pointer>(m, "SVM", py::dynamic_attr())
py::class_<cls, svm_pointer>(m, "SVM", py::dynamic_attr(), py::type_slots(slots))
.def(py::init<py::object>())
;
}
Expand Down Expand Up @@ -536,11 +540,6 @@ void pyopencl_expose_part_2(py::module_ &m)

// {{{ kernel

PyType_Slot slots[] = {
{Py_tp_init, (void*) dummy_fn},
{ 0, nullptr }
};

{
typedef kernel cls;
py::class_<cls>(m, "Kernel", py::dynamic_attr(), py::type_slots(slots))
Expand Down

0 comments on commit 02f6918

Please sign in to comment.