Skip to content

Commit

Permalink
Auto-format code changes (#627)
Browse files Browse the repository at this point in the history
Auto-format code using Clang-Format

Co-authored-by: GitHub Actions <actions@github.com>
  • Loading branch information
github-actions[bot] and actions-user committed Aug 21, 2024
1 parent 2062687 commit 18c855f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions include/micm/cuda/util/cuda_dense_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ namespace micm
{
if constexpr (std::is_same_v<T, int>)
{
// the cudaMemset function only works for integer types and is an asynchronous function: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a
CHECK_CUDA_ERROR(cudaMemset(this->param_.d_data_, val, sizeof(double) * this->param_.number_of_elements_), "cudaMemset");
// the cudaMemset function only works for integer types and is an asynchronous function:
// https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a
CHECK_CUDA_ERROR(
cudaMemset(this->param_.d_data_, val, sizeof(double) * this->param_.number_of_elements_), "cudaMemset");
}
else
{
Expand Down
1 change: 0 additions & 1 deletion include/micm/cuda/util/cuda_matrix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace micm
/// @returns Error code from copying to destination device memory from source device memory, if any
cudaError_t CopyToDeviceFromDevice(CudaMatrixParam& vectorMatrixDest, const CudaMatrixParam& vectorMatrixSrc);


/// @brief Fills a CUDA matrix with a specified value
/// @param param Struct containing allocated device memory
/// @param val Value to fill the matrix with
Expand Down
6 changes: 4 additions & 2 deletions include/micm/cuda/util/cuda_sparse_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ namespace micm
{
if constexpr (std::is_same_v<T, int>)
{
// the cudaMemset function only works for integer types and is an asynchronous function: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a
CHECK_CUDA_ERROR(cudaMemset(this->param_.d_data_, val, sizeof(double) * this->param_.number_of_elements_), "cudaMemset");
// the cudaMemset function only works for integer types and is an asynchronous function:
// https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a
CHECK_CUDA_ERROR(
cudaMemset(this->param_.d_data_, val, sizeof(double) * this->param_.number_of_elements_), "cudaMemset");
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/util/cuda_matrix.cu
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright (C) 2023-2024 National Center for Atmospheric Research
// SPDX-License-Identifier: Apache-2.0
#include <micm/cuda/util/cuda_matrix.cuh>
#include <micm/util/internal_error.hpp>
#include <micm/cuda/util/cuda_param.hpp>
#include <micm/util/internal_error.hpp>

#include <cuda_runtime.h>

#include <vector>
Expand Down

0 comments on commit 18c855f

Please sign in to comment.