clover: Use unreachable() from util/macros.h instead of assert(0).
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 8 Oct 2014 14:29:14 +0000 (17:29 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 11 Oct 2014 09:44:09 +0000 (12:44 +0300)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/Makefile.am
src/gallium/state_trackers/clover/core/device.cpp
src/gallium/state_trackers/clover/core/object.hpp

index cb1e9c292ac6a0895ff32cb9edf03a7b21245b30..62c13fa1e540110d28853d2a4b98f864fac4be83 100644 (file)
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
        $(GALLIUM_PIPE_LOADER_DEFINES) \
        -DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
        -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src \
        -I$(top_srcdir)/src/gallium/include \
        -I$(top_srcdir)/src/gallium/drivers \
        -I$(top_srcdir)/src/gallium/auxiliary \
index 12c9584854b214a83cf77ebf1a62f5bdef4ad541..688a7dd0893dd374cde08e428568297a8ac44986 100644 (file)
@@ -70,8 +70,7 @@ device::type() const {
    case PIPE_LOADER_DEVICE_PLATFORM:
       return CL_DEVICE_TYPE_GPU;
    default:
-      assert(0);
-      return 0;
+      unreachable("Unknown device type.");
    }
 }
 
@@ -84,8 +83,7 @@ device::vendor_id() const {
    case PIPE_LOADER_DEVICE_PCI:
       return ldev->u.pci.vendor_id;
    default:
-      assert(0);
-      return 0;
+      unreachable("Unknown device type.");
    }
 }
 
index 697565c807ac5608b84bd214c88392f30440818a..daad06848b4af0a691950437a7d2a6f83018f0fe 100644 (file)
@@ -32,6 +32,7 @@
 #include "core/error.hpp"
 #include "core/property.hpp"
 #include "api/dispatch.hpp"
+#include "util/macros.h"
 
 ///
 /// Main namespace of the CL state tracker.