diff --git a/CUDACore/src/library_types.jl b/CUDACore/src/library_types.jl index faa1a9294b..e87777abe9 100644 --- a/CUDACore/src/library_types.jl +++ b/CUDACore/src/library_types.jl @@ -33,8 +33,16 @@ end C_64I = 25 # complex as a pair of signed 64-bit int numbers R_64U = 26 # real as a unsigned 64-bit int C_64U = 27 # complex as a pair of unsigned 64-bit int numbers + R_8F_E4M3 = 28 # real as a nv_fp8_e4m3 + R_8F_E5M2 = 29 # real as a nv_fp8_e5m2 + R_8F_UE8M0 = 30 # real as an exponent-only unsigned nv_fp8_e8m0 + R_6F_E2M3 = 31 # real as a nv_fp6_e2m3 + R_6F_E3M2 = 32 # real as a nv_fp6_e3m2 + R_4F_E2M1 = 33 # real as a nv_fp4_e2m1 end +const R_8F_UE4M3 = R_8F_E4M3 # real as an unsigned nv_fp8_e4m3 + function Base.convert(::Type{cudaDataType}, T::DataType) if T === Float16 return R_16F diff --git a/test/core/utils.jl b/test/core/utils.jl index d4cb11815f..59afc577ca 100644 --- a/test/core/utils.jl +++ b/test/core/utils.jl @@ -30,4 +30,10 @@ end end @test_throws ArgumentError convert(CUDACore.cudaDataType, BigFloat) @test_throws ArgumentError Type(CUDACore.R_4I) # adjust once we support 4-bit Ints + # narrow-precision floats: enum members exist, + # but no Julia type maps to them in CUDACore. + for c_type in (CUDACore.R_8F_E4M3, CUDACore.R_8F_E5M2, CUDACore.R_8F_UE8M0, + CUDACore.R_6F_E2M3, CUDACore.R_6F_E3M2, CUDACore.R_4F_E2M1) + @test_throws ArgumentError Type(c_type) + end end