Skip to content

Commit

Permalink
[Error Message] Improve the error message (dmlc#1342)
Browse files Browse the repository at this point in the history
* patch

* fix+1

* add readme

* fix error message
  • Loading branch information
VoVAllen authored Mar 9, 2020
1 parent a013992 commit 53b39f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/kernel/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <dgl/runtime/ndarray.h>

#include <cstdint>
#include "../c_api_common.h"

namespace dgl {
namespace kernel {
Expand Down Expand Up @@ -45,13 +46,12 @@ namespace kernel {

// Macro for dispatch dtype flag to template argument. Currently only
// support float32.
#define DGL_DTYPE_SWITCH(val, DType, ...) \
if (val.code == kDLFloat && val.bits == 32) { \
typedef float DType; \
{__VA_ARGS__} \
} else { \
LOG(FATAL) << "Unsupported dtype: " << val.code << "_" \
<< val.bits; \
#define DGL_DTYPE_SWITCH(val, DType, ...) \
if (val.code == kDLFloat && val.bits == 32) { \
typedef float DType; \
{ __VA_ARGS__ } \
} else { \
LOG(FATAL) << "Unsupported dtype: " << val; \
}

// Macro for unrolling with data type arguments.
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/c_runtime_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class DeviceAPIManager {
auto* f = Registry::Get(factory);
if (f == nullptr) {
CHECK(allow_missing)
<< "Device API " << name << " is not enabled.";
<< "Device API " << name << " is not enabled. Please install the cuda version of dgl.";
return nullptr;
}
void* ptr = (*f)();
Expand Down

0 comments on commit 53b39f0

Please sign in to comment.