Top Description Fields Constructors Methods
com.jogamp.opencl.util

public Class CLMultiContext

extends Object
implements CLResource
Class Inheritance
All Implemented Interfaces
com.jogamp.opencl.CLResource
Imports
com.jogamp.opencl.CLContext, .CLDevice, .CLPlatform, .CLResource, java.util.ArrayList, .Collection, .Collections, .HashMap, .List, .Map

Utility for organizing multiple CLContexts.
Author
Michael Bien

Field Summary

Modifier and TypeField and Description
private final List<CLContext>
private boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CLMultiContext
create(final CLPlatform... platforms)

Creates a multi context with all devices of the specified platforms.

public static CLMultiContext
create(final CLPlatform[] platforms, final CLDevice.Type... types)

Creates a multi context with all devices of the specified platforms and types.

public static CLMultiContext
create(final CLPlatform[] platforms, final Filter<CLDevice>... filters)

Creates a multi context with all matching devices of the specified platforms.

public static CLMultiContext
create(final Collection<CLDevice> devices)

Creates a multi context with the specified devices.

private static Map<CLPlatform, List<CLDevice>>
filterPlatformConflicts(final Collection<CLDevice> devices)

filter devices; don't allow the same device to be used in more than one platform.

public List<CLContext>
public List<CLDevice>
getDevices()

Returns a list containing all devices used in this multi context.

public boolean
isReleased()

Implements com.jogamp.opencl.CLResource.isReleased.

Returns true if release() has been called.
public void
release()

Implements com.jogamp.opencl.CLResource.release.

Releases all contexts.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static CLMultiContext
wrap(final CLContext... contexts)

Creates a multi context with specified contexts.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contextsback to summary
private final List<CLContext> contexts
releasedback to summary
private boolean released

Constructor Detail

CLMultiContextback to summary
private CLMultiContext()

Method Detail

createback to summary
public static CLMultiContext create(final CLPlatform... platforms)

Creates a multi context with all devices of the specified platforms.

createback to summary
public static CLMultiContext create(final CLPlatform[] platforms, final CLDevice.Type... types)

Creates a multi context with all devices of the specified platforms and types.

Annotations
@SuppressWarnings:unchecked
createback to summary
public static CLMultiContext create(final CLPlatform[] platforms, final Filter<CLDevice>... filters)

Creates a multi context with all matching devices of the specified platforms.

Annotations
@SuppressWarnings:unchecked
createback to summary
public static CLMultiContext create(final Collection<CLDevice> devices)

Creates a multi context with the specified devices. The devices don't have to be from the same platform.

filterPlatformConflictsback to summary
private static Map<CLPlatform, List<CLDevice>> filterPlatformConflicts(final Collection<CLDevice> devices)

filter devices; don't allow the same device to be used in more than one platform. example: a CPU available via the AMD and Intel SDKs shouldn't end up in two contexts

getContextsback to summary
public List<CLContext> getContexts()
getDevicesback to summary
public List<CLDevice> getDevices()

Returns a list containing all devices used in this multi context.

isReleasedback to summary
public boolean isReleased()

Implements com.jogamp.opencl.CLResource.isReleased.

Doc from com.jogamp.opencl.CLResource.isReleased.

Returns true if release() has been called.

releaseback to summary
public void release()

Implements com.jogamp.opencl.CLResource.release.

Releases all contexts.

Annotations
@Override
See Also
CLContext#release()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
wrapback to summary
public static CLMultiContext wrap(final CLContext... contexts)

Creates a multi context with specified contexts.