MLX
Loading...
Searching...
No Matches
compile_impl.h
Go to the documentation of this file.
1// Copyright © 2023-2024 Apple Inc.
2
3#pragma once
4
5#include "mlx/device.h"
6
7namespace mlx::core::detail {
8
9// This is not part of the general C++ API as calling with a bad id is a bad
10// idea.
11std::function<std::vector<array>(const std::vector<array>&)> compile(
12 const std::function<std::vector<array>(const std::vector<array>&)>& fun,
13 std::uintptr_t fun_id,
14 bool shapeless = false,
15 std::vector<uint64_t> constants = {});
16
17// Erase cached compile functions
18void compile_erase(std::uintptr_t fun_id);
19
20// Clear the compiler cache causing a recompilation of all compiled functions
21// when called again.
23
25} // namespace mlx::core::detail
Definition ops.h:8
void compile_clear_cache()
void compile_erase(std::uintptr_t fun_id)
std::function< std::vector< array >(const std::vector< array > &)> compile(const std::function< std::vector< array >(const std::vector< array > &)> &fun, std::uintptr_t fun_id, bool shapeless=false, std::vector< uint64_t > constants={})
bool compile_available_for_device(const Device &device)
Definition device.h:7