Skip to content

Commit

Permalink
fix offset
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 28, 2025
1 parent 8aa7c52 commit 1654b9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/temp-branch-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Branch - Build and push docker image
on:
push:
branches:
- "test-benchmark"
- "fix/test-benchmark-chunked-page-lock"

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Expand Down
5 changes: 3 additions & 2 deletions iris-mpc-gpu/src/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,18 @@ pub fn register_host_memory(
chunk_offset + chunk_length
);
let size = chunk_length / device_manager.device_count();
let offset = chunk_offset / device_manager.device_count();
for (device_index, device) in device_manager.devices().iter().enumerate() {
device.bind_to_thread().unwrap();
unsafe {
let _ = cudarc::driver::sys::lib().cuMemHostRegister_v2(
(db.limb_0[device_index] + (chunk_offset * code_length) as u64) as *mut _,
(db.limb_0[device_index] + (offset * code_length) as u64) as *mut _,
size * code_length,
CU_MEMHOSTALLOC_PORTABLE,
);

let _ = cudarc::driver::sys::lib().cuMemHostRegister_v2(
(db.limb_1[device_index] + (chunk_offset * code_length) as u64) as *mut _,
(db.limb_1[device_index] + (offset * code_length) as u64) as *mut _,
size * code_length,
CU_MEMHOSTALLOC_PORTABLE,
);
Expand Down

0 comments on commit 1654b9c

Please sign in to comment.