460_socl_opencl_extensions.doxy 3.5 KB

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