go-mlx/dist/include/mlx/backend/cpu/threefry.h
Snider 2292557fd6 chore: vendor MLX C headers for Go module consumers
dist/include/ contains the MLX and MLX-C headers needed for CGo
compilation. Without these, go-mlx cannot be used as a module
dependency (headers not found in module cache).

Libraries (dylib/metallib) are still gitignored — users build
those locally via cmake.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:14:04 +00:00

21 lines
572 B
C++

// Copyright © 2023 Apple Inc.
#pragma once
#include <cstdint>
#include <utility>
namespace mlx::core::random {
/** Applies the Threefry 2x32 hash function.
* This code is based on the Jax counter-based and splittable PRNG
* https://github.com/google/jax/blob/main/docs/jep/263-prng.md
*
* Original Threefry reference:
* http://www.thesalmons.org/john/random123/papers/random123sc11.pdf
*/
std::pair<uint32_t, uint32_t> threefry2x32_hash(
const std::pair<uint32_t, uint32_t>& key,
std::pair<uint32_t, uint32_t> count);
} // namespace mlx::core::random