Created
February 6, 2011 18:59
-
-
Save skalarproduktraum/813610 to your computer and use it in GitHub Desktop.
How easy it is to use GCD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef USE_GCD | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
#endif | |
for(FloatType x = xMin; x <= xMax; x += xIntervalStep) { | |
#ifdef USE_GCD | |
dispatch_apply((yMax-yMin)/yIntervalStep, queue, ^(size_t yPoint) { | |
FloatType y = yMin + yPoint*yIntervalStep; | |
#else | |
for(FloatType y = yMin; y <= yMax; y += yIntervalStep) { | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment