K i ddlmZddlmZddlmZddlmZmZddl m Z m Z m Z m Z mZddlmZe dZdd gZGd d eZGd d eeZ ddddddddd ddZy)) annotations) ASTSource)Language) JITFunctionconstexpr_function)TypeVarOptionalCallableIterableUnion)irTrjitc(eZdZddfd ZdZxZS)GluonASTSourcecbt|||||tj|_d|_y)Nttgir)super__init__rGLUONlanguageext)selffn signature constexprsattrs __class__s h/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/triton/experimental/gluon/_runtime.pyrzGluonASTSource.__init__s( Y E:  c ddlm}ddlm}t j |}|j } ||} | j|}| jd|j|| jd|j|j| jd|j|j| jd|j|j|jdk(} | r7|j+| jd |j|j||j |||||| } | S) Nr) make_backend) ast_to_ttirz ttg.targetz ttg.num-warpsz ttg.num-ctaszttg.threads-per-warpcudaz ttg.maxnreg)contextoptions codegen_fns module_mapmodule)triton.compiler.compilerr"triton.compiler.code_generatorr#r builder create_moduleget_target_nameset_attrget_string_attrget_int32_attr num_warpsnum_ctas warp_size backend_namemaxnregr) rtargetr&r'r(r%r"r#r,r)backendis_cudas rmake_irzGluonASTSource.make_irs9>**W%&&(v&((1 g&=&=f&EF)?)?@Q@Q)RS(>(>w?O?O(PQ.0F0FwGXGX0YZ&&&0 w2 OOM7+A+A'//+R STWWdGWZe(26C r )NN)returnNone)__name__ __module__ __qualname__rr: __classcell__rs@rrr s  r rc$eZdZfdZdZxZS)GluonJITFunctionc:t|}t|_|SN)r create_binderrr)rresultrs rrFzGluonJITFunction.create_binder/s&(' r cy)NT)rs ris_gluonzGluonJITFunction.is_gluon4sr )r=r>r?rFrJr@rAs@rrCrC-s  r rCN)versionreprlaunch_metadatado_not_specializedo_not_specialize_on_alignmentdebugnoinlinec@dfd }|||S|S)a< Decorator for JIT-compiling a function using the Triton compiler. :note: When a jit'd function is called, arguments are implicitly converted to pointers if they have a :code:`.data_ptr()` method and a `.dtype` attribute. :note: This function will be compiled and run on the GPU. It will only have access to: * python primitives, * builtins within the triton package, * arguments to this function, * other jit'd functions :param fn: the function to be jit-compiled :type fn: Callable c Dt|sJt|S)N)rKrNrOrPrQrLrM)callablerC)rrPrNrOrMrQrLrKs r decoratorzjit..decoratorUs4|| /+I+  r )rrr;zJITFunction[T]rI) rrKrLrMrNrOrPrQrUs ``````` rrr8s&:    ~}r rE)rz Optional[T]rLOptional[Callable]rMrVrNOptional[Iterable[int | str]]rOrWrPOptional[bool]rQrXr;z9Union[GluonJITFunction[T], Callable[[T], JITFunction[T]]]) __future__rr*rtriton.backends.compilerrtriton.runtime.jitrrtypingrr r r r triton._C.libtritonr r__all__rrCrrIr rr_s".->??" CL  'Y@{1~. #*.7;DH #..  . ( . 5 .%B. ..?.r