I'm porting some basic OpenCL code to a Metal compute shader. Get stuck pretty early when attempting to convert the miscellaneous helper functions. For example, including something like the following function in a .metal
file Xcode (7.1) gives me a "No previous prototype for function" warning
float maxComponent(float4 a) {
return fmax(a.x, fmax(a.y, fmax(a.z, a.w)));
}
What's the 'metal' way to do this?