Skip to content

Commit

Permalink
cppcore: implement memoization once for all features (#323)
Browse files Browse the repository at this point in the history
* use template to reduce duplication in getMapData

* update imports in test_cppcore.py

* cppcore: perform memoization once for all features

* getFeature to use templates to reduce duplication

* DBG: add gcc --version to ci

* Set C++17 standard

* don't install gcc manually

* tell ci to use Ubuntu22.04

* enable warnings, remove unused variables

* move getMapData implementations to cfeature.cpp
  • Loading branch information
anilbey authored Oct 17, 2023
1 parent 6cc1ccc commit 8ce1476
Show file tree
Hide file tree
Showing 16 changed files with 187 additions and 1,070 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
tag:
name: Bump version, push tag and make a release
needs: call-test-workflow
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
Expand Down Expand Up @@ -54,13 +54,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-22.04, macos-latest, windows-latest]
python: [cp38, cp39, cp310, cp311]
arch: [x86_64, amd64]
exclude:
- os: macos-latest
arch: amd64
- os: ubuntu-20.04
- os: ubuntu-22.04
arch: amd64
- os: windows-latest
arch: x86_64
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:

tarball:
name: Build tarball
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [call-test-workflow, tag]
steps:
- uses: actions/checkout@v3
Expand All @@ -111,7 +111,7 @@ jobs:

publish:
name: Release and Publish on PyPI
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [call-test-workflow, tag, wheels, tarball]
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/keep-alive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

keep-workflow-alive:
name: Keep workflow alive
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
Expand All @@ -26,10 +26,11 @@ jobs:
pip install tox tox-gh-actions
- name: Run tox
run: tox # this does not call docs
run: |
tox # this does not call docs
coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.11"]
Expand All @@ -55,7 +56,7 @@ jobs:
with:
fail_ci_if_error: false
docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
Expand Down
9 changes: 8 additions & 1 deletion efel/cppcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.12)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_BUILD_TYPE Debug)

Expand All @@ -24,6 +29,8 @@ set(FEATURESRCS Utils.cpp LibV1.cpp LibV2.cpp LibV3.cpp LibV5.cpp
mapoperations.cpp)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")


add_library(efelStatic ${FEATURESRCS})
set_target_properties(efelStatic PROPERTIES OUTPUT_NAME efel)
Expand Down
Loading

0 comments on commit 8ce1476

Please sign in to comment.