(a: mx.array, source)
| 957 | @unittest.skipIf(not mx.metal.is_available(), "Metal is not available") |
| 958 | def test_custom_kernel_caching(self): |
| 959 | def call_kernel(a: mx.array, source): |
| 960 | kernel = mx.fast.metal_kernel( |
| 961 | name="my_kernel", |
| 962 | input_names=["inp"], |
| 963 | output_names=["out"], |
| 964 | source=source, |
| 965 | ) |
| 966 | return kernel( |
| 967 | inputs=[a], |
| 968 | grid=(a.size, 1, 1), |
| 969 | threadgroup=(a.size, 1, 1), |
| 970 | output_shapes=[a.shape], |
| 971 | output_dtypes=[a.dtype], |
| 972 | stream=mx.gpu, |
| 973 | )[0] |
| 974 | |
| 975 | a = mx.random.normal(shape=(32,)) |
| 976 |
nothing calls this directly
no outgoing calls
no test coverage detected