DU Results -

Source patches

du5matrix.hpp

161,163c161,164
< 	template<int a, int b, int c, int d> struct shuffle_control {
< 		static const int value = ((d & 0b11) << 6) + ((c & 0b11) << 4) + ((b & 0b11) << 2) + (a & 0b11);
< 	};
---
> 	static constexpr int shuffle_control(int a, int b, int c, int d) {
> 		a &= 0b11; b &= 0b11; c &= 0b11; d &= 0b11;
> 		return (d << 6) + (c << 4) + (b << 2) + a;
> 	}
170c171
< 		const auto swap_rows = shuffle_control<2,3,0,1>::value;
---
> 		const auto swap_rows = shuffle_control(2,3,0,1);
178,181c179,182
< 		res.up = _mm_shufflelo_epi16(block.up, shuffle_control<c1,c1,c1,c1>::value);
< 		res.up = _mm_shufflehi_epi16(res.up,   shuffle_control<c2,c2,c2,c2>::value);
< 		res.dn = _mm_shufflelo_epi16(block.dn, shuffle_control<c3,c3,c3,c3>::value);
< 		res.dn = _mm_shufflehi_epi16(res.dn,   shuffle_control<c4,c4,c4,c4>::value);
---
> 		res.up = _mm_shufflelo_epi16(block.up, shuffle_control(c1,c1,c1,c1));
> 		res.up = _mm_shufflehi_epi16(res.up,   shuffle_control(c2,c2,c2,c2));
> 		res.dn = _mm_shufflelo_epi16(block.dn, shuffle_control(c3,c3,c3,c3));
> 		res.dn = _mm_shufflehi_epi16(res.dn,   shuffle_control(c4,c4,c4,c4));
242,244c243,246
< 	template<int a, int b, int c, int d> struct shuffle_control {
< 		static const int value = ((d & 0b11) << 6) + ((c & 0b11) << 4) + ((b & 0b11) << 2) + (a & 0b11);
< 	};
---
> 	static constexpr int shuffle_control(int a, int b, int c, int d) {
> 		a &= 0b11; b &= 0b11; c &= 0b11; d &= 0b11;
> 		return (d << 6) + (c << 4) + (b << 2) + a;
> 	}
257c259
< 		block = _mm256_permute4x64_epi64(block, shuffle_control<1,0,3,2>::value);
---
> 		block = _mm256_permute4x64_epi64(block, shuffle_control(1,0,3,2));
266,269c268,271
< 		up = _mm256_shufflelo_epi16(block, shuffle_control<c1,c1,c1,c1>::value);
< 		up = _mm256_shufflehi_epi16(up,    shuffle_control<c2,c2,c2,c2>::value);
< 		dn = _mm256_shufflelo_epi16(block, shuffle_control<c3,c3,c3,c3>::value);
< 		dn = _mm256_shufflehi_epi16(dn,    shuffle_control<c4,c4,c4,c4>::value);
---
> 		up = _mm256_shufflelo_epi16(block, shuffle_control(c1,c1,c1,c1));
> 		up = _mm256_shufflehi_epi16(up,    shuffle_control(c2,c2,c2,c2));
> 		dn = _mm256_shufflelo_epi16(block, shuffle_control(c3,c3,c3,c3));
> 		dn = _mm256_shufflehi_epi16(dn,    shuffle_control(c4,c4,c4,c4));
345,347c347,350
< 	template<int a, int b, int c, int d> struct shuffle_control {
< 		static const int value = ((d & 0b11) << 6) + ((c & 0b11) << 4) + ((b & 0b11) << 2) + (a & 0b11);
< 	};
---
> 	static constexpr int shuffle_control(int a, int b, int c, int d) {
> 		a &= 0b11; b &= 0b11; c &= 0b11; d &= 0b11;
> 		return (d << 6) + (c << 4) + (b << 2) + a;
> 	}
360c363
< 		const auto control = shuffle_control<2,3,0,1>::value;
---
> 		const auto control = shuffle_control(2,3,0,1);

Flex error reports

C++ error reports

du5main.cpp

d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(230): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(228): note: while compiling class template member function 'data_3<matrix<use_sse::policy>>::data_3(std::size_t,std::size_t,std::size_t)'
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(126): note: see reference to function template instantiation 'data_3<matrix<use_sse::policy>>::data_3(std::size_t,std::size_t,std::size_t)' being compiled
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(136): note: see reference to class template instantiation 'data_3<matrix<use_sse::policy>>' being compiled
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\testbed.hpp(338): note: see reference to class template instantiation 'generator_3<data,policy_zero>' being compiled
du5main.cpp(43): note: see reference to function template instantiation 'std::shared_ptr<abstract_generator<std::SP,SQ>> make_generic_generator_task<generator_3<data,policy_zero>,task_5,std::size_t>(void)' being compiled
        with
        [
            SP=std::size_t,
            SQ=time_complexity
        ]
du5main.cpp(96): note: see reference to function template instantiation 'void use<use_sse>(generator_list<std::size_t,time_complexity> &)' being compiled
D:\Users\bednarek\@SVN\NPRG054\studenti\20162\Hlavaty_Ondrej_74906938\du5matrix.hpp(49): warning C4267: 'return': conversion from 'size_t' to 'unsigned int', possible loss of data
D:\Users\bednarek\@SVN\NPRG054\studenti\20162\Hlavaty_Ondrej_74906938\du5matrix.hpp(54): note: see reference to function template instantiation 'T matrix<use_sse::policy>::ceil_div<unsigned int>(const T &,std::size_t)' being compiled
        with
        [
            T=unsigned int
        ]
D:\Users\bednarek\@SVN\NPRG054\studenti\20162\Hlavaty_Ondrej_74906938\du5matrix.hpp(54): note: see reference to function template instantiation 'T matrix<use_sse::policy>::ceil_div<unsigned int>(const T &,std::size_t)' being compiled
        with
        [
            T=unsigned int
        ]
D:\Users\bednarek\@SVN\NPRG054\studenti\20162\Hlavaty_Ondrej_74906938\du5matrix.hpp(53): note: while compiling class template member function 'matrix<use_sse::policy>::matrix(unsigned int,unsigned int)'
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(229): note: see reference to function template instantiation 'matrix<use_sse::policy>::matrix(unsigned int,unsigned int)' being compiled
d:\users\bednarek\@svn\nprg054\du\du5matrix\makaa\task5.hpp(233): note: see reference to class template instantiation 'matrix<use_sse::policy>' being compiled
d:\users\bednarek\@svn\nprg054\studenti\20162\hlavaty_ondrej_74906938\du5matrix.hpp(187) : warning C4700: uninitialized local variable 'res' used

Linker error reports

Run output diffs

empty.in

size	mul/matrix_zero	mul/matrix_random	mul/matrix_one
64	0.100018	0.100018	0.100018
128	0.0971706	0.0971706	0.0971706
256	0.0969838	0.0990043	0.0979941
512	0.176685	0.175621	0.176685
1024	0.177883	0.176951	0.176951
2048	0.345637	0.36601	0.37055