Nvidia のリリース ノートから:
The nvcc compiler switch, --fmad (short name: -fmad), to control the contraction of
floating-point multiplies and add/subtracts into floating-point multiply-add
operations (FMAD, FFMA, or DFMA) has been added:
--fmad=true and --fmad=false enables and disables the contraction respectively.
This switch is supported only when the --gpu-architecture option is set with
compute_20, sm_20, or higher. For other architecture classes, the contraction is
always enabled.
The --use_fast_math option implies --fmad=true, and enables the contraction.
私は 2 つのカーネルを持っています。1 つは多くの乗算で純粋に計算バウンドですが、もう 1 つはメモリ バウンドです。実行すると、計算集約型カーネルのパフォーマンスが一貫して向上し (約 5%) -fmad=false
、メモリ バウンド カーネルをオフにすると、パフォーマンスがほぼ同じ割合で低下します。したがって、FMA はメモリに制約のあるカーネルではうまく機能しますが、コンピューティングに制約のあるカーネルは、オフにすることでパフォーマンスを少し圧迫する可能性があります。その理由は何ですか?私のデバイスは M2090 で、CUDA 4.2 を使用しています。
完全なコンパイル オプション:
(または、とにかくそれがデフォルトであるため、-arch,sm_20,-ftz=true,-prec-div=false,-prec-sqrt=false,-use_fast_math,-fmad=false
単に削除します。fmad=false