Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new flag #101

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,12 @@ pub(crate) unsafe fn differentiate(
LLVMDumpModule(llmod);
}
}

if std::env::var("ENZYME_INLINE").is_ok() {
dbg!("Setting inline to true");
llvm::set_inline(true);
}

if std::env::var("ENZYME_TT_DEPTH").is_ok() {
let depth = std::env::var("ENZYME_TT_DEPTH").unwrap();
let depth = depth.parse::<u64>().unwrap();
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2657,6 +2657,7 @@ pub mod Fallback_AD {
pub fn EnzymeSetCLBool(arg1: *mut ::std::os::raw::c_void, arg2: u8) { unimplemented!() }
pub fn EnzymeSetCLInteger(arg1: *mut ::std::os::raw::c_void, arg2: i64) { unimplemented!() }

pub fn set_inline(val: bool) { unimplemented!() }
pub fn set_runtime_activity_check(check: bool) { unimplemented!() }
pub fn set_max_int_offset(offset: u64) { unimplemented!() }
pub fn set_max_type_offset(offset: u64) { unimplemented!() }
Expand Down Expand Up @@ -3017,6 +3018,7 @@ extern "C" {
static mut EnzymePrint: c_void;
static mut EnzymeStrictAliasing: c_void;
static mut looseTypeAnalysis: c_void;
static mut EnzymeInline: c_void;
}
pub fn set_runtime_activity_check(check: bool) {
unsafe {
Expand Down Expand Up @@ -3071,6 +3073,11 @@ pub fn set_loose_types(loose: bool) {
EnzymeSetCLBool(std::ptr::addr_of_mut!(looseTypeAnalysis), loose as u8);
}
}
pub fn set_inline(val: bool) {
unsafe {
EnzymeSetCLBool(std::ptr::addr_of_mut!(EnzymeInline), val as u8);
}
}

extern "C" {
pub fn EnzymeCreatePrimalAndGradient<'a>(
Expand Down
Loading