From 13a724ac78666a550436acaad18a9218641fc7ab Mon Sep 17 00:00:00 2001 From: Pratik Nayak Date: Fri, 28 Jun 2024 11:01:49 +0200 Subject: [PATCH] [cuda] rem deprecated shmem config guard --- cuda/base/kernel_config.hpp | 60 --------------------------- cuda/solver/batch_bicgstab_kernels.cu | 4 -- cuda/solver/batch_cg_kernels.cu | 4 -- 3 files changed, 68 deletions(-) delete mode 100644 cuda/base/kernel_config.hpp diff --git a/cuda/base/kernel_config.hpp b/cuda/base/kernel_config.hpp deleted file mode 100644 index f077290b4c5..00000000000 --- a/cuda/base/kernel_config.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors -// -// SPDX-License-Identifier: BSD-3-Clause - -#ifndef GKO_CUDA_BASE_KERNEL_CONFIG_HPP_ -#define GKO_CUDA_BASE_KERNEL_CONFIG_HPP_ - - -#include - - -#include - - -namespace gko { -namespace kernels { -namespace cuda { -namespace detail { - - -template -class shared_memory_config_guard { -public: - using value_type = ValueType; - shared_memory_config_guard() : original_config_{} - { - GKO_ASSERT_NO_CUDA_ERRORS( - cudaDeviceGetSharedMemConfig(&original_config_)); - - if (sizeof(value_type) == 4) { - GKO_ASSERT_NO_CUDA_ERRORS( - cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeFourByte)); - } else if (sizeof(value_type) % 8 == 0) { - GKO_ASSERT_NO_CUDA_ERRORS( - cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeEightByte)); - } else { - GKO_ASSERT_NO_CUDA_ERRORS( - cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeDefault)); - } - } - - - ~shared_memory_config_guard() - { - // No need to exit or throw if we cant set the value back. - cudaDeviceSetSharedMemConfig(original_config_); - } - -private: - cudaSharedMemConfig original_config_; -}; - - -} // namespace detail -} // namespace cuda -} // namespace kernels -} // namespace gko - - -#endif // GKO_CUDA_BASE_KERNEL_CONFIG_HPP_ diff --git a/cuda/solver/batch_bicgstab_kernels.cu b/cuda/solver/batch_bicgstab_kernels.cu index 58e1a6b7b0d..7024c888c2c 100644 --- a/cuda/solver/batch_bicgstab_kernels.cu +++ b/cuda/solver/batch_bicgstab_kernels.cu @@ -21,7 +21,6 @@ #include "core/matrix/batch_struct.hpp" #include "core/solver/batch_dispatch.hpp" #include "cuda/base/batch_struct.hpp" -#include "cuda/base/kernel_config.hpp" #include "cuda/base/thrust.cuh" #include "cuda/components/reduction.cuh" #include "cuda/components/thread_ids.cuh" @@ -146,9 +145,6 @@ public: constexpr int align_multiple = 8; const int padded_num_rows = ceildiv(mat.num_rows, align_multiple) * align_multiple; - auto shem_guard = - gko::kernels::cuda::detail::shared_memory_config_guard< - value_type>(); const int shmem_per_blk = get_max_dynamic_shared_memory(exec_); diff --git a/cuda/solver/batch_cg_kernels.cu b/cuda/solver/batch_cg_kernels.cu index 398e831eb09..1a685d49423 100644 --- a/cuda/solver/batch_cg_kernels.cu +++ b/cuda/solver/batch_cg_kernels.cu @@ -20,7 +20,6 @@ #include "core/matrix/batch_struct.hpp" #include "core/solver/batch_dispatch.hpp" #include "cuda/base/batch_struct.hpp" -#include "cuda/base/kernel_config.hpp" #include "cuda/base/thrust.cuh" #include "cuda/components/reduction.cuh" #include "cuda/components/thread_ids.cuh" @@ -144,9 +143,6 @@ public: constexpr int align_multiple = 8; const int padded_num_rows = ceildiv(mat.num_rows, align_multiple) * align_multiple; - auto shem_guard = - gko::kernels::cuda::detail::shared_memory_config_guard< - value_type>(); const int shmem_per_blk = get_max_dynamic_shared_memory(exec_);