add autodiff batching backend

This commit is contained in:
Manuel Drehwald 2025-04-04 14:24:23 -04:00
parent e0c8ead880
commit b7c63a973f
6 changed files with 196 additions and 44 deletions

View file

@ -384,6 +384,12 @@ static inline void AddAttributes(T *t, unsigned Index, LLVMAttributeRef *Attrs,
t->setAttributes(PALNew);
}
extern "C" bool LLVMRustHasAttributeAtIndex(LLVMValueRef Fn, unsigned Index,
LLVMRustAttributeKind RustAttr) {
Function *F = unwrap<Function>(Fn);
return F->hasParamAttribute(Index, fromRust(RustAttr));
}
extern "C" void LLVMRustAddFunctionAttributes(LLVMValueRef Fn, unsigned Index,
LLVMAttributeRef *Attrs,
size_t AttrsLen) {
@ -636,6 +642,10 @@ static InlineAsm::AsmDialect fromRust(LLVMRustAsmDialect Dialect) {
}
}
extern "C" uint64_t LLVMRustGetArrayNumElements(LLVMTypeRef Ty) {
return unwrap(Ty)->getArrayNumElements();
}
extern "C" LLVMValueRef
LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
char *Constraints, size_t ConstraintsLen,