Package: opencl-headers
Version: 1.2-2012.04.18a-1
Severity: normal

  Hi,

  Members of the Khronos group take care toguether to not use the same ID, in
particular for extensions. Released Khronos headers include these vendor
extensions (for example CL_DEVICE_PROFILING_TIMER_OFFSET_AMD in cl_ext.h).
  However, these extensions are not always included (or they are but too late).

  In particular, AMD has some extensions that are not present in the current
headers (even the last released one that are not packaged yet). This leads
to difficulties for people that want to compile OpenCL programs for AMD
plate-form using opencl-headers (see #695112). Current packaging of AMD OpenCL
(in non-free) do not repackage AMD headers. Instead, they depend on
opencl-headers.

  We have several possibilities:
[A] include AMD (and other verndors) extensions into opencl-headers
  AMD SDK packaging can still depend on opencl-headers
[B] let opencl-headers be the official, unmodified Khronos headers
  This will imply that AML headers must be packaged:
  [B1] at the same place (with Replace/Conflict)
  [B2] with other name
  [B3] into another directory (with the same name)

B1 should be avoided if possible (will lead to complexity when other
  vendors also have extensions)
B2 imply that user program sources must be modified (to include the
  new header names such as "amd-opencl.h")
B3 imply that compiler must use a correct -I option

  Knowing the OpenCL (with ICD) have been designed to allow multiple
runtime OpenCL implementations at run-time (with fundamental problems
from my point of view) and that the Khronos group try hard to avoid header
conflict, I would push for the [A] solution.

  If you agree, I prepared a patch (probably to add with quilt into
the debian package, in order to clearly separate it from the plain
Khronos headers) that apply to the last Khonos headers (ie not the
one in the current package, see #695124) and that adds the missing
AMD extensions.

  Regards,
    Vincent

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386 armel mipsel

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information
diff -ru a/cl_ext.h b/cl_ext.h
--- a/cl_ext.h	2012-11-30 12:49:46.000000000 +0100
+++ b/cl_ext.h	2012-05-14 09:44:34.000000000 +0200
@@ -40,6 +40,9 @@
	#include <CL/cl.h>
 #endif
 
+/* cl_khr_fp64 extension - no extension #define since it has no functions  */
+#define CL_DEVICE_DOUBLE_FP_CONFIG                  0x1032
+
 /* cl_khr_fp16 extension - no extension #define since it has no functions  */
 #define CL_DEVICE_HALF_FP_CONFIG                    0x1033
 
@@ -169,11 +130,46 @@
 #define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV            0x4005
 #define CL_DEVICE_INTEGRATED_MEMORY_NV              0x4006
 
+/*********************************
+* cl_amd_device_memory_flags *
+*********************************/
+#define cl_amd_device_memory_flags 1
+
+#define CL_MEM_USE_PERSISTENT_MEM_AMD       (1 << 6)        // Alloc from GPU's CPU visible heap
+
+/* cl_device_info */
+#define CL_DEVICE_MAX_ATOMIC_COUNTERS_EXT           0x4032
 
 /*********************************
 * cl_amd_device_attribute_query *
 *********************************/
 #define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD        0x4036
+#define CL_DEVICE_TOPOLOGY_AMD                      0x4037
+#define CL_DEVICE_BOARD_NAME_AMD                    0x4038
+#define CL_DEVICE_GLOBAL_FREE_MEMORY_AMD            0x4039
+#define CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD         0x4040
+#define CL_DEVICE_SIMD_WIDTH_AMD                    0x4041
+#define CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD        0x4042
+#define CL_DEVICE_WAVEFRONT_WIDTH_AMD               0x4043
+#define CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD           0x4044
+#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD      0x4045
+#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD 0x4046
+#define CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD   0x4047
+#define CL_DEVICE_LOCAL_MEM_BANKS_AMD               0x4048
+
+typedef union
+{
+    struct { cl_uint type; cl_uint data[5]; } raw;
+    struct { cl_uint type; cl_char unused[17]; cl_char bus; cl_char device; cl_char function; } pcie;
+} cl_device_topology_amd;
+
+#define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD            1
+
+
+/**************************
+* cl_amd_offline_devices *
+**************************/
+#define CL_CONTEXT_OFFLINE_DEVICES_AMD              0x403F
 
 #ifdef CL_VERSION_1_1
    /***********************************
@@ -239,7 +235,11 @@
     #define CL_PARTITION_BY_COUNTS_LIST_END_EXT         ((cl_device_partition_property_ext) 0)
     #define CL_PARTITION_BY_NAMES_LIST_END_EXT          ((cl_device_partition_property_ext) 0 - 1)
 
-
+    /* cl_ext_atomic_counters_32 and cl_ext_atomic_counters_64 extensions 
+     * no extension #define since they have no functions                                              
+     */
+    #define CL_DEVICE_MAX_ATOMIC_COUNTERS_EXT           0x4032
+    
 
 #endif /* CL_VERSION_1_1 */
 
diff -ru a/cl.h b/cl.h
--- a/cl.h	2012-11-30 01:49:11.000000000 +0100
+++ b/cl.h	2012-05-14 09:44:34.000000000 +0200
@@ -1152,6 +1147,15 @@
                              const cl_event *  /* event_wait_list */,
                              cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_2;
 
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetPrintfCallback(cl_context          /* context */,
+                    void (CL_CALLBACK * /* pfn_notify */)(cl_context /* program */, 
+                                                          cl_uint /*printf_data_len */, 
+                                                          char * /* printf_data_ptr */, 
+                                                          void * /* user_data */),
+                    void *              /* user_data */) CL_API_SUFFIX__VERSION_1_2;
+
+
 
 /* Extension function access
  *

Reply via email to