We have implemented few algorithms using Halide language which uses arctan like trigonometric functions. But for the instrumentation purposes we want to force Halide not to generated vector instructions.
We are using visual c++ in windows and cl compiler in Visual Studio 2013 tool chain. So far trying to force cl using /arch:IA32 but it still generate vector instructions.
Is there a way to force this somehow from Halide language side or any way to intercept math library calls and there we can ask Halide to use arctan functions written by us which are not optimized to use vector instructions.
You ought to be able to set the
targetto be, say, host-x86-64 which should prevent Halide from using any vectorization (i.e using sse4/avx* instructions).If you are using AOT with generators, look at: http://halide-lang.org/tutorials/tutorial_lesson_15_generators_usage.html The my_first_generator_basic should not be using any SIMD instructions.
Not too familar with JIT, but this example shows how to set the target while JITing: https://github.com/halide/Halide/wiki/Minimal-GPU-example You should be able to use a similar approach to specify the target as x86-64.