diff --git a/metal/include/metal_compat/cuda_fp16.h b/metal/include/metal_compat/cuda_fp16.h new file mode 100644 index 00000000..e69de29b diff --git a/metal/include/metal_compat/cuda_fp8.h b/metal/include/metal_compat/cuda_fp8.h new file mode 100644 index 00000000..c0f63abb --- /dev/null +++ b/metal/include/metal_compat/cuda_fp8.h @@ -0,0 +1,4 @@ +// metal/include/metal_compat/cuda_fp8.h - the fp8 names the engine includes; the definitions live beside the bf16 ones. +#pragma once + +#include "cuda_bf16.h" diff --git a/metal/include/metal_compat/vector_types.h b/metal/include/metal_compat/vector_types.h new file mode 100644 index 00000000..67724b5e --- /dev/null +++ b/metal/include/metal_compat/vector_types.h @@ -0,0 +1,15 @@ +// metal/include/metal_compat/vector_types.h - the CUDA vector types the dsv41 sources name, on Metal. +// +// The compat directory had none, so the first half-precision header to use float2 failed. Only the shapes the engine +// touches are here (float2/float4/int2/uint2 and their make_ helpers); the Metal runtime's own float4 is not involved. +#pragma once + +struct float2 { float x, y; }; +struct float4 { float x, y, z, w; }; +struct int2 { int x, y; }; +struct uint2 { unsigned x, y; }; + +static inline float2 make_float2(float x, float y) { return float2{x, y}; } +static inline float4 make_float4(float x, float y, float z, float w) { return float4{x, y, z, w}; } +static inline int2 make_int2(int x, int y) { return int2{x, y}; } +static inline uint2 make_uint2(unsigned x, unsigned y) { return uint2{x, y}; }