@@ -25,17 +25,17 @@ inline Float8Format current_fp8_format() {
2525#if PRIMUS_TURBO_DEVICE_COMPILE
2626 return Float8Format::FNUZ ; // dummy
2727#else
28- static Float8Format fmt = [] { return is_gfx950 () ? Float8Format::OCP : Float8Format::FNUZ ; }();
28+ static Float8Format fmt = [] { return is_gfx942 () ? Float8Format::FNUZ : Float8Format::OCP ; }();
2929 return fmt;
3030#endif
3131}
3232
3333PRIMUS_TURBO_HOST_DEVICE bool is_fp8_fnuz () {
3434#if PRIMUS_TURBO_DEVICE_COMPILE
35- #if defined(__gfx950__)
36- return false ; // gfx950 OCP
37- #else
35+ #if defined(__gfx942__)
3836 return true ;
37+ #else
38+ return false ; // gfx950 OCP
3939#endif
4040#else
4141 return current_fp8_format () == Float8Format::FNUZ ;
@@ -45,10 +45,10 @@ PRIMUS_TURBO_HOST_DEVICE bool is_fp8_fnuz() {
4545struct float8_e4m3_t {
4646
4747#if PRIMUS_TURBO_DEVICE_COMPILE
48- #if defined(__gfx950__ )
49- using storage_t = __hip_fp8_e4m3 ; // OCP on gfx950
48+ #if defined(__gfx942__ )
49+ using storage_t = __hip_fp8_e4m3_fnuz ; // FNUZ on gfx942
5050#else
51- using storage_t = __hip_fp8_e4m3_fnuz ; // FNUZ on others
51+ using storage_t = __hip_fp8_e4m3 ; // OCP on others
5252#endif
5353 storage_t val;
5454#else // host side – keep both encodings
@@ -180,10 +180,10 @@ static_assert(std::is_trivially_copyable_v<float8_e4m3_t>);
180180struct float8_e5m2_t {
181181
182182#if PRIMUS_TURBO_DEVICE_COMPILE
183- #if defined(__gfx950__ )
184- using storage_t = __hip_fp8_e5m2 ; // OCP on gfx950
183+ #if defined(__gfx942__ )
184+ using storage_t = __hip_fp8_e5m2_fnuz ; // FNUZ on gfx942
185185#else
186- using storage_t = __hip_fp8_e5m2_fnuz ; // FNUZ on others
186+ using storage_t = __hip_fp8_e5m2 ; // OCP on others
187187#endif
188188 storage_t val;
189189#else // host side – keep both encodings
@@ -392,10 +392,10 @@ template <> class numeric_limits<float8_e4m3_t> {
392392
393393 PRIMUS_TURBO_HOST_DEVICE static float8_e4m3_t max () {
394394#if PRIMUS_TURBO_DEVICE_COMPILE
395- #if defined(__gfx950__)
396- return float8_e4m3_t::from_bits (0x7E );
397- #else
395+ #if defined(__gfx942__)
398396 return float8_e4m3_t::from_bits (0x7F );
397+ #else
398+ return float8_e4m3_t::from_bits (0x7E );
399399#endif
400400#else
401401 return primus_turbo::is_fp8_fnuz () ? float8_e4m3_t::from_bits (0x7F )
@@ -414,10 +414,10 @@ template <> class numeric_limits<float8_e4m3_t> {
414414 // FNUZ: 0x80
415415 PRIMUS_TURBO_HOST_DEVICE static float8_e4m3_t quiet_NaN () {
416416#if PRIMUS_TURBO_DEVICE_COMPILE
417- #if defined(__gfx950__)
418- return float8_e4m3_t::from_bits (0x7F );
419- #else
417+ #if defined(__gfx942__)
420418 return float8_e4m3_t::from_bits (0x80 );
419+ #else
420+ return float8_e4m3_t::from_bits (0x7F );
421421#endif
422422#else
423423 return primus_turbo::is_fp8_fnuz () ? float8_e4m3_t::from_bits (0x80 )
@@ -430,10 +430,10 @@ template <> class numeric_limits<float8_e5m2_t> {
430430public:
431431 static constexpr bool is_specialized = true ;
432432#if PRIMUS_TURBO_DEVICE_COMPILE
433- #if defined(__gfx950__)
434- static constexpr bool has_infinity = true ;
435- #else
433+ #if defined(__gfx942__)
436434 static constexpr bool has_infinity = false ;
435+ #else
436+ static constexpr bool has_infinity = true ;
437437#endif
438438#else
439439 // Host: cannot determine at compile time whether this is OCP or FNUZ.
@@ -448,10 +448,10 @@ template <> class numeric_limits<float8_e5m2_t> {
448448
449449 PRIMUS_TURBO_HOST_DEVICE static float8_e5m2_t max () {
450450#if PRIMUS_TURBO_DEVICE_COMPILE
451- #if defined(__gfx950__)
452- return float8_e5m2_t::from_bits (0x7B );
453- #else
451+ #if defined(__gfx942__)
454452 return float8_e5m2_t::from_bits (0x7F );
453+ #else
454+ return float8_e5m2_t::from_bits (0x7B );
455455#endif
456456#else
457457 return primus_turbo::is_fp8_fnuz () ? float8_e5m2_t::from_bits (0x7F )
@@ -463,10 +463,10 @@ template <> class numeric_limits<float8_e5m2_t> {
463463
464464 PRIMUS_TURBO_HOST_DEVICE static float8_e5m2_t infinity () {
465465#if PRIMUS_TURBO_DEVICE_COMPILE
466- #if defined(__gfx950__)
467- return float8_e5m2_t::from_bits (0x7C );
468- #else
466+ #if defined(__gfx942__)
469467 return max ();
468+ #else
469+ return float8_e5m2_t::from_bits (0x7C );
470470#endif
471471#else
472472 return primus_turbo::is_fp8_fnuz () ? max () : float8_e5m2_t::from_bits (0x7C );
@@ -475,10 +475,10 @@ template <> class numeric_limits<float8_e5m2_t> {
475475
476476 PRIMUS_TURBO_HOST_DEVICE static float8_e5m2_t quiet_NaN () {
477477#if PRIMUS_TURBO_DEVICE_COMPILE
478- #if defined(__gfx950__)
479- return float8_e5m2_t::from_bits (0x7D );
480- #else
478+ #if defined(__gfx942__)
481479 return float8_e5m2_t::from_bits (0x80 );
480+ #else
481+ return float8_e5m2_t::from_bits (0x7D );
482482#endif
483483#else
484484 return primus_turbo::is_fp8_fnuz () ? float8_e5m2_t::from_bits (0x80 )
0 commit comments