Skip to content

Commit

Permalink
chore: formatting and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-stoian-zama committed Nov 25, 2024
1 parent daf0971 commit 31b8e0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backends/tfhe-cuda-backend/cuda/src/device.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ void cuda_synchronize_stream(cudaStream_t stream, uint32_t gpu_index) {
check_cuda_error(cudaStreamSynchronize(stream));
}

uint32_t cuda_is_available() {
return cudaSetDevice(0) == cudaSuccess;
}

// Determine if a CUDA device is available at runtime
uint32_t cuda_is_available() { return cudaSetDevice(0) == cudaSuccess; }

/// Unsafe function that will try to allocate even if gpu_index is invalid
/// or if there's not enough memory. A safe wrapper around it must call
Expand Down
1 change: 1 addition & 0 deletions tfhe/src/core_crypto/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ pub fn synchronize_devices(gpu_count: u32) {
}
}

// Determine if a cuda device is available, at runtime
pub fn is_cuda_available() -> bool {
let result = unsafe { cuda_is_available() };
result == 1u32
Expand Down

0 comments on commit 31b8e0d

Please sign in to comment.