• Slang Standard Library Reference
    • Interfaces
    • Types
    • Attributes
    • Global Declarations
      • Atomic functions
      • Memory and control barriers
      • Bit operation functions
      • Conversion functions
        • asdouble
        • asfloat
        • asfloat16
        • asint
        • asint16
        • asuint
        • asuint16
        • bit_cast
        • f16tof32
        • f32tof16
        • f32tof16_
        • reinterpret
      • Derivative functions
      • Math functions
      • Mesh shading
      • Ray-tracing
      • Tessellation functions
      • Wave and quad functions
      • CheckAccessFullyMapped
      • D3DCOLORtoUBYTE4
      • EvaluateAttributeAtCentroid
      • EvaluateAttributeAtSample
      • EvaluateAttributeSnapped
      • GetAttributeAtVertex
      • GetRenderTargetSampleCount
      • GetRenderTargetSamplePosition
      • IsHelperLane
      • NonUniformResourceIndex
      • ReorderThread
      • WorkgroupSize
      • abort
      • all
      • any
      • clip
      • concat
      • createDynamicObject
      • cudaBlockDim
      • cudaBlockIdx
      • cudaThreadIdx
      • debugBreak
      • getRealtimeClock
      • getRealtimeClockLow
      • getStringHash
      • makeTuple
      • nextafter
      • printf
      • select
      • static_assert
      • unmodified
      • unused

f32tof16_

Description

Convert to float16_t.

Signature

half f32tof16_(float value);

vector<half, N> f32tof16_<N:int>(vector<float, N> value);

Generic Parameters

N : int

Parameters

value : float

value : vector<float, N>

Availability and Requirements

Defined for the following targets:

glsl

Available in all stages.

cuda

Available in all stages.

metal

Available in all stages.

wgsl

Available in all stages.

spirv

Available in all stages.