Package net.haesleinhuepf.clij.clearcl
Class ClearCL
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
-
- net.haesleinhuepf.clij.clearcl.ClearCL
-
- All Implemented Interfaces:
AutoCloseable
public class ClearCL extends ClearCLBase
ClearCL is the starting point for creating ClearCL objects for OpenCL. Instances of this class are constructed by providing a backend.- Author:
- royer
-
-
Constructor Summary
Constructors Constructor Description ClearCL(ClearCLBackendInterface pClearCLBackendInterface)Creates a ClearCL instance for a given ClearCL backend.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ArrayList<ClearCLDevice>getAllDevices()Returns all devices for all platforms.ClearCLDevicegetBestCPUDevice()Returns the best (right now fastest) CPU device.ClearCLDevicegetBestDevice(DeviceSelector... pDeviceSelectors)Picks the one (first) of the best devices obtained by using the given selectors.ArrayList<ClearCLDevice>getBestDevices(DeviceSelector... pDeviceSelectors)Returns a list of 'best devices' obtained by taking the list of all devices for all platforms and applying the selectors as filters.ClearCLDevicegetBestGPUDevice()Returns the best GPU device, right now its the fastest one...ClearCLDevicegetDeviceByName(String pNameSubString)Returns the first device twhich name constain sthe given substring.ClearCLDevicegetFastestGPUDeviceForBuffers()Returns the fastest GPU device available for buffer processing (OpenCL buffers).ClearCLDevicegetFastestGPUDeviceForImages()Returns the fastest GPU device available for image processing (OpenCL images).ClearCLDevicegetLargestGPUDevice()Returns the GPU device with most global memory available - hence 'largest'.intgetNumberOfPlatforms()Returns the number of available platformsClearCLPlatformgetPlatform(int pPlatformIndex)Returns a platform object for a given platform index.-
Methods inherited from class net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
getBackend, getPeerPointer, setPeerPointer, toString
-
-
-
-
Constructor Detail
-
ClearCL
public ClearCL(ClearCLBackendInterface pClearCLBackendInterface)
Creates a ClearCL instance for a given ClearCL backend.- Parameters:
pClearCLBackendInterface- backend
-
-
Method Detail
-
getNumberOfPlatforms
public int getNumberOfPlatforms()
Returns the number of available platforms- Returns:
- number of platforms
-
getPlatform
public ClearCLPlatform getPlatform(int pPlatformIndex)
Returns a platform object for a given platform index.- Parameters:
pPlatformIndex- OpenCL platform index- Returns:
- platform
-
getDeviceByName
public ClearCLDevice getDeviceByName(String pNameSubString)
Returns the first device twhich name constain sthe given substring.- Parameters:
pNameSubString- name substring- Returns:
- device
-
getFastestGPUDeviceForImages
public ClearCLDevice getFastestGPUDeviceForImages()
Returns the fastest GPU device available for image processing (OpenCL images). This method does its best to avoid crappy Intel integrated cards (except Iris which is not too shabby).- Returns:
- fastest GPU device
-
getFastestGPUDeviceForBuffers
public ClearCLDevice getFastestGPUDeviceForBuffers()
Returns the fastest GPU device available for buffer processing (OpenCL buffers).- Returns:
- fastest GPU device for buffers
-
getLargestGPUDevice
public ClearCLDevice getLargestGPUDevice()
Returns the GPU device with most global memory available - hence 'largest'.- Returns:
- fastest GPU device
-
getBestGPUDevice
public ClearCLDevice getBestGPUDevice()
Returns the best GPU device, right now its the fastest one...- Returns:
- best GPU device
-
getBestCPUDevice
public ClearCLDevice getBestCPUDevice()
Returns the best (right now fastest) CPU device.- Returns:
- fastest CPU device
-
getBestDevice
public ClearCLDevice getBestDevice(DeviceSelector... pDeviceSelectors)
Picks the one (first) of the best devices obtained by using the given selectors. Important: The selectors are applied in the order provided. For example, you want first to select GPU devices and then pick the one with the most global memory, not the other way around. The selection algorithm works as follows: for each selector, the list of devices is filtered accordingly, as soon as there is only one device left in the current list of devices, the filtering stops - even if there are more selectors to apply. Some selectors pick a single device from the list (max global mem size), others pick devices of a certain type (e.g. GPU or CPU). Example:getBestDevice(DeviceTypeSelector.GPU, BadDeviceSelector.NotIntegratedIntel, GlobalMemorySelector.MAX)- Parameters:
pDeviceSelectors- list of selectors- Returns:
- best device
-
getBestDevices
public ArrayList<ClearCLDevice> getBestDevices(DeviceSelector... pDeviceSelectors)
Returns a list of 'best devices' obtained by taking the list of all devices for all platforms and applying the selectors as filters. Important: The selectors are applied in the order provided. For example, you want first to select GPU devices and then pick the one with the most global memory, not the other way around. The selection algorithm works as follows: for each selector, the list of devices is filtered accordingly, as soon as there is only one device left in the current list of devices, the filtering stops - even if there are more selectors to apply. Some selectors pick a single device from the list (max global mem size), others pick devices of a certain type (e.g. GPU or CPU).- Parameters:
pDeviceSelectors- vararg list of device selectors- Returns:
- list of selected devices
-
getAllDevices
public ArrayList<ClearCLDevice> getAllDevices()
Returns all devices for all platforms.- Returns:
- all devices list
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classClearCLBase
-
-