I recently needed to accelerate a convolution operation in C ++ and I wondered if it is possible in some way, without using OpenGL or OpenCL, to use some functions of the Intel HD Graphics 4000 to speed up some operations such as convolution or matrix multiplication.
Short answer: to my best knowledge, there is no non-hacky, documented, compiler-independent, standard C++ way here.
Intel provides a convolution example using Intel Compiler specific extensions here:
https://software.intel.com/en-us/node/610441
However, the Cilk Plus stuff became deprecated with the 18.0 compiler.
The
Release Notes
state offload support for Intel® Graphics Technology.
The required command line flag is -qopenmp-offload=gfx.
So the most portable non-OpenCL way would be using OpenMP Offload directives. They might get implemented for the Intel Graphics architecture by other compilers as well at some point. Also, the code would still be portable and default to self-offloading for architectures not supported by the used compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With