Skip to main content
added 87 characters in body
Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94

Setting SetSystemOptions[ "CompileOptions" -> "CompileReportExternal"->True] will emit a message when parts of your function do not get compiled. After compilation, Needs["CompiledFunctionTools`"] followed by CompilePrint[cF] (with cF the function you have compiled will display some bytecode; looking for CopyTensor or MainEvaluate in that helps locate inefficiencies (MainEvaluate calls the main mma kernel, so it effectively means not compiling).

Other useful options may be found by evaluating SystemOptions["CompileOptions"]

EDIT: As suggested by Oleksandr in a comment, On[Compile::noinfo] is also useful.

Setting SetSystemOptions[ "CompileOptions" -> "CompileReportExternal"->True] will emit a message when parts of your function do not get compiled. After compilation, Needs["CompiledFunctionTools`"] followed by CompilePrint[cF] (with cF the function you have compiled will display some bytecode; looking for CopyTensor or MainEvaluate in that helps locate inefficiencies (MainEvaluate calls the main mma kernel, so it effectively means not compiling).

Other useful options may be found by evaluating SystemOptions["CompileOptions"]

Setting SetSystemOptions[ "CompileOptions" -> "CompileReportExternal"->True] will emit a message when parts of your function do not get compiled. After compilation, Needs["CompiledFunctionTools`"] followed by CompilePrint[cF] (with cF the function you have compiled will display some bytecode; looking for CopyTensor or MainEvaluate in that helps locate inefficiencies (MainEvaluate calls the main mma kernel, so it effectively means not compiling).

Other useful options may be found by evaluating SystemOptions["CompileOptions"]

EDIT: As suggested by Oleksandr in a comment, On[Compile::noinfo] is also useful.

Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94

Setting SetSystemOptions[ "CompileOptions" -> "CompileReportExternal"->True] will emit a message when parts of your function do not get compiled. After compilation, Needs["CompiledFunctionTools`"] followed by CompilePrint[cF] (with cF the function you have compiled will display some bytecode; looking for CopyTensor or MainEvaluate in that helps locate inefficiencies (MainEvaluate calls the main mma kernel, so it effectively means not compiling).

Other useful options may be found by evaluating SystemOptions["CompileOptions"]