This commit is contained in:
Ciro Santilli 2015-11-26 14:30:51 +01:00
parent 429ffc3bf1
commit cfb412d2a5
8 changed files with 54 additions and 18 deletions

1
c/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tmp.c

View File

@ -1,24 +1,10 @@
/*
# builtin_expect
Basis for the `likely` and `unlikely` macros used extensively on the Linux kernel to help with branch prediction:
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
Says that we expect the left side expression and the right side long value to be the same almost always.
May reorder statements so that the likely side comes first to improve the CPU pipeline:
- http://stackoverflow.com/questions/109710/likely-unlikely-macros-in-the-linux-kernel-how-do-they-work-whats-their
- http://stackoverflow.com/questions/7346929/why-do-we-use-builtin-expect-when-a-straightforward-way-is-to-use-if-else
- http://unix.stackexchange.com/questions/11597/what-is-the-difference-between-likely-and-unlikely-calls-in-kernel
For this reason, you should always put the more likely branch first when
coding regardless of using this extension.
Good luck on making it generate noticeably more efficient code however:
http://stackoverflow.com/questions/1851299/is-it-possible-to-tell-the-branch-predictor-how-likely-it-is-to-follow-the-branc
*/
#include "common.h"

View File

@ -1,5 +1,7 @@
# Source tree
## Online browsing
## manual
## Documentation

8
opencl/applications.md Normal file
View File

@ -0,0 +1,8 @@
# Applications
- Monte Carlo
- PDEs
- <https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model>
- Reverse Time Migration: RTM <http://www.slb.com/services/seismic/geophysical_processing_characterization/dp/technologies/depth/prestackdepth/rtm.aspx>

View File

@ -7,6 +7,30 @@
Tutorials with sample code:
- <https://github.com/sschaetz/nvidia-opencl-examples>
- <https://github.com/enjalot/adventures_in_opencl> Did not work out of the box for me.
- <https://github.com/sschaetz/nvidia-opencl-examples> hosts the samples from <https://developer.nvidia.com/opencl>. But a header is missing: <https://github.com/sschaetz/nvidia-opencl-examples/issues/1>
- <http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-2-0-samples/> AMD samples. TODO could not find them yet...
- <https://github.com/enjalot/adventures_in_opencl> Worked after `sudo apt-get install libxmu-dev libxi-dev`.
- <https://github.com/bgaster/opencl-book-samples> The book is commercial.
- <https://github.com/vpeurala/openclhelloworld> Simple hello world.
Demos:
- <https://bitbucket.org/sirbrialliance/raytrace> <https://www.youtube.com/watch?v=-5PubFKdV_w>
Big programs:
- <https://github.com/bulletphysics/bullet3>
- <https://www.youtube.com/watch?v=8jGZv1YYe2c>
- <https://www.youtube.com/watch?v=-6Sl5CCxp3Q>
- <https://www.youtube.com/watch?v=J9HaT23b-xc>
- <https://github.com/nthend/cltracer>
- Computer vision:
- Hough transform: <https://www.youtube.com/watch?v=vn9y7t9iqC8>
- Interactive fluid simulations
- <https://www.youtube.com/watch?v=LGTxZRRwvsI>

View File

@ -40,6 +40,13 @@ MIT and LLVM based.
## Alternatives
- OpenMP: <http://stackoverflow.com/questions/7263193/opencl-performance-vs-openmp>
- <https://en.wikipedia.org/wiki/CUDA> NVIDIA's
- OpenMP <http://stackoverflow.com/questions/7263193/opencl-performance-vs-openmp>
- <https://en.wikipedia.org/wiki/Cilk> Intel's
- <https://en.wikipedia.org/wiki/DirectCompute> Microsoft's
- <https://en.wikipedia.org/wiki/Unified_Parallel_C>
- <https://en.wikipedia.org/wiki/Cilk>
## OpenCL + OpenGL for real time rendering of complex calculations
- <http://stackoverflow.com/questions/4005935/mix-opencl-with-opengl>
- <http://enja.org/2010/08/27/adventures-in-opencl-part-2-particles-with-opengl/>

View File

@ -6,3 +6,7 @@
- <https://www.opengl.org/registry/doc/glspec21.20061201.pdf> 2.1 spec
- <https://www.opengl.org/sdk/docs/man2/> 2.1 online reference
- Demos:
- <https://github.com/prideout/recipes>

View File

@ -51,3 +51,7 @@ Good way to get information on OpenGL in Linux:
glxinfo | grep -i opengl
Made for the X Window System, but also shows OpenGL information.
## Users
- <https://en.wikipedia.org/wiki/OGRE> OpenGL rendering front-end that supports multiple backends, including Direct3D as well. Not a full game engine.