Skip to content

Commit

Permalink
Added freezing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
DoeringChristian committed Dec 4, 2024
1 parent f59eb66 commit 3500d0e
Show file tree
Hide file tree
Showing 4 changed files with 2,869 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ add_library(
src/malloc.h src/malloc.cpp
src/registry.h src/registry.cpp
src/util.h src/util.cpp
src/record_ts.h src/record_ts.cpp

# CUDA backend
src/cuda_api.h
Expand Down
44 changes: 44 additions & 0 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "cond.h"
#include "profile.h"
#include "array.h"
#include "record_ts.h"
#include <thread>
#include <condition_variable>
#include <drjit-core/half.h>
Expand Down Expand Up @@ -1502,3 +1503,46 @@ int jit_leak_warnings() {
void jit_set_leak_warnings(int value) {
state.leak_warnings = (bool) value;
}

void jit_freeze_start(JitBackend backend, const uint32_t *inputs,
uint32_t n_inputs) {
lock_guard guard(state.lock);
return jitc_freeze_start(backend, inputs, n_inputs);
}

Recording *jit_freeze_stop(JitBackend backend, const uint32_t *outputs,
uint32_t n_outputs) {
lock_guard guard(state.lock);
return jitc_freeze_stop(backend, outputs, n_outputs);
}

int jit_freeze_pause(JitBackend backend) {
lock_guard guard(state.lock);
return jitc_freeze_pause(backend);
}

int jit_freeze_resume(JitBackend backend) {
lock_guard guard(state.lock);
return jitc_freeze_resume(backend);
}

void jit_freeze_abort(JitBackend backend) {
lock_guard guard(state.lock);
return jitc_freeze_abort(backend);
}

void jit_freeze_replay(Recording *recording, const uint32_t *inputs,
uint32_t *outputs) {
lock_guard guard(state.lock);
jitc_freeze_replay(recording, inputs, outputs);
}

int jit_freeze_dry_run(Recording *recording, const uint32_t *inputs) {
lock_guard guard(state.lock);
return jitc_freeze_dry_run(recording, inputs);
}

void jit_freeze_destroy(Recording *recording) {
lock_guard guard(state.lock);
jitc_freeze_destroy(recording);
}
Loading

0 comments on commit 3500d0e

Please sign in to comment.