Skip to content

Commit

Permalink
Add two more missing low-level functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbikker committed Nov 20, 2024
1 parent 863ca62 commit b7bd217
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions traverse.cl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ inline float _native_fma( const float a, const float b, const float c )
#endif
}

inline float fmin_fmin( const float a, const float b, const float c )
{
#if defined( ISNVIDIA ) && defined( ISPASCAL )
// not a win on Turing
return as_float( min_min( as_int( a ), as_int( b ), as_int( c ) ) );
#else
return fmin( fmin( a, b ), c );
#endif
}

inline float fmax_fmax( const float a, const float b, const float c )
{
#if defined( ISNVIDIA ) && defined( ISPASCAL )
return as_float( max_max( as_int( a ), as_int( b ), as_int( c ) ) );
#else
return fmax( fmax( a, b ), c );
#endif
}

// ============================================================================
//
// T R A V E R S E _ A I L A L A I N E
Expand Down Expand Up @@ -273,8 +292,9 @@ void kernel traverse_gpu4way( global float4* alt4Node, global struct Ray* rayDat
#elif defined ISAMD
#define USE_VLOAD_VSTORE
#define SIMD_AABBTEST
#else // ARM, .. : untested

#else // unkown GPU
// #define USE_VLOAD_VSTORE
#define SIMD_AABBTEST
#endif

#ifdef USE_VLOAD_VSTORE
Expand Down

0 comments on commit b7bd217

Please sign in to comment.