Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data DeviceType (deviceId :: Type) where
- CPU :: forall deviceId. DeviceType deviceId
- CUDA :: forall deviceId. deviceId -> DeviceType deviceId
- data SDeviceType (deviceType :: DeviceType Nat) where
- SCPU :: SDeviceType 'CPU
- SCUDA :: forall deviceId. KnownNat deviceId => SDeviceType ('CUDA deviceId)
- type family CUDAF (deviceType :: DeviceType Nat) :: Nat where ...
- class KnownDeviceType (deviceType :: DeviceType Nat) where
- data Device (deviceType :: Type) where
- UncheckedDevice :: forall deviceType. Device deviceType
- Device :: forall deviceType. deviceType -> Device deviceType
- data SDevice (deviceType :: Device (DeviceType Nat)) where
- SUncheckedDevice :: DeviceType Int16 -> SDevice 'UncheckedDevice
- SDevice :: forall deviceType. SDeviceType deviceType -> SDevice ('Device deviceType)
- class KnownDevice (device :: Device (DeviceType Nat)) where
- deviceVal :: Device (DeviceType Int16)
- type family GetDevices f where ...
Documentation
data DeviceType (deviceId :: Type) where Source #
Data type to represent compute devices.
CPU :: forall deviceId. DeviceType deviceId | The tensor is stored in the CPU's memory. |
CUDA :: forall deviceId. deviceId -> DeviceType deviceId | The tensor is stored the memory of the GPU with ID |
Instances
data SDeviceType (deviceType :: DeviceType Nat) where Source #
SCPU :: SDeviceType 'CPU | |
SCUDA :: forall deviceId. KnownNat deviceId => SDeviceType ('CUDA deviceId) |
Instances
Show (SDeviceType deviceType) Source # | |
Defined in Torch.GraduallyTyped.Device |
class KnownDeviceType (deviceType :: DeviceType Nat) where Source #
Instances
KnownDeviceType ('CPU :: DeviceType Nat) Source # | |
Defined in Torch.GraduallyTyped.Device | |
KnownNat deviceId => KnownDeviceType ('CUDA deviceId) Source # | |
Defined in Torch.GraduallyTyped.Device |
data Device (deviceType :: Type) where Source #
Data type to represent whether or not the compute device is checked, that is, known to the compiler.
UncheckedDevice :: forall deviceType. Device deviceType | The compute device is unknown to the compiler. |
Device :: forall deviceType. deviceType -> Device deviceType | The compute device is known to the compiler. |
Instances
Show deviceType => Show (Device deviceType) Source # | |
SingKind (Device (DeviceType Nat)) Source # | |
Defined in Torch.GraduallyTyped.Device | |
SingI deviceType => SingI ('Device deviceType :: Device (DeviceType Nat)) Source # | |
type Demote (Device (DeviceType Nat)) Source # | |
Defined in Torch.GraduallyTyped.Device | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Device |
data SDevice (deviceType :: Device (DeviceType Nat)) where Source #
SUncheckedDevice :: DeviceType Int16 -> SDevice 'UncheckedDevice | |
SDevice :: forall deviceType. SDeviceType deviceType -> SDevice ('Device deviceType) |
class KnownDevice (device :: Device (DeviceType Nat)) where Source #
Instances
KnownDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # | |
Defined in Torch.GraduallyTyped.Device | |
KnownDeviceType deviceType => KnownDevice ('Device deviceType) Source # | |
Defined in Torch.GraduallyTyped.Device |
type family GetDevices f where ... Source #
GetDevices (a :: Device (DeviceType Nat)) = '[a] | |
GetDevices (f g) = Concat (GetDevices f) (GetDevices g) | |
GetDevices _ = '[] |