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 7, 2024
1 parent a24b42b commit ada2ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 2 additions & 22 deletions poc/ntt-cuda/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,7 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

sppark::cuda_error!();

#[repr(C)]
pub enum NTTInputOutputOrder {
NN = 0,
NR = 1,
RN = 2,
RR = 3,
}

#[repr(C)]
enum NTTDirection {
Forward = 0,
Inverse = 1,
}

#[repr(C)]
enum NTTType {
Standard = 0,
Coset = 1,
}
use sppark::{NTTInputOutputOrder, NTTDirection, NTTType};

extern "C" {
fn compute_ntt(
Expand All @@ -32,7 +12,7 @@ extern "C" {
ntt_order: NTTInputOutputOrder,
ntt_direction: NTTDirection,
ntt_type: NTTType,
) -> cuda::Error;
) -> sppark::Error;
}

/// Compute an in-place NTT on the input data.
Expand Down
2 changes: 1 addition & 1 deletion poc/ntt-cuda/tests/ntt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

use ntt_cuda::NTTInputOutputOrder;
use sppark::NTTInputOutputOrder;

const DEFAULT_GPU: usize = 0;

Expand Down

0 comments on commit ada2ea2

Please sign in to comment.