Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split common kernels #855

Merged
merged 3 commits into from
Aug 9, 2021
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
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_COMMON_BASE_KERNEL_LAUNCH_HPP_
#define GKO_COMMON_BASE_KERNEL_LAUNCH_HPP_
#ifndef GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_HPP_
#define GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_HPP_


#include <type_traits>
Expand Down Expand Up @@ -280,4 +280,4 @@ typename to_device_type_impl<T>::type map_to_device(T &&param)
#endif


#endif // GKO_COMMON_BASE_KERNEL_LAUNCH_HPP_
#endif // GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_COMMON_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#define GKO_COMMON_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#ifndef GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#define GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_SOLVER_HPP_


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down Expand Up @@ -146,4 +146,4 @@ const device_type<ValueType> *row_vector(const matrix::Dense<ValueType> *mtx)
#endif


#endif // GKO_COMMON_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#endif // GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_SOLVER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "core/components/precision_conversion.hpp"


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch_solver.hpp"
#include "common/unified/base/kernel_launch_solver.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch_solver.hpp"
#include "common/unified/base/kernel_launch_solver.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch_solver.hpp"
#include "common/unified/base/kernel_launch_solver.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch_solver.hpp"
#include "common/unified/base/kernel_launch_solver.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/math.hpp>


#include "common/base/kernel_launch_solver.hpp"
#include "common/unified/base/kernel_launch_solver.hpp"


namespace gko {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "core/solver/ir_kernels.hpp"


#include "common/base/kernel_launch.hpp"
#include "common/unified/base/kernel_launch.hpp"


namespace gko {
Expand Down
24 changes: 12 additions & 12 deletions cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ find_library(CURAND curand

add_library(ginkgo_cuda $<TARGET_OBJECTS:ginkgo_cuda_device> "")
set(GKO_CUDA_COMMON_SOURCES
../common/components/precision_conversion.cpp
../common/matrix/coo_kernels.cpp
../common/matrix/csr_kernels.cpp
../common/matrix/dense_kernels.cpp
../common/matrix/diagonal_kernels.cpp
../common/preconditioner/jacobi_kernels.cpp
../common/solver/bicg_kernels.cpp
../common/solver/bicgstab_kernels.cpp
../common/solver/cg_kernels.cpp
../common/solver/cgs_kernels.cpp
../common/solver/fcg_kernels.cpp
../common/solver/ir_kernels.cpp
../common/unified/components/precision_conversion.cpp
../common/unified/matrix/coo_kernels.cpp
../common/unified/matrix/csr_kernels.cpp
../common/unified/matrix/dense_kernels.cpp
../common/unified/matrix/diagonal_kernels.cpp
../common/unified/preconditioner/jacobi_kernels.cpp
../common/unified/solver/bicg_kernels.cpp
../common/unified/solver/bicgstab_kernels.cpp
../common/unified/solver/cg_kernels.cpp
../common/unified/solver/cgs_kernels.cpp
../common/unified/solver/fcg_kernels.cpp
../common/unified/solver/ir_kernels.cpp
)
target_sources(ginkgo_cuda
PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion cuda/base/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace gko {


#include "common/base/executor.hpp.inc"
#include "common/cuda_hip/base/executor.hpp.inc"


std::shared_ptr<CudaExecutor> CudaExecutor::create(
Expand Down
5 changes: 3 additions & 2 deletions cuda/base/kernel_launch.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_COMMON_BASE_KERNEL_LAUNCH_HPP_
#error "This file can only be used from inside common/base/kernel_launch.hpp"
#ifndef GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_HPP_
#error \
"This file can only be used from inside common/unified/base/kernel_launch.hpp"
#endif


Expand Down
4 changes: 2 additions & 2 deletions cuda/base/kernel_launch_solver.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_COMMON_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#ifndef GKO_COMMON_UNIFIED_BASE_KERNEL_LAUNCH_SOLVER_HPP_
#error \
"This file can only be used from inside common/base/kernel_launch_solver.hpp"
"This file can only be used from inside common/unified/base/kernel_launch_solver.hpp"
#endif


Expand Down
2 changes: 1 addition & 1 deletion cuda/base/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace gko {


#include "common/base/math.hpp.inc"
#include "common/cuda_hip/base/math.hpp.inc"


} // namespace gko
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/absolute_array.cu
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace components {
constexpr int default_block_size = 512;


#include "common/components/absolute_array.hpp.inc"
#include "common/cuda_hip/components/absolute_array.hpp.inc"


template <typename ValueType>
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/atomic.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace kernels {
namespace cuda {


#include "common/components/atomic.hpp.inc"
#include "common/cuda_hip/components/atomic.hpp.inc"


/**
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/diagonal_block_manipulation.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace cuda {
namespace csr {


#include "common/components/diagonal_block_manipulation.hpp.inc"
#include "common/cuda_hip/components/diagonal_block_manipulation.hpp.inc"


} // namespace csr
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/fill_array.cu
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace components {
constexpr int default_block_size = 512;


#include "common/components/fill_array.hpp.inc"
#include "common/cuda_hip/components/fill_array.hpp.inc"


template <typename ValueType>
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/intrinsics.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace kernels {
namespace cuda {


#include "common/components/intrinsics.hpp.inc"
#include "common/cuda_hip/components/intrinsics.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/merging.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace kernels {
namespace cuda {


#include "common/components/merging.hpp.inc"
#include "common/cuda_hip/components/merging.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/prefix_sum.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace kernels {
namespace cuda {


#include "common/components/prefix_sum.hpp.inc"
#include "common/cuda_hip/components/prefix_sum.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/reduction.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace cuda {
constexpr int default_block_size = 512;


#include "common/components/reduction.hpp.inc"
#include "common/cuda_hip/components/reduction.hpp.inc"


/**
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/searching.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace kernels {
namespace cuda {


#include "common/components/searching.hpp.inc"
#include "common/cuda_hip/components/searching.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/segment_scan.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace kernels {
namespace cuda {


#include "common/components/segment_scan.hpp.inc"
#include "common/cuda_hip/components/segment_scan.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/sorting.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace kernels {
namespace cuda {


#include "common/components/sorting.hpp.inc"
#include "common/cuda_hip/components/sorting.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/thread_ids.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace cuda {
namespace thread {


#include "common/components/thread_ids.hpp.inc"
#include "common/cuda_hip/components/thread_ids.hpp.inc"


} // namespace thread
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/uninitialized_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace kernels {
namespace cuda {


#include "common/components/uninitialized_array.hpp.inc"
#include "common/cuda_hip/components/uninitialized_array.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/components/warp_blas.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace kernels {
namespace cuda {


#include "common/components/warp_blas.hpp.inc"
#include "common/cuda_hip/components/warp_blas.hpp.inc"


} // namespace cuda
Expand Down
2 changes: 1 addition & 1 deletion cuda/factorization/factorization_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace factorization {
constexpr int default_block_size{512};


#include "common/factorization/factorization_kernels.hpp.inc"
#include "common/cuda_hip/factorization/factorization_kernels.hpp.inc"


template <typename ValueType, typename IndexType>
Expand Down
2 changes: 1 addition & 1 deletion cuda/factorization/par_ic_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ using compiled_kernels =
syn::value_list<int, 1, 2, 4, 8, 16, 32, config::warp_size>;


#include "common/factorization/par_ic_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ic_kernels.hpp.inc"


template <typename ValueType, typename IndexType>
Expand Down
4 changes: 2 additions & 2 deletions cuda/factorization/par_ict_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ using compiled_kernels =
syn::value_list<int, 1, 2, 4, 8, 16, 32, config::warp_size>;


#include "common/factorization/par_ict_spgeam_kernels.hpp.inc"
#include "common/factorization/par_ict_sweep_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ict_spgeam_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ict_sweep_kernels.hpp.inc"


namespace {
Expand Down
2 changes: 1 addition & 1 deletion cuda/factorization/par_ilu_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace par_ilu_factorization {
constexpr int default_block_size{512};


#include "common/factorization/par_ilu_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ilu_kernels.hpp.inc"


template <typename ValueType, typename IndexType>
Expand Down
4 changes: 2 additions & 2 deletions cuda/factorization/par_ilut_approx_filter_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ using compiled_kernels =
syn::value_list<int, 1, 2, 4, 8, 16, 32, config::warp_size>;


#include "common/factorization/par_ilut_filter_kernels.hpp.inc"
#include "common/factorization/par_ilut_select_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ilut_filter_kernels.hpp.inc"
#include "common/cuda_hip/factorization/par_ilut_select_kernels.hpp.inc"


template <int subwarp_size, typename ValueType, typename IndexType>
Expand Down
Loading