Metal SIMD Min and Max operations fail for floats

Hi,

After looking at the Metal Shading Language Guide, I got interested in the SIMD-functions in Metal 2.1.

I created a simple test to test kernel the simd_min and simd_max functions, but I'm getting undefined results for floats, and can't really find out the reasons.


I've described the issue in this SO Question. If there's anyone who knows something about this, please chip in here or on StackOverflow.

Replies

It could be platform specific. I don't think the simd_ functions work outside of MacOS. And it may be driver related as well. I've resorted to using atomic functions for various operations instead to have things work on all of MacOS, iOS, and tvOS- e.g. atomic_fetch_max_explicit. Look at section 5.13 in the MSL Spec. Let us know how you resolve this.

Thanks. In my case, I'm testing on MacOS, which, according to the Metal specification should be supported. I'm suspecting it may be a GPU driver issue as I'm getting correct results with the Intel GPU on the same MBP. I'm filing a defect report on Radeon Pro 560X driver.