Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
fix remaining errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-chuang committed Nov 8, 2020
1 parent 0e5f2c4 commit 06cc547
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true

- name: Install Rust nightly for CUDA
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-09-20
components: rustfmt
- name: Install CUDA toolchains
run: |
curl -sSL https://github.com/jon-chuang/accel/raw/master/setup_nvptx_toolchain.sh | bash
- uses: actions/cache@v2
with:
Expand Down Expand Up @@ -104,7 +101,6 @@ jobs:
- name: Test algebra with CUDA
run: |
cd algebra
curl -sSL https://github.com/jon-chuang/accel/raw/master/setup_nvptx_toolchain.sh | bash
cargo test --features "all_curves cuda cuda_test"
- name: Test algebra with assembly
Expand Down
4 changes: 2 additions & 2 deletions algebra-core/src/curves/cuda/scalar_mul/cpu_gpu_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ macro_rules! impl_gpu_cpu_run_kernel {
.join("cuda-scalar-mul-profiler")
.join(P::namespace());
std::fs::create_dir_all(&dir)?;
Ok(dir.to_str().to_string())
Ok(dir.to_str().unwrap().to_string())
}
#[cfg(not(feature = "cuda"))]
Err(crate::CudaScalarMulError::CudaDisabledError)
Expand All @@ -22,7 +22,7 @@ macro_rules! impl_gpu_cpu_run_kernel {
fn read_profile_data() -> Result<crate::String, crate::CudaScalarMulError> {
#[cfg(feature = "cuda")]
{
let dir = Self::init_gpu_cache_dir()?;
let dir = std::path::PathBuf::from(Self::init_gpu_cache_dir()?);
let data = std::fs::read_to_string(&dir.join("profile_data.txt"))?;
Ok(data)
}
Expand Down
1 change: 0 additions & 1 deletion algebra-core/src/curves/cuda/scalar_mul/kernel_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ macro_rules! impl_scalar_mul_kernel {
<<<$ProjCurve as ProjectiveCurve>::ScalarField as PrimeField>::Params as FpParameters>::MODULUS_BITS as isize;
const LOG2_W: isize = 5;
const TABLE_SIZE: isize = 1 << LOG2_W;
const HALF_TABLE_SIZE: isize = 1 << (LOG2_W - 1);
const NUM_U8: isize = (NUM_BITS - 1) / LOG2_W + 1;

#[kernel_func]
Expand Down
6 changes: 2 additions & 4 deletions algebra-core/src/curves/cuda/scalar_mul/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl fmt::Display for CudaScalarMulError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
match self {
CudaScalarMulError::CudaDisabledError => write!(f, "CUDA is disabled"),
CudaScalarMulError::IoError=> write!(f, "IO error"),
CudaScalarMulError::IoError => write!(f, "IO error"),
CudaScalarMulError::KernelFailedError => write!(f, "Failed running kernel"),
CudaScalarMulError::ProfilingSerializationError => {
write!(f, "Failed serlializing profiling data")
Expand Down Expand Up @@ -127,9 +127,7 @@ pub(crate) mod internal {
use crate::accel_dummy::*;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[cfg(not(feature = "std"))]
use alloc::string::String;
use alloc::{string::String, vec::Vec};

use crate::{curves::AffineCurve, fields::PrimeField, CudaScalarMulError};

Expand Down

0 comments on commit 06cc547

Please sign in to comment.