Show / Hide Table of Contents

Struct half2

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("half2")]
[IntrinsicPrimitive("half2")]
[Guid("FB1994C2-5E2A-4748-B745-C09CD7AD9C06")]
public struct half2

Constructors

half2(float2)

Declaration
public half2(float2 a)
Parameters
Type Name Description
float2 a

half2(half)

Declaration
public half2(half a)
Parameters
Type Name Description
half a

half2(half, half)

Declaration
public half2(half a, half b)
Parameters
Type Name Description
half a
half b

half2(Single)

Declaration
public half2(float f)
Parameters
Type Name Description
System.Single f

half2(Single, Single)

Declaration
public half2(float a, float b)
Parameters
Type Name Description
System.Single a
System.Single b

Properties

hi

Declaration
public half hi { get; set; }
Property Value
Type Description
half

hi_float

Declaration
public float hi_float { get; }
Property Value
Type Description
System.Single

lo

Declaration
public half lo { get; set; }
Property Value
Type Description
half

lo_float

Declaration
public float lo_float { get; }
Property Value
Type Description
System.Single

Methods

__hadd2_sat(half2, half2)

Performs \p half2 vector add of inputs \p a and \p b, in round-to-nearest mode, and clamps the results to range [0.0, 1.0]. NaN results are flushed to +0.0.

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

__hbequ2(half2, half2)

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

__hbgeu2(half2, half2)

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

__hbgtu2(half2, half2)

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

__hbleu2(half2, half2)

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

__hbltu2(half2, half2)

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

__hbneu2(half2, half2)

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

__heq2(half2, half2)

Performs \p half2 vector if-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hequ2(half2, half2)

Performs \p half2 vector if-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__hfma2(half2, half2, half2)

Performs \p half2 vector multiply on inputs \p a and \p b, then performs a \p half2 vector add of the result with \p c, rounding the result once in round-to-nearest mode.

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

__hfma2_sat(half2, half2, half2)

Performs \p half2 vector multiply on inputs \p a and \p b, then performs a \p half2 vector add of the result with \p c, rounding the result once in round-to-nearest mode, and clamps the results to range [0.0, 1.0]. NaN results are flushed to +0.0.

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

__hge2(half2, half2)

Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hgeu2(half2, half2)

Performs \p half2 vector greater-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__hgt2(half2, half2)

Performs \p half2 vector greater-than comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hgtu2(half2, half2)

Performs \p half2 vector greater-than comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__high2half2(half2)

Extracts high 16 bits from \p half2 input \p a and returns a new \p half2 number which has both halves equal to the extracted bits.

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

__highs2half2(half2, half2)

Extracts high 16 bits from each of the two \p half2 inputs and combines into one \p half2 number. High 16 bits from input \p a is stored in low 16 bits of the return value, high 16 bits from input \p b is stored in high 16 bits of the return value.

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

__hisnan2(half2, half2)

Determine whether each half of input \p half2 number \p a is a NaN.

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

Returns \p half2 which has the corresponding \p half results set to 1.0 for true, or 0.0 for false.

__hle2(half2, half2)

Performs \p half2 vector less-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hleu2(half2, half2)

Performs \p half2 vector less-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__hlt2(half2, half2)

Performs \p half2 vector less-than comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hltu2(half2, half2)

Performs \p half2 vector less-than comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__hmul2_sat(half2, half2)

Performs \p half2 vector multiplication of inputs \p a and \p b, in round-to-nearest mode, and clamps the results to range [0.0, 1.0]. NaN results are flushed to +0.0.

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

__hne2(half2, half2)

Performs \p half2 vector not-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate false results.

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

__hneg2(half2)

Negates both halves of the input \p half2 number \p a and returns the result.

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

__hneu2(half2, half2)

Performs \p half2 vector not-equal comparison of inputs \p a and \p b. The corresponding \p half results are set to 1.0 for true, or 0.0 for false. NaN inputs generate true results.

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

__hsub2_sat(half2, half2)

Subtracts \p half2 input vector \p b from input vector \p a in round-to-nearest mode, and clamps the results to range [0.0, 1.0]. NaN results are flushed to +0.0.

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

__low2half2(half2)

Extracts low 16 bits from \p half2 input \p a and returns a new \p half2 number which has both halves equal to the extracted bits.

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

__lows2half2(half2, half2)

Extracts low 16 bits from each of the two \p half2 inputs and combines into one \p half2 number. Low 16 bits from input \p a is stored in low 16 bits of the return value, low 16 bits from input \p b is stored in high 16 bits of the return value.

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

Equals(half2)

Declaration
public bool Equals(half2 other)
Parameters
Type Name Description
half2 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)

GetHashCode()

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

swap()

Declaration
public half2 swap()
Returns
Type Description
half2

Operators

Addition(half2, half2)

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

Equality(half2, half2)

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

GreaterThan(half2, half2)

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

GreaterThanOrEqual(half2, half2)

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

Implicit(half2 to float2)

Declaration
public static implicit operator float2(half2 h)
Parameters
Type Name Description
half2 h
Returns
Type Description
float2

Inequality(half2, half2)

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

LessThan(half2, half2)

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

LessThanOrEqual(half2, half2)

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

Multiply(half2, half2)

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

Subtraction(half2, half2)

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