Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
53b39f06
Unverified
Commit
53b39f06
authored
Mar 09, 2020
by
Jinjing Zhou
Committed by
GitHub
Mar 09, 2020
Browse files
[Error Message] Improve the error message (#1342)
* patch * fix+1 * add readme * fix error message
parent
a0139923
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/kernel/common.h
src/kernel/common.h
+7
-7
src/runtime/c_runtime_api.cc
src/runtime/c_runtime_api.cc
+1
-1
No files found.
src/kernel/common.h
View file @
53b39f06
...
@@ -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.
...
...
src/runtime/c_runtime_api.cc
View file @
53b39f06
...
@@ -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
)();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment