- java.lang.Object
-
- com.ibm.gpu.Maths
-
public class Maths extends Object
This class is used to perform sorting operations of primitive arrays of type int, long, float, double on any connected CUDA GPU. A successful sort operation results in the array being sorted in ascending order.
-
-
Constructor Summary
Constructors Constructor Description Maths()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidsortArray(double[] array)Sort the given array of doubles into ascending order, using the default CUDA device.static voidsortArray(double[] array, int fromIndex, int toIndex)Sort the specified range of the array of doubles into ascending order, using the default CUDA device.static voidsortArray(float[] array)Sort the given array of floats into ascending order, using the default CUDA device.static voidsortArray(float[] array, int fromIndex, int toIndex)Sort the specified range of the array of floats into ascending order, using the default CUDA device.static voidsortArray(int[] array)Sort the given array of integers into ascending order, using the default CUDA device.static voidsortArray(int[] array, int fromIndex, int toIndex)Sort the specified range of the array of integers into ascending order, using the default CUDA device.static voidsortArray(int deviceId, double[] array)Sort the given array of doubles into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, double[] array, int fromIndex, int toIndex)Sort the specified range of the array of doubles into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, float[] array)Sort the given array of floats into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, float[] array, int fromIndex, int toIndex)Sort the specified range of the array of floats into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, int[] array)Sort the given array of integers into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, int[] array, int fromIndex, int toIndex)Sort the specified range of the array of integers into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, long[] array)Sort the given array of longs into ascending order, using the specified CUDA device.static voidsortArray(int deviceId, long[] array, int fromIndex, int toIndex)Sort the specified range of the array of longs into ascending order, using the specified CUDA device.static voidsortArray(long[] array)Sort the given array of longs into ascending order, using the default CUDA device.static voidsortArray(long[] array, int fromIndex, int toIndex)Sort the specified range of the array of longs into ascending order, using the default CUDA device.
-
-
-
Method Detail
-
sortArray
public static void sortArray(double[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of doubles into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(double[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of doubles into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(float[] array) throws GPUSortException, GPUConfigurationExceptionSort the given array of floats into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(float[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of floats into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, double[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of doubles into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, double[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of doubles into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, float[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of floats into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, float[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of floats into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, int[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of integers into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, int[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of integers into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, long[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of longs into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int deviceId, long[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of longs into ascending order, using the specified CUDA device.- Parameters:
deviceId- the CUDA device to be usedarray- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of integers into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(int[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of integers into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(long[] array) throws GPUConfigurationException, GPUSortExceptionSort the given array of longs into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sorted- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
sortArray
public static void sortArray(long[] array, int fromIndex, int toIndex) throws GPUConfigurationException, GPUSortExceptionSort the specified range of the array of longs into ascending order, using the default CUDA device.- Parameters:
array- the array that will be sortedfromIndex- the range starting index (inclusive)toIndex- the range ending index (exclusive)- Throws:
GPUConfigurationException- if an issue has occurred with the CUDA environmentGPUSortException- if any of the following happens:- the device is not available
- insufficient device memory is available
- an error occurs transferring the data to or from the device
- a device execution error occurs
-
-