org.jocl.utils
Class Mems

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

public class Mems
extends java.lang.Object

Utility methods related to memory objects.


Method Summary
static org.jocl.cl_mem create(org.jocl.cl_context context, byte[] array)
          Create a memory object that contains the data from the given array
static org.jocl.cl_mem create(org.jocl.cl_context context, double[] array)
          Create a memory object that contains the data from the given array
static org.jocl.cl_mem create(org.jocl.cl_context context, float[] array)
          Create a memory object that contains the data from the given array
static org.jocl.cl_mem create(org.jocl.cl_context context, int size)
          Create a memory object with the given size.
static org.jocl.cl_mem create(org.jocl.cl_context context, int[] array)
          Create a memory object that contains the data from the given array
static org.jocl.cl_mem create(org.jocl.cl_context context, long[] array)
          Create a memory object that contains the data from the given array
static org.jocl.cl_mem create(org.jocl.cl_context context, short[] array)
          Create a memory object that contains the data from the given array
static void release(org.jocl.cl_mem... mems)
          Release each of the given memory objects if it is not null.
static void release(java.lang.Iterable<org.jocl.cl_mem> mems)
          Release each of the given memory objects 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_mem create(org.jocl.cl_context context,
                                     int size)
Create a memory object with the given size.

Parameters:
context - The context for which the memory object will be created
size - The size of the memory object, in bytes
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     byte[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     short[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     int[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     long[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     float[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

create

public static org.jocl.cl_mem create(org.jocl.cl_context context,
                                     double[] array)
Create a memory object that contains the data from the given array

Parameters:
context - The context for which the memory object will be created
array - The array
Returns:
The memory object

release

public static void release(org.jocl.cl_mem... mems)
Release each of the given memory objects if it is not null.

Parameters:
mems - The memory objects to release

release

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

Parameters:
mems - The memory objects to release