org.jocl.utils
Class Contexts

java.lang.Object
  extended by org.jocl.utils.Contexts

public class Contexts
extends java.lang.Object

Utility methods related to cl_context objects


Method Summary
static org.jocl.cl_context create(org.jocl.cl_platform_id platform, org.jocl.cl_device_id... devices)
          Create a new context for the given platform and devices.
static org.jocl.cl_context create(org.jocl.cl_platform_id platform, java.util.List<org.jocl.cl_device_id> devices)
          Create a new context for the given platform and devices.
static org.jocl.cl_context create(org.jocl.cl_platform_id platform, java.util.List<org.jocl.cl_device_id> devices, long[] additionalContextProperties)
          Create a new context with the given platform and devices, using the given additional context properties.
static void release(org.jocl.cl_context... contexts)
          Release each of the given contexts if it is not null.
static void release(java.lang.Iterable<org.jocl.cl_context> contexts)
          Release each of the given contexts if it is not null.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static org.jocl.cl_context create(org.jocl.cl_platform_id platform,
                                         org.jocl.cl_device_id... devices)
Create a new context for the given platform and devices.

Parameters:
platform - The platform
devices - The devices
Returns:
The new context

create

public static org.jocl.cl_context create(org.jocl.cl_platform_id platform,
                                         java.util.List<org.jocl.cl_device_id> devices)
Create a new context for the given platform and devices.

Parameters:
platform - The platform
devices - The devices
Returns:
The new context

create

public static org.jocl.cl_context create(org.jocl.cl_platform_id platform,
                                         java.util.List<org.jocl.cl_device_id> devices,
                                         long[] additionalContextProperties)
Create a new context with the given platform and devices, using the given additional context properties. The additional context properties are assumed to contain pairs of long values, where even entries contain the context property name, and odd values the corresponding value. This array may be null.

Parameters:
platform - The platform
devices - The devices
additionalContextProperties - Additional context properties
Returns:
The new context

release

public static void release(org.jocl.cl_context... contexts)
Release each of the given contexts if it is not null.

Parameters:
contexts - The contexts to release

release

public static void release(java.lang.Iterable<org.jocl.cl_context> contexts)
Release each of the given contexts if it is not null.

Parameters:
contexts - The contexts to release