How to disable print messages from ITK functions

I am using GPUAnisotropicSmoothingFilter for running some benchmarks and the printout similar to the below appears quite a lot disrupting the outptu from the benchmark reporting tool I use. Is there a way to disable such print outs to console ?

Defines: #define DIM_2
#define BUFPIXELTYPE float
#define OUTPIXELTYPE float
#define PIXELDIM 1

Defines: #define DIM_2
#define PIXELTYPE float

Defines: #define DIM_2
#define BLOCK_SIZE 16
#define PIXELTYPE float
#define ARGTYPE float

Defines: #define DIM_2
#define BUFPIXELTYPE float
#define OUTPIXELTYPE float
#define PIXELDIM 1

Defines: #define DIM_2
#define PIXELTYPE float

Defines: #define DIM_2
#define BLOCK_SIZE 16
#define PIXELTYPE float
#define ARGTYPE float

Defines: #define DIM_2
#define BUFPIXELTYPE float
#define OUTPIXELTYPE float
#define PIXELDIM 1

Defines: #define DIM_2
#define PIXELTYPE float

Defines: #define DIM_2
#define BLOCK_SIZE 16
#define PIXELTYPE float
#define ARGTYPE float

Those defines are mentioned e.g. here:


but I don’t know what could print them to the console except OpenCL compiler. Which OpenCL implementation are you using? Did you set any debugging options to it? Are you sure this does not come from your script?

nvidia opencl impl. I use other opencl programs and another library, arrayfire, they don’t get printed over there unless programmer explicitly does it. This happens in ITK examples too.

Actually I found some std::couts in the code.

It is probably coming from those. These are not guarded with any condition, so I don’t have an option to disable them.

I guess you will need to modify the source code then. It would be good if you also submitted your changes as a pull request.

Sure, will send a PR soon on github.

@dzenanz I hit a roadblock with git hooks.

Utilities/KWStyle/ITKOverwrite.txt
./Utilities/Hooks/pre-commit-style.bash: line 127: /home/pradeep/gitroot/ITK/413/KWStyle-build/KWStyle: No such file or directory
pre-commit hook failure
-----------------------

KWStyle check failed.

Line numbers in the errors shown refer to the file:
Modules/Core/GPUCommon/include/itkGPUReduction.hxx.kws

I am not sure how to resolve this. Any help is appreciated.

The change I made to the relevant file is just deletion of std::cout line. You can look at the changes here

I temporarily made the commit (skipping verification) in my fork to hyperlink them here.

It looks like KWStyle was not built properly, or you made multiple binary trees from one source tree so things got confused. I made a PR from your branch.

I was switching tags and using the same binary tree, perhaps the I messed up the KWStyle build somehow - I am not fluent with its usage.

Thank you for raising the PR.