Show / Hide Table of Contents

Struct half

Half (16 bits) precision floating point type

Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Hybridizer.Runtime.CUDAImports
Assembly: Hybridizer.Runtime.CUDAImports.dll
Syntax
[IntrinsicIncludeCUDA("<cuda_fp16.h>")]
[IntrinsicType("half")]
[IntrinsicPrimitive("half")]
[Guid("506315CE-E8F4-46A3-AE9F-A1A950A8FD4C")]
public struct half

Constructors

half(Single)

constructor from float32

Declaration
public half(float a)
Parameters
Type Name Description
System.Single a

Properties

IsInfinite

Returns -1 iff \p a is equal to negative infinity, 1 iff \p a is equal to positive infinity and 0 otherwise.

Declaration
public int IsInfinite { get; }
Property Value
Type Description
System.Int32

IsNan

NaN detection

Declaration
public bool IsNan
{
    [IntrinsicFunction(IsNaked = true, Name = "__hisnan")]
    get;
}
Property Value
Type Description
System.Boolean

Methods

__hadd_sat(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hadd_sat")]
public static half __hadd_sat(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half

__hequ(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hequ")]
public static bool __hequ(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hfma(half, half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hfma")]
public static half __hfma(half a, half b, half c)
Parameters
Type Name Description
half a
half b
half c
Returns
Type Description
half

__hfma_sat(half, half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hfma_sat")]
public static half __hfma_sat(half a, half b, half c)
Parameters
Type Name Description
half a
half b
half c
Returns
Type Description
half

__hgeu(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hgeu")]
public static bool __hgeu(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hgtu(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hgtu")]
public static bool __hgtu(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hleu(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hleu")]
public static bool __hleu(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hltu(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hltu")]
public static bool __hltu(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hmul_sat(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hmul_sat")]
public static half __hmul_sat(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half

__hneg(half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hneg")]
public static half __hneg(half a)
Parameters
Type Name Description
half a
Returns
Type Description
half

__hneu(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hneu")]
public static bool __hneu(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

__hsub_sat(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hsub_sat")]
public static half __hsub_sat(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half

Equals(half)

Declaration
public bool Equals(half other)
Parameters
Type Name Description
half other
Returns
Type Description
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)

float2half(Single)

mapping of intrinsic function float2half

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__float2half")]
public static half float2half(float f)
Parameters
Type Name Description
System.Single f
Returns
Type Description
half

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()

Operators

Addition(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hadd")]
public static half operator +(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half

Equality(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__heq")]
public static bool operator ==(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

GreaterThan(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hgt")]
public static bool operator>(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

GreaterThanOrEqual(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hge")]
public static bool operator >=(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

Implicit(half to Single)

conversion back to float32

Declaration
public static implicit operator float (half h)
Parameters
Type Name Description
half h
Returns
Type Description
System.Single

Implicit(half to UInt16)

conversion back to ushort

Declaration
public static implicit operator ushort (half h)
Parameters
Type Name Description
half h
Returns
Type Description
System.UInt16

Implicit(UInt16 to half)

conversion from ushort

Declaration
public static implicit operator half(ushort h)
Parameters
Type Name Description
System.UInt16 h
Returns
Type Description
half

Inequality(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hne")]
public static bool operator !=(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

LessThan(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hlt")]
public static bool operator <(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

LessThanOrEqual(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hle")]
public static bool operator <=(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
System.Boolean

Multiply(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hmul")]
public static half operator *(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half

Subtraction(half, half)

Declaration
[IntrinsicFunction(IsNaked = true, Name = "__hsub")]
public static half operator -(half a, half b)
Parameters
Type Name Description
half a
half b
Returns
Type Description
half
Back to top Generated by DocFX