Skip to content

Commit

Permalink
Make patch to fix eigen deprecated-this-capture
Browse files Browse the repository at this point in the history
  • Loading branch information
HeavenVolkoff committed May 18, 2024
1 parent 4a70fa2 commit fb0bac1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ RUN --mount=type=cache,target=/root/.cache `
FROM layer-20 AS layer-99-onnx

RUN --mount=type=cache,target=/root/.cache `
--mount=type=bind,source=patches/99-onnx,target="${PREFIX}/patches" `
--mount=type=bind,source=stages/99-onnx.sh,target=/srv/stage.sh `
/srv/build.sh

Expand Down
6 changes: 1 addition & 5 deletions stages/99-onnx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ case "$TARGET" in
esac

# Fix eigen deprecated-this-capture
sed -i 's/pool_->Schedule([=, &handleRange]() { handleRange(midIdx, lastIdx); });/pool_->Schedule([=, this, &handleRange]() { handleRange(midIdx, lastIdx); });/' _deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
sed -i 's/handleRange = [=, &handleRange, &barrier, &f](Index firstIdx,/handleRange = [=, this, &handleRange, &barrier, &f](Index firstIdx,/' _deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
sed -i 's/[=]() { kernel(m, n, k, use_thread_local); });/[=, this]() { kernel(m, n, k, use_thread_local); });/' _deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h
sed -i 's/[=]() { enqueue_packing_helper(mid, end, k, rhs); });/[=, this]() { enqueue_packing_helper(mid, end, k, rhs); });/' _deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h
sed -i 's/[=]() { enqueue_packing_helper(start, end, k, rhs); });/[=, this]() { enqueue_packing_helper(start, end, k, rhs); });/' _deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h
patch -F5 -lp1 -d _deps/eigen-src -t <"$PREFIX"/patches/eigen_fix_deprecated_this_capture.patch

# Regenerate build files after cmake patches
env PREFIX="$OUT" cmake "${args[@]}" ../cmake
Expand Down

0 comments on commit fb0bac1

Please sign in to comment.