Default OPT_LEVEL=-O3 for experiments and make it overridable#10
Open
Default OPT_LEVEL=-O3 for experiments and make it overridable#10
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
-O3にしつつ環境変数で簡単に上書き可能にします。Makefileが最適化フラグを直書きしていたため、上書き性と一貫性を改善します。Description
Makefileを更新してOPT_LEVEL ?= -O3を追加し、CFLAGSをCFLAGS ?= $(OPT_LEVEL) ...の形式に変更しました (distance_computation_simd,image_processing_simd,gemm_cache_optimization,kdtree_nearest_neighbor,mandelbrot_simd) 。CC/CFLAGSを?=に切り替え、外部からの上書きを可能にしました。README.mdを更新して、すべての実験でデフォルトが-O3であることと環境変数OPT_LEVELによる上書き方法(例:-O0,-O2,-Ofast)を明記し、実行例を追加しました。Testing
-O3を含むことをmake -C <dir> -nで確認し、すべて成功しました(例:make -C distance_computation_simd -n)。OPT_LEVEL=-O0を指定した場合に-O0へ切り替わることをmake -C <dir> -n OPT_LEVEL=-O0で確認し、すべて成功しました。for d in distance_computation_simd image_processing_simd gemm_cache_optimization dgemm dgemv kdtree_nearest_neighbor mandelbrot_simd; do make -C "$d" -n | head -n 2; make -C "$d" -n OPT_LEVEL=-O0 | head -n 2; doneを実行して期待どおりのフラグ切替を検証し、成功しました。Codex Task