|
|
@ -8,7 +8,7 @@ from libc.stdint cimport uintptr_t |
|
|
|
|
|
|
|
|
|
|
|
from msgq.visionipc.visionipc cimport cl_mem |
|
|
|
from msgq.visionipc.visionipc cimport cl_mem |
|
|
|
from msgq.visionipc.visionipc_pyx cimport VisionBuf, CLContext as BaseCLContext |
|
|
|
from msgq.visionipc.visionipc_pyx cimport VisionBuf, CLContext as BaseCLContext |
|
|
|
from .commonmodel cimport CL_DEVICE_TYPE_DEFAULT, cl_get_device_id, cl_create_context |
|
|
|
from .commonmodel cimport CL_DEVICE_TYPE_DEFAULT, cl_get_device_id, cl_create_context, cl_release_context |
|
|
|
from .commonmodel cimport mat3, ModelFrame as cppModelFrame, DrivingModelFrame as cppDrivingModelFrame, MonitoringModelFrame as cppMonitoringModelFrame |
|
|
|
from .commonmodel cimport mat3, ModelFrame as cppModelFrame, DrivingModelFrame as cppDrivingModelFrame, MonitoringModelFrame as cppMonitoringModelFrame |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -17,6 +17,10 @@ cdef class CLContext(BaseCLContext): |
|
|
|
self.device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT) |
|
|
|
self.device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT) |
|
|
|
self.context = cl_create_context(self.device_id) |
|
|
|
self.context = cl_create_context(self.device_id) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __dealloc__(self): |
|
|
|
|
|
|
|
if self.context: |
|
|
|
|
|
|
|
cl_release_context(self.context) |
|
|
|
|
|
|
|
|
|
|
|
cdef class CLMem: |
|
|
|
cdef class CLMem: |
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
cdef create(void * cmem): |
|
|
|
cdef create(void * cmem): |
|
|
|