PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
execution_range.hpp
Go to the documentation of this file.
1 
12 #ifndef PLSSVM_DETAIL_EXECUTION_RANGE_HPP_
13 #define PLSSVM_DETAIL_EXECUTION_RANGE_HPP_
14 #pragma once
15 
16 #include "plssvm/detail/type_traits.hpp" // PLSSVM_REQUIRES
17 
18 #include <algorithm> // std::copy
19 #include <array> // std::array
20 #include <cstddef> // std::size_t
21 #include <initializer_list> // std::initializer_list
22 #include <iosfwd> // forward declare std::ostream
23 
24 namespace plssvm::detail {
25 
32  public:
39  execution_range(std::initializer_list<std::size_t> grid, std::initializer_list<std::size_t> block);
40 
48  template <std::size_t I, std::size_t J, PLSSVM_REQUIRES((0 < I && I <= 3 && 0 < J && J <= 3))>
49  execution_range(const std::array<std::size_t, I> &p_grid, const std::array<std::size_t, J> &p_block) {
50  std::copy(p_grid.cbegin(), p_grid.cend(), grid.begin());
51  std::copy(p_block.cbegin(), p_block.cend(), block.begin());
52  }
53 
55  std::array<std::size_t, 3> grid = { 1, 1, 1 };
57  std::array<std::size_t, 3> block = { 1, 1, 1 };
58 };
59 
66 std::ostream &operator<<(std::ostream &out, const execution_range &range);
67 
68 } // namespace plssvm::detail
69 
70 #endif // PLSSVM_DETAIL_EXECUTION_RANGE_HPP_
Class specifying a backend independent execution range.
Definition: execution_range.hpp:31
std::array< std::size_t, 3 > block
The block sizes (using the CUDA definition).
Definition: execution_range.hpp:57
std::array< std::size_t, 3 > grid
The grid sizes (using the CUDA definition).
Definition: execution_range.hpp:55
execution_range(std::initializer_list< std::size_t > grid, std::initializer_list< std::size_t > block)
Initialize the grid and block sizes using std::initializer_lists.
Namespace containing implementation details. Should not directly be used by users.
Definition: csvm.hpp:27
Defines some generic type traits used in the PLSSVM library.