Skip to content

Commit c584edc

Browse files
committed
MathUtils: extend the OpenCL sincos workaround to Metal
A reference parameter carries its address space into template deduction, so sincos(T ang, T& s, T& c) called with thread-resident floats deduces T as float from the first argument and as thread float from the other two. OpenCL has the same rule, and the three-parameter overload already there for it works verbatim on Metal.
1 parent 01743fb commit c584edc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Common/MathUtils/include/MathUtils/detail/trigonometric.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ inline void bringToPMPiGen(T& phi)
110110
phi = toPMPiGen<T>(phi);
111111
}
112112

113-
#ifdef __OPENCL__ // TODO: get rid of that stupid workaround for OpenCL template address spaces
113+
#if defined(__OPENCL__) || defined(__METAL__) // TODO: get rid of that stupid workaround for OpenCL template address spaces
114114
template <typename T, typename S, typename U>
115115
GPUhdi() void sincos(T ang, S& s, U& c)
116116
{

0 commit comments

Comments
 (0)