Skip to content

Commit

Permalink
poc/ntt-cuda/*: modernize.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jan 26, 2024
1 parent bfaf1f3 commit ff80ec2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions poc/ntt-cuda/cuda/ntt_api.cu
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include <ntt/ntt.cuh>

#ifndef __CUDA_ARCH__

extern "C"
RustError::by_value compute_ntt(size_t device_id,
fr_t* inout, uint32_t lg_domain_size,
Expand All @@ -38,5 +36,3 @@ RustError::by_value compute_ntt(size_t device_id,
return NTT::Base(gpu, inout, lg_domain_size,
ntt_order, ntt_direction, ntt_type);
}

#endif
8 changes: 4 additions & 4 deletions poc/ntt-cuda/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn NTT<T>(device_id: usize, inout: &mut [T], order: NTTInputOutputOrder) {
let err = unsafe {
compute_ntt(
device_id,
inout.as_mut_ptr() as *mut core::ffi::c_void,
inout.as_mut_ptr() as *mut _,
len.trailing_zeros(),
order,
NTTDirection::Forward,
Expand All @@ -50,7 +50,7 @@ pub fn iNTT<T>(device_id: usize, inout: &mut [T], order: NTTInputOutputOrder) {
let err = unsafe {
compute_ntt(
device_id,
inout.as_mut_ptr() as *mut core::ffi::c_void,
inout.as_mut_ptr() as *mut _,
len.trailing_zeros(),
order,
NTTDirection::Inverse,
Expand All @@ -77,7 +77,7 @@ pub fn coset_NTT<T>(
let err = unsafe {
compute_ntt(
device_id,
inout.as_mut_ptr() as *mut core::ffi::c_void,
inout.as_mut_ptr() as *mut _,
len.trailing_zeros(),
order,
NTTDirection::Forward,
Expand All @@ -104,7 +104,7 @@ pub fn coset_iNTT<T>(
let err = unsafe {
compute_ntt(
device_id,
inout.as_mut_ptr() as *mut core::ffi::c_void,
inout.as_mut_ptr() as *mut _,
len.trailing_zeros(),
order,
NTTDirection::Inverse,
Expand Down

0 comments on commit ff80ec2

Please sign in to comment.