KNN_threads.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _KNN_threads_h_
  2. #define _KNN_threads_h_
  3. /* KNN_threads.h
  4. *
  5. * Copyright (C) 2009 Ola Söder
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /*
  21. * os 20090123 First version
  22. * pb 2011/03/08 C++
  23. */
  24. /////////////////////////////////////////////////////
  25. // //
  26. /////////////////////////////////////////////////////
  27. // Error codes
  28. enum KNN_thread_status
  29. {
  30. KNN_THREAD_OK,
  31. KNN_THREAD_ERROR
  32. };
  33. // Query the number of available CPUs
  34. int KNN_getNumberOfCPUs ();
  35. // Distribute the work specified by
  36. // (*function) and input over nthreads
  37. // threads
  38. void * KNN_threadDistribution
  39. (
  40. void * (* function) (void *),
  41. void ** input,
  42. int nthreads
  43. );
  44. // Test threading
  45. void KNN_threadTest ();
  46. // Test threading aux
  47. void * KNN_threadTestAux
  48. (
  49. void * dummy
  50. );
  51. /* End of file KNN_threads.h */
  52. #endif