This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (c) 2021 Cem Bassoy, cem.bassoy@gmail.com | |
// Copyright (c) 2021, Amit Singh, amitsingh19975@gmail.com | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
// The authors gratefully acknowledge the support of | |
// Google and Fraunhofer IOSB, Ettlingen, Germany |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ub = boost::numeric::ublas; | |
int main(){ | |
using namespace ub::literals; | |
/// dynamic span | |
{ | |
// span[first: 0, last: 600, step: 4] | |
auto s1 = ub::span<>(0,600,4); | |
// span[first: 0, last: 600, step: 4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (c) 2018-2020, Cem Bassoy, cem.bassoy@gmail.com | |
// Copyright (c) 2019-2020, Amit Singh, amitsingh19975@gmail.com | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
// The authors gratefully acknowledge the support of | |
// Google and Fraunhofer IOSB, Ettlingen, Germany |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <std::size_t q, typename TensorEngine1, typename TensorEngine2, std::size_t... Ss1, std::size_t... Ss2> | |
inline decltype(auto) prod(tensor_core< TensorEngine1 > const &a, tensor_core< TensorEngine2 > const &b, | |
std::integer_sequence<std::size_t, Ss1...>, std::integer_sequence<std::size_t, Ss2...>) | |
{ | |
using tensor_type = tensor_core< TensorEngine1 >; | |
using extents_type_1 = typename tensor_type::extents_type; | |
using extents_type_2 = typename tensor_core< TensorEngine2 >::extents_type; | |
using value_type = typename tensor_type::value_type; | |
using layout_type = typename tensor_type::layout_type; | |
using size_type = typename extents_type_1::size_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !defined(AMT_EVAL_HPP) | |
#define AMT_EVAL_HPP | |
#include "exp.hpp" | |
#include <tuple> | |
#include <boost/numeric/ublas/tensor.hpp> | |
#include <boost/fusion/include/for_each.hpp> | |
#include <boost/fusion/tuple/tuple.hpp> | |
namespace amt{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !defined(AMT_EXP_HPP) | |
#define AMT_EXP_HPP | |
#include <tuple> | |
#include <type_traits> | |
namespace amt{ | |
template<typename... Ts> | |
struct expr_list{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(){ | |
auto s1 = ub::test::tensor_static_container<float,ub::static_extents<1,2,3>, ub::first_order>{}; | |
auto s2 = ub::test::tensor_static_container<float,ub::static_extents<1,2,3>, ub::first_order>{1}; | |
std::cout<<s1.rank()<<'\n'; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (c) 2018-2019, Cem Bassoy, cem.bassoy@gmail.com | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
// The authors gratefully acknowledge the support of | |
// Fraunhofer IOSB, Ettlingen, Germany | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/numeric/ublas/functional.hpp> | |
#include <boost/numeric/ublas/tensor/extents.hpp> | |
#include <boost/numeric/ublas/tensor/static_extents.hpp> | |
#include <boost/numeric/ublas/tensor/strides.hpp> | |
#include <boost/numeric/ublas/tensor/static_strides.hpp> | |
#include <boost/core/demangle.hpp> | |
#include <complex> | |
#include <iostream> | |
#include <type_traits> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (c) 2018-2019, Cem Bassoy, cem.bassoy@gmail.com | |
// | |
// Distributed under the Boost Software License, Version 1.0. (See | |
// accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
// The authors gratefully acknowledge the support of | |
// Fraunhofer IOSB, Ettlingen, Germany | |
// |
NewerOlder