460_socl_opencl_extensions.doxy 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2016 CNRS
  5. * Copyright (C) 2011, 2012 INRIA
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \page SOCLOpenclExtensions SOCL OpenCL Extensions
  9. SOCL is an OpenCL implementation based on StarPU. It gives a unified access to
  10. every available OpenCL device: applications can now share entities such as
  11. Events, Contexts or Command Queues between several OpenCL implementations.
  12. In addition, command queues that are created without specifying a device provide
  13. automatic scheduling of the submitted commands on OpenCL devices contained in
  14. the context to which the command queue is attached.
  15. Setting the <c>CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE</c> flag on a command
  16. queue also allows StarPU to reorder kernels queued on the queue, otherwise they
  17. would be serialized and several command queues would be necessary to see kernels
  18. dispatched on the various OpenCL devices.
  19. Note: this is still an area under development and subject to change.
  20. When compiling StarPU, SOCL will be enabled if a valid OpenCL
  21. implementation is found on your system. To be able to run the SOCL
  22. test suite, the environment variable \ref SOCL_OCL_LIB_OPENCL needs to
  23. be defined to the location of the file <c>libOpenCL.so</c> of the OCL
  24. ICD implementation. You should for example add the following line in
  25. your file <c>.bashrc</c>
  26. \verbatim
  27. export SOCL_OCL_LIB_OPENCL=/usr/lib/x86_64-linux-gnu/libOpenCL.so
  28. \endverbatim
  29. You can then run the test suite in the directory <c>socl/examples</c>.
  30. \verbatim
  31. $ make check
  32. ...
  33. PASS: basic/basic
  34. PASS: testmap/testmap
  35. PASS: clinfo/clinfo
  36. PASS: matmul/matmul
  37. PASS: mansched/mansched
  38. ==================
  39. All 5 tests passed
  40. ==================
  41. \endverbatim
  42. The environment variable \ref OCL_ICD_VENDORS has to point to the directory
  43. where the socl.icd ICD file is installed. When compiling StarPU, the files
  44. are in the directory <c>socl/vendors</c>. With an installed version of
  45. StarPU, the files are installed in the directory
  46. <c>$prefix/share/starpu/opencl/vendors</c>.
  47. To run the tests by hand, you have to call for example,
  48. \verbatim
  49. $ LD_PRELOAD=$SOCL_OCL_LIB_OPENCL OCL_ICD_VENDORS=socl/vendors/ socl/examples/clinfo/clinfo
  50. Number of platforms: 2
  51. Plaform Profile: FULL_PROFILE
  52. Plaform Version: OpenCL 1.1 CUDA 4.2.1
  53. Plaform Name: NVIDIA CUDA
  54. Plaform Vendor: NVIDIA Corporation
  55. Plaform Extensions: cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll
  56. Plaform Profile: FULL_PROFILE
  57. Plaform Version: OpenCL 1.0 SOCL Edition (0.1.0)
  58. Plaform Name: SOCL Platform
  59. Plaform Vendor: INRIA
  60. Plaform Extensions: cl_khr_icd
  61. ....
  62. $
  63. \endverbatim
  64. To enable the use of CPU cores via OpenCL, one can set the \ref STARPU_OPENCL_ON_CPUS
  65. environment variable to 1 and \ref STARPU_NCPUS to 0 (to avoid using CPUs both via
  66. the OpenCL driver and the normal CPU driver).
  67. */