MCPcopy Create free account
hub / github.com/ml-explore/mlx / call_kernel

Method call_kernel

python/tests/test_fast.py:959–973  ·  view source on GitHub ↗
(a: mx.array, source)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected