460_socl_opencl_extensions.doxy 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. /*! \page SOCLOpenclExtensions SOCL OpenCL Extensions
  17. SOCL is an OpenCL implementation based on StarPU. It gives a unified access to
  18. every available OpenCL device: applications can now share entities such as
  19. Events, Contexts or Command Queues between several OpenCL implementations.
  20. In addition, command queues that are created without specifying a device provide
  21. automatic scheduling of the submitted commands on OpenCL devices contained in
  22. the context to which the command queue is attached.
  23. Setting the <c>CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE</c> flag on a command
  24. queue also allows StarPU to reorder kernels queued on the queue, otherwise they
  25. would be serialized and several command queues would be necessary to see kernels
  26. dispatched on the various OpenCL devices.
  27. Note: this is still an area under development and subject to change.
  28. When compiling StarPU, SOCL will be enabled if a valid OpenCL
  29. implementation is found on your system. To be able to run the SOCL
  30. test suite, the environment variable \ref SOCL_OCL_LIB_OPENCL needs to
  31. be defined to the location of the file <c>libOpenCL.so</c> of the OCL
  32. ICD implementation. You should for example add the following line in
  33. your file <c>.bashrc</c>
  34. \verbatim
  35. export SOCL_OCL_LIB_OPENCL=/usr/lib/x86_64-linux-gnu/libOpenCL.so
  36. \endverbatim
  37. You can then run the test suite in the directory <c>socl/examples</c>.
  38. \verbatim
  39. $ make check
  40. ...
  41. PASS: basic/basic
  42. PASS: testmap/testmap
  43. PASS: clinfo/clinfo
  44. PASS: matmul/matmul
  45. PASS: mansched/mansched
  46. ==================
  47. All 5 tests passed
  48. ==================
  49. \endverbatim
  50. The environment variable \ref OCL_ICD_VENDORS has to point to the directory
  51. where the socl.icd ICD file is installed. When compiling StarPU, the files
  52. are in the directory <c>socl/vendors</c>. With an installed version of
  53. StarPU, the files are installed in the directory
  54. <c>$prefix/share/starpu/opencl/vendors</c>.
  55. To run the tests by hand, you have to call for example,
  56. \verbatim
  57. $ LD_PRELOAD=$SOCL_OCL_LIB_OPENCL OCL_ICD_VENDORS=socl/vendors/ socl/examples/clinfo/clinfo
  58. Number of platforms: 2
  59. Plaform Profile: FULL_PROFILE
  60. Plaform Version: OpenCL 1.1 CUDA 4.2.1
  61. Plaform Name: NVIDIA CUDA
  62. Plaform Vendor: NVIDIA Corporation
  63. 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
  64. Plaform Profile: FULL_PROFILE
  65. Plaform Version: OpenCL 1.0 SOCL Edition (0.1.0)
  66. Plaform Name: SOCL Platform
  67. Plaform Vendor: Inria
  68. Plaform Extensions: cl_khr_icd
  69. ....
  70. $
  71. \endverbatim
  72. To enable the use of CPU cores via OpenCL, one can set the \ref STARPU_OPENCL_ON_CPUS
  73. environment variable to 1 and \ref STARPU_NCPUS to 0 (to avoid using CPUs both via
  74. the OpenCL driver and the normal CPU driver).
  75. */