Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/blastoff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "blastoff"
version = "0.1.0"
edition = "2021"
edition = "2024"
authors = ["Riccardo D'Ambrosio <[email protected]>"]
repository = "https://github.com/Rust-GPU/rust-cuda"

Expand Down
8 changes: 5 additions & 3 deletions crates/blastoff/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,11 @@ impl CublasContext {
///
/// The callback must not panic and unwind.
pub unsafe fn set_logger_callback(callback: Option<unsafe extern "C" fn(*const c_char)>) {
cublas_sys::cublasSetLoggerCallback(callback)
.to_result()
.unwrap();
unsafe {
cublas_sys::cublasSetLoggerCallback(callback)
.to_result()
.unwrap();
}
}

/// Gets the logger callback that was previously set.
Expand Down
4 changes: 2 additions & 2 deletions crates/blastoff/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub trait ToResult {

impl ToResult for cublas_sys::cublasStatus_t {
fn to_result(self) -> Result<(), CublasError> {
use cust_raw::cublas_sys::cublasStatus_t::*;
use CublasError::*;
use cust_raw::cublas_sys::cublasStatus_t::*;

Err(match self {
CUBLAS_STATUS_SUCCESS => return Ok(()),
Expand All @@ -58,8 +58,8 @@ impl ToResult for cublas_sys::cublasStatus_t {

impl CublasError {
pub fn into_raw(self) -> cublas_sys::cublasStatus_t {
use cust_raw::cublas_sys::cublasStatus_t::*;
use CublasError::*;
use cust_raw::cublas_sys::cublasStatus_t::*;

match self {
NotInitialized => CUBLAS_STATUS_NOT_INITIALIZED,
Expand Down
2 changes: 1 addition & 1 deletion crates/blastoff/src/level1.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Scalar and Vector-based operations

use crate::{
BlasDatatype, Float,
context::CublasContext,
error::{Error, ToResult},
raw::{ComplexLevel1, FloatLevel1, Level1},
BlasDatatype, Float,
};
use cust::memory::{GpuBox, GpuBuffer};
use cust::stream::Stream;
Expand Down
2 changes: 1 addition & 1 deletion crates/blastoff/src/level3.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{
GemmDatatype, MatrixOp,
context::CublasContext,
error::{Error, ToResult},
raw::GemmOps,
GemmDatatype, MatrixOp,
};
use cust::memory::{GpuBox, GpuBuffer};
use cust::stream::Stream;
Expand Down
Loading