Skip to content

Commit

Permalink
feat: time to update running image to ubt-22.04 and ubt-24.04
Browse files Browse the repository at this point in the history
and update compiler to gcc11

Signed-off-by: Certseeds <[email protected]>
  • Loading branch information
Certseeds committed Aug 6, 2024
1 parent 2db549e commit ebe8fe5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
os: [ ubuntu-22.04, ubuntu-24.04 ]
env:
CC: gcc-10
CXX: g++-10
CC: gcc-12
CXX: g++-12
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
os: [ ubuntu-22.04, ubuntu-24.04 ]
env:
CC: gcc-10
CXX: g++-10
CC: gcc-12
CXX: g++-12
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
os: [ ubuntu-22.04, ubuntu-24.04 ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
os: [ ubuntu-22.04, ubuntu-24.04 ]
env:
CC: gcc-10
CXX: g++-10
CC: gcc-12
CXX: g++-12
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest,ubuntu-20.04, ubuntu-22.04 ]
os: [ windows-latest,ubuntu-22.04, ubuntu-24.04 ]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
name: test dev
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
33 changes: 7 additions & 26 deletions algorithm/matrix/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,46 +486,33 @@ struct number : public Expression<number<T>> {

// work function, computing this expression at position i, import for lazy computing

T value(size_t i, size_t j) const { return this->num; }
T value(size_t i, size_t j) const { return this->num;}

//before invoke, invoke the ~number
// 感觉是优化错误

size_t rows() const { return 0x3f3f3f3f; }

size_t cols() const { return 0x3f3f3f3f; }

};

template<opencv_type T>
static number<T> make_number(T t){
return number<T>(t);
}

template<typename T1, typename T2>
inline EXPRESSION::BinaryOp<Add, T1, T2>
operator+(const Expression<T1> &lhs, const Expression<T2> &rhs) {
return expToBinaryOp<Add>(lhs, rhs);
}

template<typename T1, opencv_type T2>
inline EXPRESSION::BinaryOp<Add, T1, number<T2>>
operator+(const Expression<T1> &lhs, const T2 &rhs) {
return expToBinaryOp<Add>(lhs, number<T2>(rhs));
}

template<typename T1, opencv_type T2>
inline EXPRESSION::BinaryOp<Add, number<T1>, T2>
operator+(const T1 &lhs, const Expression<T2> &rhs) {
return expToBinaryOp<Add>(rhs, lhs);
}

/**
* matrix + matrix, must equal.
* * input mat1,mat2 and will_return's type is same.
* */


template<opencv_type T1, typename T2>
inline EXPRESSION::BinaryOp<Add, number<T1>, T2>
operator-(const T1 &lhs, const Expression<T2> &rhs) {
return expToBinaryOp<Add>(number<T2>(lhs * -1), rhs);
}

/**
* matrix - matrix, must equal.
* input mat1,mat2 and will_return's type is same.
Expand All @@ -536,12 +523,6 @@ operator-(const Expression<T1> &lhs, const Expression<T2> &rhs) {
return expToBinaryOp<Minus>(lhs, rhs);
}

template<typename T1, opencv_type T2>
inline EXPRESSION::BinaryOp<Minus, T1, number<T2>>
operator-(const Expression<T1> &lhs, const T2 &rhs) {
return expToBinaryOp<Minus>(lhs, number<T2>(rhs));
}


/**
* matrix * number, need T1 can * T2
Expand Down
4 changes: 2 additions & 2 deletions algorithm/matrix/matrix_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ TEST_CASE("operator plus", "[test_3]") {
m25 = m2 + m5;
Matrix<int32_t> m36{m3 + m6};
Matrix<int32_t> temp = m1 + m4 + m7;
Matrix<int32_t> temp2 = m1 + m4 + m7 + 2;
Matrix<int32_t> temp4 = m1 + m4 + 2 + m7;
Matrix<int32_t> temp2 = m1 + m4 + m7 + make_number(2);
Matrix<int32_t> temp4 = m1 + m4 + make_number(2) + m7;
CHECK(Matrix<int32_t>::inside_equal(m1 + m4, m7));
CHECK(Matrix<int32_t>::inside_equal(m14, m7));
CHECK(Matrix<int32_t>::inside_equal(m2 + m5, m8));
Expand Down

0 comments on commit ebe8fe5

Please sign in to comment.