socl.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-2012 Inria
  4. * Copyright (C) 2012,2017 CNRS
  5. * Copyright (C) 2010-2013 Université de Bordeaux
  6. * Copyright (C) 2012 Vincent Danjean
  7. *
  8. * StarPU is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * StarPU is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. */
  19. #include "socl.h"
  20. struct _cl_icd_dispatch socl_master_dispatch =
  21. {
  22. soclGetPlatformIDs,
  23. soclGetPlatformInfo,
  24. soclGetDeviceIDs,
  25. soclGetDeviceInfo,
  26. soclCreateContext,
  27. soclCreateContextFromType,
  28. soclRetainContext,
  29. soclReleaseContext,
  30. soclGetContextInfo,
  31. soclCreateCommandQueue,
  32. soclRetainCommandQueue,
  33. soclReleaseCommandQueue,
  34. soclGetCommandQueueInfo,
  35. soclSetCommandQueueProperty,
  36. soclCreateBuffer,
  37. soclCreateImage2D,
  38. soclCreateImage3D,
  39. soclRetainMemObject,
  40. soclReleaseMemObject,
  41. soclGetSupportedImageFormats,
  42. soclGetMemObjectInfo,
  43. soclGetImageInfo,
  44. soclCreateSampler,
  45. soclRetainSampler,
  46. soclReleaseSampler,
  47. soclGetSamplerInfo,
  48. soclCreateProgramWithSource,
  49. soclCreateProgramWithBinary,
  50. soclRetainProgram,
  51. soclReleaseProgram,
  52. soclBuildProgram,
  53. soclUnloadCompiler,
  54. soclGetProgramInfo,
  55. soclGetProgramBuildInfo,
  56. soclCreateKernel,
  57. soclCreateKernelsInProgram,
  58. soclRetainKernel,
  59. soclReleaseKernel,
  60. soclSetKernelArg,
  61. soclGetKernelInfo,
  62. soclGetKernelWorkGroupInfo,
  63. soclWaitForEvents,
  64. soclGetEventInfo,
  65. soclRetainEvent,
  66. soclReleaseEvent,
  67. soclGetEventProfilingInfo,
  68. soclFlush,
  69. soclFinish,
  70. soclEnqueueReadBuffer,
  71. soclEnqueueWriteBuffer,
  72. soclEnqueueCopyBuffer,
  73. soclEnqueueReadImage,
  74. soclEnqueueWriteImage,
  75. soclEnqueueCopyImage,
  76. soclEnqueueCopyImageToBuffer,
  77. soclEnqueueCopyBufferToImage,
  78. soclEnqueueMapBuffer,
  79. soclEnqueueMapImage,
  80. soclEnqueueUnmapMemObject,
  81. soclEnqueueNDRangeKernel,
  82. soclEnqueueTask,
  83. soclEnqueueNativeKernel,
  84. soclEnqueueMarker,
  85. soclEnqueueWaitForEvents,
  86. soclEnqueueBarrier,
  87. soclGetExtensionFunctionAddress,
  88. (void *) NULL, // clCreateFromGLBuffer,
  89. (void *) NULL, // clCreateFromGLTexture2D,
  90. (void *) NULL, // clCreateFromGLTexture3D,
  91. (void *) NULL, // clCreateFromGLRenderbuffer,
  92. (void *) NULL, // clGetGLObjectInfo,
  93. (void *) NULL, // clGetGLTextureInfo,
  94. (void *) NULL, // clEnqueueAcquireGLObjects,
  95. (void *) NULL, // clEnqueueReleaseGLObjects,
  96. (void *) NULL, // clGetGLContextInfoKHR,
  97. (void *) NULL, //
  98. (void *) NULL,
  99. (void *) NULL,
  100. (void *) NULL,
  101. (void *) NULL,
  102. (void *) NULL,
  103. (void *) NULL, // clSetEventCallback,
  104. (void *) NULL, // clCreateSubBuffer,
  105. (void *) NULL, // clSetMemObjectDestructorCallback,
  106. (void *) NULL, // clCreateUserEvent,
  107. (void *) NULL, // clSetUserEventStatus,
  108. (void *) NULL, // clEnqueueReadBufferRect,
  109. (void *) NULL, // clEnqueueWriteBufferRect,
  110. (void *) NULL, // clEnqueueCopyBufferRect,
  111. (void *) NULL, // clCreateSubDevicesEXT,
  112. (void *) NULL, // clRetainDeviceEXT,
  113. (void *) NULL, // clReleaseDeviceEXT,
  114. (void *) NULL,
  115. (void *) NULL, // clCreateSubDevices,
  116. (void *) NULL, // clRetainDevice,
  117. (void *) NULL, // clReleaseDevice,
  118. (void *) NULL, // clCreateImage,
  119. (void *) NULL, // clCreateProgramWithBuiltInKernels,
  120. (void *) NULL, // clCompileProgram,
  121. (void *) NULL, // clLinkProgram,
  122. (void *) NULL, // clUnloadPlatformCompiler,
  123. (void *) NULL, // clGetKernelArgInfo,
  124. (void *) NULL, // clEnqueueFillBuffer,
  125. (void *) NULL, // clEnqueueFillImage,
  126. (void *) NULL, // clEnqueueMigrateMemObjects,
  127. soclEnqueueMarkerWithWaitList, // clEnqueueMarkerWithWaitList,
  128. soclEnqueueBarrierWithWaitList, // clEnqueueBarrierWithWaitList,
  129. soclGetExtensionFunctionAddressForPlatform, // clGetExtensionFunctionAddressForPlatform,
  130. (void *) NULL, // clCreateFromGLTexture,
  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. (void *) NULL,
  143. (void *) NULL
  144. };
  145. struct _cl_platform_id socl_platform = {&socl_master_dispatch};
  146. const char * __attribute__ ((aligned (16))) SOCL_PROFILE = "FULL_PROFILE";
  147. const char * __attribute__ ((aligned (16))) SOCL_VERSION = "OpenCL 1.0 SOCL Edition (0.1.0)";
  148. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_NAME = "SOCL Platform";
  149. const char * __attribute__ ((aligned (16))) SOCL_VENDOR = "Inria";
  150. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_EXTENSIONS = "cl_khr_icd";
  151. const char * __attribute__ ((aligned (16))) SOCL_PLATFORM_ICD_SUFFIX_KHR ="SOCL";
  152. /* Command queues with profiling enabled
  153. * This allows us to disable StarPU profiling it
  154. * is equal to 0
  155. */
  156. int __attribute__ ((aligned (16))) profiling_queue_count = 0;
  157. struct _cl_device_id * socl_devices = NULL;
  158. unsigned int socl_device_count = 0;