Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions src/include/OpenImageIO/fmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -911,20 +911,11 @@ convert_type<float,uint8_t> (const float *src, uint8_t *dst, size_t n,


#if defined(_HALF_H_) || defined(IMATH_HALF_H_)
// Specialize for half only if half.h is included prior to fmath.h
template<>
OIIO_UTIL_API
void convert_type<half,float> (const half *src, float *dst, size_t n,
float /*_min*/, float /*_max*/);
template<>
OIIO_UTIL_API
void convert_type<float,half> (const float *src, half *dst, size_t n,
half /*_min*/, half /*_max*/);

#if OIIO_FMATH_HEADER_ONLY
// Not just the declarations, give the definitions here.
template<>
void convert_type<half,float> (const half *src, float *dst, size_t n,
float /*_min*/, float /*_max*/)
inline void
convert_type<half,float> (const half *src, float *dst, size_t n,
float /*_min*/, float /*_max*/)
{
#if OIIO_SIMD >= 8 && OIIO_F16C_ENABLED
// If f16c ops are enabled, it's worth doing this by 8's
Expand All @@ -944,7 +935,7 @@ void convert_type<half,float> (const half *src, float *dst, size_t n,
}

template<>
void
inline void
convert_type<float,half> (const float *src, half *dst, size_t n,
half /*_min*/, half /*_max*/)
{
Expand All @@ -964,7 +955,6 @@ convert_type<float,half> (const float *src, half *dst, size_t n,
while (n--)
*dst++ = *src++;
}
#endif /* if OIIO_FMATH_HEADER_ONLY */
#endif /* if defined(IMATH_HALF_H_) */

#endif /* ifndef __CUDA_ARCH__ */
Expand Down
5 changes: 1 addition & 4 deletions src/libutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set (libOpenImageIO_Util_srcs argparse.cpp benchmark.cpp
errorhandler.cpp farmhash.cpp filesystem.cpp
fmath.cpp filter.cpp hashes.cpp paramlist.cpp
filter.cpp hashes.cpp paramlist.cpp
plugin.cpp SHA1.cpp
strutil.cpp sysutil.cpp thread.cpp timer.cpp
typedesc.cpp ustring.cpp xxhash.cpp)
Expand All @@ -15,9 +15,6 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif ()

if (CMAKE_UNITY_BUILD)
# If unity builds are occurring, fmath.cpp MUST be compiled alone. But the
# rest can be built together if in group mode.
set_property (SOURCE fmath.cpp APPEND PROPERTY SKIP_UNITY_BUILD_INCLUSION TRUE)
set_source_files_properties (${libOpenImageIO_Util_srcs}
PROPERTIES UNITY_GROUP utilsrc)
endif ()
Expand Down
11 changes: 0 additions & 11 deletions src/libutil/fmath.cpp

This file was deleted.

Loading