public class ALTERALiveObjectTracking
extends java.lang.Object
This extension specifies an API for debugging OpenCL API object leaks in user applications. It provides a mechanism for tracking all live API objects, and for enumerating them on demand.
The OpenCL runtime API generates and uses many kinds of objects such as contexts, programs, kernels, memory objects, command queues, and events.
It is very easy for an application to lose track of what objects it has created but not yet fully released. Forgetting to fully release an object after use may result in undesirable behaviour, such as increased memory use or even command scheduler lockup. This problem gets much worse when new objects leak each time through an application loop.
This extension defines two runtime API methods.
The first method specifies a future interest in enumerating all the live objects in the runtime API. Live object tracking is a debugging feature which may increase memory use and runtime of the application. So it should be explicitly requested.
Ideally, the request to begin tracking live objects should occur as early as possible in the program, so that no leaked objects escape undetected.
The second method requests an enumeration of those objects via a callback mechanism.
| Modifier and Type | Method and Description |
|---|---|
static void |
clReportLiveObjectsAltera(long platform,
CLReportLiveObjectsAlteraCallbackI report_fn,
long user_data)
Requests an enumeration of all live objects in the runtime.
|
static void |
clTrackLiveObjectsAltera(long platform)
Registers a future interest in enumerating all the live objects in the runtime API.
|
static void |
nclReportLiveObjectsAltera(long platform,
long report_fn,
long user_data)
Unsafe version of:
ReportLiveObjectsAltera |
public static void clTrackLiveObjectsAltera(long platform)
Behaviour is unspecified if the clTrackLiveObjectsAltera method is called before the the first call to GetPlatformIDs.
platform - the platform IDpublic static void nclReportLiveObjectsAltera(long platform,
long report_fn,
long user_data)
ReportLiveObjectsAlterapublic static void clReportLiveObjectsAltera(long platform,
CLReportLiveObjectsAlteraCallbackI report_fn,
long user_data)
platform - the platform for which live objects are being trackedreport_fn - the callback functionuser_data - a pointer to user data that will be passed to report_fnCopyright LWJGL. All Rights Reserved. License terms.