socl.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012 University of Bordeaux
  4. * Copyright (C) 2012 CNRS
  5. * Copyright (C) 2012 Vincent Danjean <Vincent.Danjean@ens-lyon.org>
  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. #include "socl.h"
  19. struct _cl_icd_dispatch socl_master_dispatch = {
  20. soclGetPlatformIDs,
  21. soclGetPlatformInfo,
  22. soclGetDeviceIDs,
  23. soclGetDeviceInfo,
  24. soclCreateContext,
  25. soclCreateContextFromType,
  26. soclRetainContext,
  27. soclReleaseContext,
  28. soclGetContextInfo,
  29. soclCreateCommandQueue,
  30. soclRetainCommandQueue,
  31. soclReleaseCommandQueue,
  32. soclGetCommandQueueInfo,
  33. soclSetCommandQueueProperty,
  34. soclCreateBuffer,
  35. soclCreateImage2D,
  36. soclCreateImage3D,
  37. soclRetainMemObject,
  38. soclReleaseMemObject,
  39. soclGetSupportedImageFormats,
  40. soclGetMemObjectInfo,
  41. soclGetImageInfo,
  42. soclCreateSampler,
  43. soclRetainSampler,
  44. soclReleaseSampler,
  45. soclGetSamplerInfo,
  46. soclCreateProgramWithSource,
  47. soclCreateProgramWithBinary,
  48. soclRetainProgram,
  49. soclReleaseProgram,
  50. soclBuildProgram,
  51. soclUnloadCompiler,
  52. soclGetProgramInfo,
  53. soclGetProgramBuildInfo,
  54. soclCreateKernel,
  55. soclCreateKernelsInProgram,
  56. soclRetainKernel,
  57. soclReleaseKernel,
  58. soclSetKernelArg,
  59. soclGetKernelInfo,
  60. soclGetKernelWorkGroupInfo,
  61. soclWaitForEvents,
  62. soclGetEventInfo,
  63. soclRetainEvent,
  64. soclReleaseEvent,
  65. soclGetEventProfilingInfo,
  66. soclFlush,
  67. soclFinish,
  68. soclEnqueueReadBuffer,
  69. soclEnqueueWriteBuffer,
  70. soclEnqueueCopyBuffer,
  71. soclEnqueueReadImage,
  72. soclEnqueueWriteImage,
  73. soclEnqueueCopyImage,
  74. soclEnqueueCopyImageToBuffer,
  75. soclEnqueueCopyBufferToImage,
  76. soclEnqueueMapBuffer,
  77. soclEnqueueMapImage,
  78. soclEnqueueUnmapMemObject,
  79. soclEnqueueNDRangeKernel,
  80. soclEnqueueTask,
  81. soclEnqueueNativeKernel,
  82. soclEnqueueMarker,
  83. soclEnqueueWaitForEvents,
  84. soclEnqueueBarrier,
  85. soclGetExtensionFunctionAddress,
  86. (void *) NULL, // clCreateFromGLBuffer,
  87. (void *) NULL, // clCreateFromGLTexture2D,
  88. (void *) NULL, // clCreateFromGLTexture3D,
  89. (void *) NULL, // clCreateFromGLRenderbuffer,
  90. (void *) NULL, // clGetGLObjectInfo,
  91. (void *) NULL, // clGetGLTextureInfo,
  92. (void *) NULL, // clEnqueueAcquireGLObjects,
  93. (void *) NULL, // clEnqueueReleaseGLObjects,
  94. (void *) NULL, // clGetGLContextInfoKHR,
  95. (void *) NULL, //
  96. (void *) NULL,
  97. (void *) NULL,
  98. (void *) NULL,
  99. (void *) NULL,
  100. (void *) NULL,
  101. (void *) NULL, // clSetEventCallback,
  102. (void *) NULL, // clCreateSubBuffer,
  103. (void *) NULL, // clSetMemObjectDestructorCallback,
  104. (void *) NULL, // clCreateUserEvent,
  105. (void *) NULL, // clSetUserEventStatus,
  106. (void *) NULL, // clEnqueueReadBufferRect,
  107. (void *) NULL, // clEnqueueWriteBufferRect,
  108. (void *) NULL, // clEnqueueCopyBufferRect,
  109. (void *) NULL, // clCreateSubDevicesEXT,
  110. (void *) NULL, // clRetainDeviceEXT,
  111. (void *) NULL, // clReleaseDeviceEXT,
  112. (void *) NULL,
  113. (void *) NULL, // clCreateSubDevices,
  114. (void *) NULL, // clRetainDevice,
  115. (void *) NULL, // clReleaseDevice,
  116. (void *) NULL, // clCreateImage,
  117. (void *) NULL, // clCreateProgramWithBuiltInKernels,
  118. (void *) NULL, // clCompileProgram,
  119. (void *) NULL, // clLinkProgram,
  120. (void *) NULL, // clUnloadPlatformCompiler,
  121. (void *) NULL, // clGetKernelArgInfo,
  122. (void *) NULL, // clEnqueueFillBuffer,
  123. (void *) NULL, // clEnqueueFillImage,
  124. (void *) NULL, // clEnqueueMigrateMemObjects,
  125. soclEnqueueMarkerWithWaitList, // clEnqueueMarkerWithWaitList,
  126. soclEnqueueBarrierWithWaitList, // clEnqueueBarrierWithWaitList,
  127. soclGetExtensionFunctionAddressForPlatform, // clGetExtensionFunctionAddressForPlatform,
  128. (void *) NULL, // clCreateFromGLTexture,
  129. (void *) NULL,
  130. (void *) NULL,
  131. (void *) NULL,
  132. (void *) NULL,
  133. (void *) NULL,
  134. (void *) NULL,
  135. (void *) NULL,
  136. (void *) NULL,
  137. (void *) NULL,
  138. (void *) NULL,
  139. (void *) NULL,
  140. (void *) NULL,
  141. (void *) NULL
  142. };
  143. struct _cl_platform_id socl_platform = {&socl_master_dispatch};
  144. const char * __attribute__ ((aligned (16))) SOCL_PROFILE = "FULL_PROFILE";
  145. const char * __attribute__ ((aligned (16))) SOCL_VERSION = "OpenCL 1.0 SOCL Edition (0.1.0)";
  146. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_NAME = "SOCL Platform";
  147. const char * __attribute__ ((aligned (16))) SOCL_VENDOR = "INRIA";
  148. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_EXTENSIONS = "cl_khr_icd";
  149. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_ICD_SUFFIX_KHR ="SOCL";
  150. /* Command queues with profiling enabled
  151. * This allows us to disable StarPU profiling it
  152. * is equal to 0
  153. */
  154. int __attribute__ ((aligned (16))) profiling_queue_count = 0;
  155. struct _cl_device_id * socl_devices = NULL;
  156. unsigned int socl_device_count = 0;