Unverified Commit 53b39f06 authored by Jinjing Zhou's avatar Jinjing Zhou Committed by GitHub
Browse files

[Error Message] Improve the error message (#1342)

* patch

* fix+1

* add readme

* fix error message
parent a0139923
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <dgl/runtime/ndarray.h> #include <dgl/runtime/ndarray.h>
#include <cstdint> #include <cstdint>
#include "../c_api_common.h"
namespace dgl { namespace dgl {
namespace kernel { namespace kernel {
...@@ -45,13 +46,12 @@ namespace kernel { ...@@ -45,13 +46,12 @@ namespace kernel {
// Macro for dispatch dtype flag to template argument. Currently only // Macro for dispatch dtype flag to template argument. Currently only
// support float32. // support float32.
#define DGL_DTYPE_SWITCH(val, DType, ...) \ #define DGL_DTYPE_SWITCH(val, DType, ...) \
if (val.code == kDLFloat && val.bits == 32) { \ if (val.code == kDLFloat && val.bits == 32) { \
typedef float DType; \ typedef float DType; \
{__VA_ARGS__} \ { __VA_ARGS__ } \
} else { \ } else { \
LOG(FATAL) << "Unsupported dtype: " << val.code << "_" \ LOG(FATAL) << "Unsupported dtype: " << val; \
<< val.bits; \
} }
// Macro for unrolling with data type arguments. // Macro for unrolling with data type arguments.
......
...@@ -85,7 +85,7 @@ class DeviceAPIManager { ...@@ -85,7 +85,7 @@ class DeviceAPIManager {
auto* f = Registry::Get(factory); auto* f = Registry::Get(factory);
if (f == nullptr) { if (f == nullptr) {
CHECK(allow_missing) CHECK(allow_missing)
<< "Device API " << name << " is not enabled."; << "Device API " << name << " is not enabled. Please install the cuda version of dgl.";
return nullptr; return nullptr;
} }
void* ptr = (*f)(); void* ptr = (*f)();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment