@@ -911,20 +911,11 @@ convert_type<float,uint8_t> (const float *src, uint8_t *dst, size_t n,
911911
912912
913913#if defined(_HALF_H_) || defined(IMATH_HALF_H_)
914+ // Specialize for half only if half.h is included prior to fmath.h
914915template <>
915- OIIO_UTIL_API
916- void convert_type<half,float > (const half *src, float *dst, size_t n,
917- float /* _min*/ , float /* _max*/ );
918- template <>
919- OIIO_UTIL_API
920- void convert_type<float ,half> (const float *src, half *dst, size_t n,
921- half /* _min*/ , half /* _max*/ );
922-
923- #if OIIO_FMATH_HEADER_ONLY
924- // Not just the declarations, give the definitions here.
925- template <>
926- void convert_type<half,float > (const half *src, float *dst, size_t n,
927- float /* _min*/ , float /* _max*/ )
916+ inline void
917+ convert_type<half,float > (const half *src, float *dst, size_t n,
918+ float /* _min*/ , float /* _max*/ )
928919{
929920#if OIIO_SIMD >= 8 && OIIO_F16C_ENABLED
930921 // If f16c ops are enabled, it's worth doing this by 8's
@@ -944,7 +935,7 @@ void convert_type<half,float> (const half *src, float *dst, size_t n,
944935}
945936
946937template <>
947- void
938+ inline void
948939convert_type<float ,half> (const float *src, half *dst, size_t n,
949940 half /* _min*/ , half /* _max*/ )
950941{
@@ -964,7 +955,6 @@ convert_type<float,half> (const float *src, half *dst, size_t n,
964955 while (n--)
965956 *dst++ = *src++;
966957}
967- #endif /* if OIIO_FMATH_HEADER_ONLY */
968958#endif /* if defined(IMATH_HALF_H_) */
969959
970960#endif /* ifndef __CUDA_ARCH__ */
0 commit comments