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

Add new accessor #643

Merged
merged 49 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0bc74d1
Create new accessor in range_accessors.hpp
Sep 11, 2020
fc9feb2
Make accessor range compatible
Sep 14, 2020
de4d940
Half-way of integrating proper const support
Sep 15, 2020
fac69fe
Finish proper const-type support
Sep 15, 2020
1d794d5
Add constexpr everywhere in accessor
Sep 15, 2020
e5e0ade
Attempt to fix thrust::complex conversion issue
Sep 15, 2020
21da296
Add workaround for CUDA for reference casting
Sep 17, 2020
e07d8e4
Use better workaround for CUDA references
Sep 17, 2020
312b219
Rename and document new accessors properly
Sep 17, 2020
d0cf243
Make reduce_storage test more detailed
Sep 18, 2020
e9a5fb8
Add more range tests
Sep 21, 2020
4b2e84b
Update std::tuple initialization in range test
Sep 22, 2020
bff9347
Add more tests; Make scale_ a std::array
Sep 22, 2020
f16ff7f
Apply newer clang-format to range.hpp
Sep 25, 2020
5f8245a
Add TODO
Sep 30, 2020
13b619f
Apply review suggestions
Oct 19, 2020
7703290
Add better documentation; add stride mask template
Oct 25, 2020
0316929
Add multidimension support to new accessors
Nov 9, 2020
3fe7b06
Decrease number constructors of reduced_row_major
Nov 9, 2020
3361108
Make intent of constructors clear
Nov 9, 2020
d80f307
Add multidim support for scaled_reduced_row_major
Nov 10, 2020
59f42fb
Make copy_from and Span test multidim compatible
Nov 10, 2020
091e356
Make Accessor tests typed
Nov 10, 2020
0550e59
Review update
Nov 10, 2020
48fec05
Fix compiler error in accessor test
Nov 12, 2020
87d4397
Add separate stride for scalar
Nov 12, 2020
795d77c
Add scalar_stride for scaled_reduced_row_major
Nov 16, 2020
be385b7
Add additional braces around array initialization
Nov 16, 2020
cc17d83
Fix intel compiler error
Nov 16, 2020
d2173d2
Add missing include in range_accessor_references.hpp
Nov 17, 2020
f58eaac
Code quality improvement
Nov 17, 2020
7869588
Review update
Nov 17, 2020
eac623f
Remove inlining for constexpr
Nov 17, 2020
1539c47
Only use forwarding references when forwarding
Nov 17, 2020
722f42a
Fix more sonarcloud code smells
Nov 17, 2020
c57b13d
Fix OMP Jacobi test error
Nov 18, 2020
9ffba01
Add gko::half to the accessor testing
Nov 18, 2020
5aa794d
Specify return type of reference operators again
Nov 19, 2020
941a287
Move new accessor to private headers
Nov 19, 2020
0aa9bb3
Add numeric_limits to gko::half
Nov 27, 2020
b7816e9
Move compute_default_stride_array to dim header
Nov 27, 2020
de70976
Move are_all_integral to types.hpp
Nov 27, 2020
a599ddd
Format files
ginkgo-bot Dec 7, 2020
980ac87
Only add write scalar option when non-const
Jan 11, 2021
fcddab6
Include complex numbers in accessor tests
Jan 13, 2021
c6e80a0
Format files
ginkgo-bot Jan 13, 2021
43caec5
Update interface for scalar handling
Jan 13, 2021
5f787ce
Review update
Jan 15, 2021
07f6478
Review update
Jan 21, 2021
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
578 changes: 578 additions & 0 deletions core/base/accessor_helper.hpp

Large diffs are not rendered by default.

469 changes: 469 additions & 0 deletions core/base/accessor_references.hpp

Large diffs are not rendered by default.

750 changes: 750 additions & 0 deletions core/base/accessors.hpp

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions core/base/extended_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define GKO_CORE_BASE_EXTENDED_FLOAT_HPP_


#include <limits>
#include <type_traits>


Expand Down Expand Up @@ -550,6 +551,31 @@ class complex<gko::truncated<T, NumComponents>> {
};


template <>
struct is_scalar<gko::half> : std::true_type {};


template <>
struct numeric_limits<gko::half> {
static constexpr bool is_specialized{true};
static constexpr bool is_signed{true};
static constexpr bool is_integer{false};
static constexpr bool is_exact{false};
static constexpr bool is_bounded{true};
static constexpr bool is_modulo{false};
static constexpr int digits{
gko::detail::float_traits<gko::half>::significand_bits + 1};
// 3/10 is approx. log_10(2)
static constexpr int digits10{digits * 3 / 10};

// Note: gko::half can't return gko::half here because it does not have
// a constexpr constructor.
static constexpr float epsilon()
{
return gko::detail::float_traits<gko::half>::eps;
}
};

} // namespace std


Expand Down
1 change: 1 addition & 0 deletions core/test/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ginkgo_create_test(abstract_factory)
ginkgo_create_test(accessors_reduced_storage)
ginkgo_create_test(allocator)
ginkgo_create_test(array)
ginkgo_create_test(combination)
Expand Down
Loading