Home > Software engineering >  Can't define the matrix_double3x3 in a c header
Can't define the matrix_double3x3 in a c header

Time:09-20

enter image description here

I tried to define the matrix_double3x3 properties but the compiler don't allow me to do. I can define the matrix_float3x3 or matrix_half3x3 but not for the matrix_double3x3.

enter image description here

But I saw the matrix_types.h, it has typedef simd_double3x3 matrix_double3x3

My goal is to send the matrix_double3x3 to Metal for computing the rectified image.

Environment

  • Xcode 14.0 (14A309)
    • Destination:
      • macOS (Minimum Deployments: 12.3)
  • macOS 12.6 (21G115)

CodePudding user response:

According to documentation https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf:

Metal does not support the double, long long, unsigned long long, and long double data types.

It means you can implement double simd in host code, not in MSL.

However, if you need to improve the accuracy of calculations you can try to test the project: https://github.com/BrianSwift/MetalQD

  • Related