pub trait RetainRelease: ClObject {
// Required methods
unsafe fn retain(&self);
unsafe fn release(&mut self);
}Required Methods§
Sourceunsafe fn retain(&self)
unsafe fn retain(&self)
Retains (increments the reference count of) the ClObject.
§Safety
Balancing the release and retain reference count of a ClObject must be done with care. Improper usage of release and retain can lead to undefined behavior.
Usage of an invalid ClObject is undefined behavior.
Sourceunsafe fn release(&mut self)
unsafe fn release(&mut self)
Releases (decrements reference count of) the ClObject
§Safety
Balancing the release and retain reference count of a ClObject must be done with care. Improper usage of release and retain can lead to undefined behavior.
Usage of an invalid ClObject is undefined behavior.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl RetainRelease for cl_command_queue
impl RetainRelease for cl_command_queue
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_context
impl RetainRelease for cl_context
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_device_id
impl RetainRelease for cl_device_id
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_event
impl RetainRelease for cl_event
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_kernel
impl RetainRelease for cl_kernel
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_mem
impl RetainRelease for cl_mem
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.
Source§impl RetainRelease for cl_platform_id
impl RetainRelease for cl_platform_id
Source§impl RetainRelease for cl_program
impl RetainRelease for cl_program
Source§unsafe fn retain(&self)
unsafe fn retain(&self)
This function is used to increase the atomic reference count of the associated OpenCL ARC object. This function should only be used when the OpenCL interface returns a ARC object that is not reference counted by OpenCL (yes, OpenCL let’s you do that…)
§Safety
This function atomically decrements the OpenCL reference count. Mismanagement of an object’s OpenCL ARC can lead to undefined behavior.