Silent GCC warnings in release mode
authorbsegovia <devnull@localhost>
Tue, 29 Nov 2011 02:02:51 +0000 (02:02 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:15:03 +0000 (16:15 -0700)
CMakeLists.txt
setup_fulsim_hsw.sh [new file with mode: 0644]
setup_fulsim_ivb.sh [moved from setup_fulsim.sh with 100% similarity]
src/cl_command_queue.c
src/cl_device_id.c
src/cl_kernel.c
src/intel/cl_device_data.h

index 821adcd..07ed3b9 100644 (file)
@@ -18,7 +18,10 @@ SET(EMULATE_IVB CACHE BOOL "false")
 SET(EMULATE_SNB CACHE BOOL "false")
 ADD_DEFINITIONS(-D__$(USER)__)
 
-IF (EMULATE_IVB)
+IF (EMULATE_HSW)
+  SET (USE_FULSIM "true")
+  ADD_DEFINITIONS(-DEMULATE_GEN=75)
+ELSEIF (EMULATE_IVB)
   SET (USE_FULSIM "true")
   ADD_DEFINITIONS(-DEMULATE_GEN=7)
 ELSEIF (EMULATE_SNB)
@@ -27,7 +30,7 @@ ELSEIF (EMULATE_SNB)
 ELSE (EMULATE_IVB)
   SET (USE_FULSIM "false")
   ADD_DEFINITIONS(-DEMULATE_GEN=0)
-ENDIF (EMULATE_IVB)
+ENDIF (EMULATE_HSW)
 
 IF (USE_FULSIM)
   ADD_DEFINITIONS(-DUSE_FULSIM=1)
diff --git a/setup_fulsim_hsw.sh b/setup_fulsim_hsw.sh
new file mode 100644 (file)
index 0000000..140be66
--- /dev/null
@@ -0,0 +1,5 @@
+export INTEL_DEVID_OVERRIDE=0x0094
+export DEVICE=hsw_m0
+export OCL_FULSIM_RUN=1
+export OCL_FULSIM_DEBUG_MODE=$1
+
similarity index 100%
rename from setup_fulsim.sh
rename to setup_fulsim_ivb.sh
index b65a824..6976bcc 100644 (file)
@@ -482,7 +482,7 @@ cl_command_queue_ND_range(cl_command_queue queue,
 
   if (ver == 6)
     TRY (cl_command_queue_ND_range_gen6, queue, k, global_wk_off, global_wk_sz, local_wk_sz);
-  else if (ver == 7)
+  else if (ver == 7 || ver == 75)
     TRY (cl_command_queue_ND_range_gen7, queue, k, global_wk_off, global_wk_sz, local_wk_sz);
   else
     FATAL ("Unknown Gen Device");
index 0251ff6..b20b132 100644 (file)
@@ -36,9 +36,10 @@ static struct _cl_device_id intel_snb_gt2_device = {
   .max_clock_frequency = 1350,
   /* Does not really belong here, but for now this seems the most
    * natural place to put it */
-   .wg_sz = 512,
-   .compile_wg_sz = {0},       
-  #include "cl_gen6_device.h"
+  .wg_sz = 512,
+  .compile_wg_sz = {0},
+
+#include "cl_gen6_device.h"
 };
 
 static struct _cl_device_id intel_snb_gt1_device = {
@@ -49,7 +50,7 @@ static struct _cl_device_id intel_snb_gt1_device = {
   .wg_sz = 256,
   .compile_wg_sz = {0},        
 
-  #include "cl_gen6_device.h"
+#include "cl_gen6_device.h"
 };
 
 static struct _cl_device_id intel_ivb_gt2_device = {
@@ -57,10 +58,10 @@ static struct _cl_device_id intel_ivb_gt2_device = {
   .max_work_item_sizes = {512, 512, 512},
   .max_work_group_size = 512,
   .max_clock_frequency = 1000,
+  .wg_sz = 1024,
+  .compile_wg_sz = {0},        
 
-   .wg_sz = 1024,
-   .compile_wg_sz = {0},       
-  #include "cl_gen7_device.h"
+#include "cl_gen7_device.h"
 };
 
 static struct _cl_device_id intel_ivb_gt1_device = {
@@ -71,7 +72,7 @@ static struct _cl_device_id intel_ivb_gt1_device = {
   .wg_sz = 512,
   .compile_wg_sz = {0},        
 
-  #include "cl_gen7_device.h"
+#include "cl_gen7_device.h"
 };
 
 LOCAL cl_device_id
@@ -88,14 +89,14 @@ cl_get_gt_device(void)
     ret = &intel_ivb_gt1_device;
   }
   else if (device_id == PCI_CHIP_IVYBRIDGE_GT2   ||
-      device_id == PCI_CHIP_IVYBRIDGE_M_GT2) {
+           device_id == PCI_CHIP_IVYBRIDGE_M_GT2) {
     intel_ivb_gt2_device.vendor_id = device_id;
     intel_ivb_gt2_device.platform = intel_platform;
     ret = &intel_ivb_gt2_device;
   }
   else if (device_id == PCI_CHIP_SANDYBRIDGE_GT1   ||
-      device_id == PCI_CHIP_SANDYBRIDGE_M_GT1 ||
-      device_id == PCI_CHIP_SANDYBRIDGE_S_GT) {
+           device_id == PCI_CHIP_SANDYBRIDGE_M_GT1 ||
+           device_id == PCI_CHIP_SANDYBRIDGE_S_GT) {
     intel_snb_gt1_device.vendor_id = device_id;
     intel_snb_gt1_device.platform = intel_platform;
     ret = &intel_snb_gt1_device;
@@ -126,8 +127,8 @@ cl_get_device_ids(cl_platform_id    platform,
   if (UNLIKELY(platform != NULL && platform != intel_platform))
     return CL_INVALID_PLATFORM;
   if (num_devices && (device_type == CL_DEVICE_TYPE_CPU)) {
-       *num_devices = 0;
-       return CL_SUCCESS;      
+    *num_devices = 0;
+    return CL_SUCCESS; 
   }
 
   /* Detect our device (reject a non intel one or gen<6) */
@@ -259,6 +260,7 @@ cl_device_get_version(cl_device_id device, cl_int *ver)
   return CL_SUCCESS;
 }
 #undef DECL_FIELD
+
 #define DECL_FIELD(CASE,FIELD)                                      \
   case JOIN(CL_KERNEL_,CASE):                                       \
       if (param_value_size < sizeof(((cl_device_id)NULL)->FIELD))   \
@@ -270,26 +272,25 @@ cl_device_get_version(cl_device_id device, cl_int *ver)
              sizeof(((cl_device_id)NULL)->FIELD));                  \
         return CL_SUCCESS;
 
-LOCAL cl_int cl_get_kernel_workgroup_info(
-                               cl_device_id device,
-                               cl_kernel_work_group_info param_name,
-                               size_t param_value_size,
-                               void* param_value,
-                               size_t* param_value_size_ret)
+LOCAL cl_int
+cl_get_kernel_workgroup_info(cl_device_id device,
+                             cl_kernel_work_group_info param_name,
+                             size_t param_value_size,
+                             void* param_value,
+                             size_t* param_value_size_ret)
 {
-       if (UNLIKELY(device != &intel_snb_gt1_device &&
-                       device != &intel_snb_gt2_device &&
-                       device != &intel_ivb_gt1_device &&
-                       device != &intel_ivb_gt2_device))
-               return CL_INVALID_DEVICE;
-       if (UNLIKELY(param_value == NULL))
-               return CL_INVALID_VALUE;
-       
-       switch (param_name) {
-               DECL_FIELD(WORK_GROUP_SIZE, wg_sz)
-               DECL_FIELD(COMPILE_WORK_GROUP_SIZE, compile_wg_sz)
-               default: return CL_INVALID_VALUE;
-       };
-
+  if (UNLIKELY(device != &intel_snb_gt1_device &&
+               device != &intel_snb_gt2_device &&
+               device != &intel_ivb_gt1_device &&
+               device != &intel_ivb_gt2_device))
+    return CL_INVALID_DEVICE;
+  if (UNLIKELY(param_value == NULL))
+    return CL_INVALID_VALUE;
 
+  switch (param_name) {
+    DECL_FIELD(WORK_GROUP_SIZE, wg_sz)
+      DECL_FIELD(COMPILE_WORK_GROUP_SIZE, compile_wg_sz)
+    default: return CL_INVALID_VALUE;
+  };
 }
+
index 4e2fcbe..378e5c4 100644 (file)
@@ -808,7 +808,7 @@ cl_kernel_work_group_sz(cl_kernel ker,
                         size_t *wk_grp_sz)
 {
   cl_int err = CL_SUCCESS;
-  size_t sz;
+  size_t sz = 0;
   cl_uint i;
 
   for (i = 0; i < wk_dim; ++i)
index 2082cf1..bde7de5 100644 (file)
 #define IS_IVYBRIDGE(devid) (IS_IVB_GT1(devid) || IS_IVB_GT2(devid))
 #define IS_GEN7(devid)      IS_IVYBRIDGE(devid)
 
+#define PCI_CHIP_HASWELL_M0          0x0094
+#define PCI_CHIP_HASWELL_D0          0x0090
+#define PCI_CHIP_HASWELL_M           0x0091
+#define PCI_CHIP_HASWELL_L           0x0092
+
+#define IS_HASWELL(dev) ((dev)->pci_device == PCI_CHIP_HASWELL_M0 || \
+                         (dev)->pci_device == PCI_CHIP_HASWELL_D0 || \
+                         (dev)->pci_device == PCI_CHIP_HASWELL_M  || \
+                         (dev)->pci_device == PCI_CHIP_HASWELL_L)
+#define IS_GEN75(dev)  IS_HASWELL(dev)
+
 /* Open a connection to the X server and ask the kernel who we are. Returns -1
  * if no Intel GPU was found or an error was encountered in the probing
  * process