Devices Interface
The devices interface lets you specify where computations should run for a specific object.
ParallelKDE.Devices.AbstractDevice — Type
AbstractDeviceSupertype for all device types.
ParallelKDE.Devices.IsCPU — Type
IsCPU <: AbstractDeviceType representing a CPU device.
ParallelKDE.Devices.IsCUDA — Type
IsCUDA <: AbstractDeviceType representing a CUDA-enabled GPU device.
ParallelKDE.Devices.DeviceNotSpecified — Type
DeviceNotSpecified <: AbstractDeviceType representing a device that has not been specified or is unsupported.
Any object that is meant to run on a specific device should implement the get_device method to make use of this interface.
ParallelKDE.Devices.get_device — Method
get_device(device::Any)Obtain the device object for a given device type.
If the method is called with an unsupported type, it returns a DeviceNotSpecified object.
Additionally, a device may have one or more methods that it has available for use as well default methods when the user does not specify one. Furthermore, a Symbol may be used to identify a device type. These methods are registered in dictionaries in the Devices.jl module.
ParallelKDE.Devices.AVAILABLE_DEVICES — Constant
AVAILABLE_DEVICESRelate a Symbol to the corresponding device type.
ParallelKDE.Devices.DEVICE_IMPLEMENTATIONS — Constant
DEVICE_IMPLEMENTATIONSRelate the device types to their available implementations.
ParallelKDE.Devices.DEFAULT_IMPLEMENTATIONS — Constant
DEFAULT_IMPLEMENTATIONSRelate the device types to their default implementations.
This dictionaries can be used to query the validity of a selected method for a device.
ParallelKDE.Devices.ensure_valid_implementation — Function
ensure_valid_implementation(device::AbstractDevice, implementation::Symbol)Ensure that the specified implementation is valid for the given device.
If the implementation is not valid, an ArgumentError is thrown.
Since GPU devices may work more efficiently with single-precision numbers, the package provides a method to convert double precision numbers to single precision when possible.
ParallelKDE.Devices.convert32 — Function
convert32(x)Converts into a 32-bit representation if x is a Float64, CuArray{Float64}, or Array{Float64}.
convert32(args...; kwargs...)If multiple arguments are provided, converts each argument to a 32-bit representation if applicable, and returns a tuple of the converted arguments and a dictionary of converted keyword arguments.