# SPDX-FileCopyrightText: Copyright (c) <2025> NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

from cuda.tile._version import __version__  # noqa

from cuda.tile._cext import launch

from cuda.tile._by_target import ByTarget

from cuda.tile._memory_model import (
    MemoryOrder,
    MemoryScope,
)

from cuda.tile._numeric_semantics import (
    PaddingMode,
    RoundingMode,
)

from cuda.tile._datatype import (
    DType,

    bfloat16,
    bool_,
    float4_e2m1fn,
    float8_e4m3fn,
    float8_e5m2,
    float8_e8m0fnu,
    float16,
    float32,
    float64,
    int8,
    int16,
    int32,
    int64,
    tfloat32,
    uint8,
    uint16,
    uint32,
    uint64,
)

from cuda.tile._exception import (
    TileCompilerExecutionError,
    TileCompilerTimeoutError,
    TileError,
    TileInternalError,
    TileRecursionError,
    TileStaticAssertionError,
    TileStaticEvalError,
    TileSyntaxError,
    TileTypeError,
    TileUnsupportedFeatureError,
    TileValueError,
)

from cuda.tile._stub import (
    Array,
    ArrayAnnotation,
    Constant,
    ConstantAnnotation,
    IndexedWithInt64,
    ListAnnotation,
    Scalar,
    ScalarInt64,
    Slice,
    Tile,
    TiledView,

    abs,
    add,
    arange,
    argmax,
    argmin,
    assert_,
    assume_divisible_by,
    astile,
    astype,
    atan2,
    atomic_add,
    atomic_and,
    atomic_cas,
    atomic_max,
    atomic_min,
    atomic_or,
    atomic_xchg,
    atomic_xor,
    bitwise_and,
    bitwise_lshift,
    bitwise_not,
    bitwise_or,
    bitwise_rshift,
    bitwise_xor,
    bid,
    bitcast,
    broadcast_to,
    cat,
    cdiv,
    ceil,
    cos,
    cosh,
    cumprod,
    cumsum,
    scan,
    equal,
    exp,
    exp2,
    expand_dims,
    extract,
    floor,
    floordiv,
    full,
    gather,
    greater,
    greater_equal,
    less,
    less_equal,
    load,
    load_advanced_indexing,
    log,
    log2,
    matmul,
    max,
    maximum,
    min,
    minimum,
    mma,
    mma_scaled,
    mod,
    mul,
    negative,
    isnan,
    not_equal,
    num_blocks,
    num_tiles,
    ones,
    pack_to_bytes,
    permute,
    pow,
    printf,
    print,
    prod,
    reduce,
    reshape,
    rsqrt,
    scatter,
    sin,
    sinh,
    sqrt,
    static_assert,
    static_eval,
    static_iter,
    store,
    store_advanced_indexing,
    sub,
    sum,
    tan,
    tanh,
    transpose,
    truediv,
    unpack_from_bytes,
    where,
    zeros,
)

from cuda.tile._context import compiler_timeout

from cuda.tile import tune

from cuda.tile._execution import (
    function,
    kernel
)

import cuda.tile.compilation as compilation

__all__ = [
    "launch",

    "ByTarget",

    "MemoryOrder",
    "MemoryScope",

    "PaddingMode",
    "RoundingMode",

    "DType",

    "bfloat16",
    "bool_",
    "float4_e2m1fn",
    "float8_e4m3fn",
    "float8_e5m2",
    "float8_e8m0fnu",
    "float16",
    "float32",
    "float64",
    "int8",
    "int16",
    "int32",
    "int64",
    "tfloat32",
    "uint8",
    "uint16",
    "uint32",
    "uint64",

    "TileCompilerExecutionError",
    "TileCompilerTimeoutError",
    "TileError",
    "TileInternalError",
    "TileRecursionError",
    "TileStaticAssertionError",
    "TileStaticEvalError",
    "TileSyntaxError",
    "TileTypeError",
    "TileUnsupportedFeatureError",
    "TileValueError",

    "Array",
    "ArrayAnnotation",
    "Constant",
    "ConstantAnnotation",
    "IndexedWithInt64",
    "ListAnnotation",
    "Scalar",
    "ScalarInt64",
    "Slice",
    "Tile",
    "TiledView",

    "abs",
    "add",
    "arange",
    "argmax",
    "argmin",
    "assert_",
    "assume_divisible_by",
    "astile",
    "astype",
    "atan2",
    "atomic_add",
    "atomic_and",
    "atomic_cas",
    "atomic_max",
    "atomic_min",
    "atomic_or",
    "atomic_xchg",
    "atomic_xor",
    "bitwise_and",
    "bitwise_lshift",
    "bitwise_not",
    "bitwise_or",
    "bitwise_rshift",
    "bitwise_xor",
    "bid",
    "bitcast",
    "broadcast_to",
    "cat",
    "cdiv",
    "ceil",
    "cos",
    "cosh",
    "cumprod",
    "cumsum",
    "scan",
    "equal",
    "exp",
    "exp2",
    "expand_dims",
    "extract",
    "floor",
    "floordiv",
    "full",
    "gather",
    "greater",
    "greater_equal",
    "less",
    "less_equal",
    "load",
    "load_advanced_indexing",
    "log",
    "log2",
    "matmul",
    "max",
    "maximum",
    "min",
    "minimum",
    "mma",
    "mma_scaled",
    "mod",
    "mul",
    "negative",
    "isnan",
    "not_equal",
    "num_blocks",
    "num_tiles",
    "ones",
    "pack_to_bytes",
    "permute",
    "pow",
    "printf",
    "print",
    "prod",
    "reduce",
    "reshape",
    "rsqrt",
    "scatter",
    "sin",
    "sinh",
    "sqrt",
    "static_assert",
    "static_eval",
    "static_iter",
    "store",
    "store_advanced_indexing",
    "sub",
    "sum",
    "tan",
    "tanh",
    "transpose",
    "truediv",
    "unpack_from_bytes",
    "where",
    "zeros",

    "compiler_timeout",

    "tune",

    "function",
    "kernel",

    "compilation",
]
