Skip to content

Commit 7f1e093

Browse files
committed
Use O3,unroll-loops with SIMD pragmas
1 parent 77675e0 commit 7f1e093

File tree

13 files changed

+17
-29
lines changed

13 files changed

+17
-29
lines changed

cp-algo/linalg/matrix.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include <cassert>
99
#include <vector>
1010
#include <array>
11-
#pragma GCC push_options
12-
#pragma GCC target("avx2")
11+
CP_ALGO_SIMD_PRAGMA_PUSH
1312
namespace cp_algo::linalg {
1413
enum gauss_mode {normal, reverse};
1514

cp-algo/linalg/vector.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <iterator>
1313
#include <cassert>
1414
#include <ranges>
15-
#pragma GCC push_options
16-
#pragma GCC target("avx2")
15+
CP_ALGO_SIMD_PRAGMA_PUSH
1716
namespace cp_algo::linalg {
1817
template<typename base, class Alloc = big_alloc<base>>
1918
struct vec: std::basic_string<base, std::char_traits<base>, Alloc> {

cp-algo/math/cvector.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
#include "../util/big_alloc.hpp"
77
#include <ranges>
88
#include <bit>
9-
#pragma GCC push_options
10-
#pragma GCC target("avx2")
11-
9+
CP_ALGO_SIMD_PRAGMA_PUSH
1210
namespace stdx = std::experimental;
1311
namespace cp_algo::math::fft {
1412
static constexpr size_t flen = 4;

cp-algo/math/factorials.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
#include "../math/combinatorics.hpp"
77
#include "../number_theory/modint.hpp"
88
#include <ranges>
9-
#pragma GCC push_options
10-
#pragma GCC target("avx2")
11-
9+
CP_ALGO_SIMD_PRAGMA_PUSH
1210
namespace cp_algo::math {
1311
template<bool use_bump_alloc = false, int maxn = -1>
1412
auto facts(auto const& args) {

cp-algo/math/fft.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
#include "cvector.hpp"
77
#include <iostream>
88
#include <ranges>
9-
#pragma GCC push_options
10-
#pragma GCC target("avx2")
9+
CP_ALGO_SIMD_PRAGMA_PUSH
1110
namespace cp_algo::math::fft {
1211
template<modint_type base>
1312
struct dft {

cp-algo/math/fft64.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
#include "../random/rng.hpp"
44
#include "../math/common.hpp"
55
#include "../math/cvector.hpp"
6-
#pragma GCC push_options
7-
#pragma GCC target("avx2")
8-
6+
CP_ALGO_SIMD_PRAGMA_PUSH
97
namespace cp_algo::math::fft {
108
struct dft64 {
119
big_vector<cp_algo::math::fft::cvector> cv;

cp-algo/math/multivar.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#include "../util/big_alloc.hpp"
44
#include "../number_theory/modint.hpp"
55
#include "../math/fft.hpp"
6-
#pragma GCC push_options
7-
#pragma GCC target("avx2")
6+
CP_ALGO_SIMD_PRAGMA_PUSH
87
namespace cp_algo::math::fft {
98
template<modint_type base>
109
struct multivar {

cp-algo/math/poly.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <utility>
1313
#include <vector>
1414
#include <list>
15-
#pragma GCC push_options
16-
#pragma GCC target("avx2")
15+
CP_ALGO_SIMD_PRAGMA_PUSH
1716
namespace cp_algo::math {
1817
template<typename T>
1918
struct poly_t {

cp-algo/math/poly/impl/div.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#include "../../fft.hpp"
44
#include "../../common.hpp"
55
#include <cassert>
6-
#pragma GCC push_options
7-
#pragma GCC target("avx2")
6+
CP_ALGO_SIMD_PRAGMA_PUSH
87
// operations related to polynomial division
98
namespace cp_algo::math::poly::impl {
109
auto divmod_slow(auto const& p, auto const& q) {

cp-algo/math/poly/impl/euclid.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#include <vector>
1010
#include <tuple>
1111
#include <list>
12-
#pragma GCC push_options
13-
#pragma GCC target("avx2")
12+
CP_ALGO_SIMD_PRAGMA_PUSH
1413
// operations related to gcd and Euclidean algo
1514
namespace cp_algo::math::poly::impl {
1615
template<typename poly>

0 commit comments

Comments
 (0)